当我尝试在网站中使用边框图像使徽标显示为边框时,该图像甚至不会显示在页面上。我尝试使用的任何浏览器都无法使用它,并且图像位于同一文件夹中。我肯定知道我正在修改正确的div,因为当我添加border-radius时,边框会变为圆形。我真的不知道我在做什么错,因此我将不胜感激。这是CSS中的div:
#outer_container {
height: 1495px;
width: 925px;
margin-right: auto;
margin-left: auto;
background-repeat: repeat-x;
background-attachment: fixed;
background-color: #E7EAF5;
border-style: solid;
border-width: 38px 0px 0px;
-moz-border-image: url(logo.gif) 81 0 repeat stretch;
-webkit-border-image: url(logo.gif) 81 0 repeat stretch;
-o-border-image: url(logo.gif) 81 0 repeat stretch;
border-image: url(logo.gif) 81 0 fill repeat stretch;
}
最佳答案
根据here和Alex Rozanski的说法,如W3所示:
部分URL是相对于样式表的源而不是相对于文档来解释的。
如果考虑到这一点,这是有道理的,因为可以将CSS文件添加到不同目录中的页面,因此将其标准化为CSS文件意味着URL可以在添加样式表的任何地方使用。
关于html - CSS中的边框图像问题,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/22072758/