Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/jsf/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html Firefox 15:div内容溢出到边框图像_Html_Css_Firefox - Fatal编程技术网

Html Firefox 15:div内容溢出到边框图像

Html Firefox 15:div内容溢出到边框图像,html,css,firefox,Html,Css,Firefox,首先,我知道Firefox 15中的-moz边框图像未经修复,如下所述: . 在这方面,我修正了我的CSS与Firefox15的配合。我的问题不同(尽管可能是无关紧要的) 简言之,在Firefox15中,带有边框图像的div的内容现在与所述边框图像重叠,就好像边框是div内部的一部分。 其他浏览器不会显示问题并按预期运行,这使得我无法简单地用填充来补偿边框(其他浏览器会有过多的填充) 我如何解决这个问题?谢谢 参见第页 我的代码: <style type="text/css">

首先,我知道Firefox 15中的-moz边框图像未经修复,如下所述: . 在这方面,我修正了我的CSS与Firefox15的配合。我的问题不同(尽管可能是无关紧要的)

简言之,在Firefox15中,带有边框图像的div的内容现在与所述边框图像重叠,就好像边框是div内部的一部分。 其他浏览器不会显示问题并按预期运行,这使得我无法简单地用填充来补偿边框(其他浏览器会有过多的填充)

我如何解决这个问题?谢谢

参见第页

我的代码:

<style type="text/css">

    body { background: yellow; }

    .borderbox {
    -moz-border-image: url(border_sprite.png) 31 25 25 20 / 31px 25px 25px 20px repeat stretch;
    -webkit-border-image: url(border_sprite.png) 31 25 25 20 fill repeat stretch;
    -o-border-image: url(border_sprite.png) 31 25 25 20 repeat stretch;
    border-image: url(border_sprite.png) 31 25 25 20 fill repeat stretch;
    border-width: 31px 25px 25px 20px;
    border-image-width: 31px 25px 25px 20px;
    padding: 0 10px 20px 0;
    text-align: right;
    overflow: auto;
    width: 400px;
    height: 400px;
    color: purple;
    font-size: 20px;
 }

</style>

<!DOCTYPE html>
<head></head>
<body>

<div class="borderbox">
    the content should be bound to the inner white box. Why does it also cover the blue border in Firefox 15?
</div>

</body>
</html>

正文{背景:黄色;}
.边框框{
-moz边框图像:url(border_sprite.png)312525/31px25px25px20px重复拉伸;
-webkit边框图像:url(border_sprite.png)31 25 20填充重复拉伸;
-o-border-image:url(border_sprite.png)312520重复拉伸;
边框图像:url(border_sprite.png)31 25 20填充重复拉伸;
边框宽度:31px 25px 25px 20px;
边框图像宽度:31px 25px 25px 20px;
填充:0 10px 20px 0;
文本对齐:右对齐;
溢出:自动;
宽度:400px;
高度:400px;
颜色:紫色;
字体大小:20px;
}
内容应绑定到内部的白色框。为什么它还覆盖Firefox15中的蓝色边框?

终于找到了答案——如此简单(但似乎武断)。将以下属性添加到div的样式中:

border-style: solid;

这不是武断的。只是
边框图像
用于强制Gecko中的
边框样式:实心
,但根据规范,它不再这样做了。