Is this a CSS inheritance issue?
This is my css:
.sub-content-border {
background-image: url(/images/borders/sub-content/top.gif);
background-repeat: repeat-x;
background-position: top;
}
.sub-content-border div {
background-image: url(/images/borders/sub-content/bottom.gif);
background-repeat: repeat-x;
background-position: bottom;
}
.sub-content-border div div {
background-image: url(/images/borders/sub-content/left.gif);
background-repeat: repeat-y;
background-position: left;
}
.sub-content-border div div div {
background-image: url(/images/borders/sub-content/right.gif);
background-repeat: repeat-y;
background-position: right;
}
.sub-content-border div div div div {
background-image: url(/images/borders/sub-content/top-left.gif);
background-repeat: no-repeat;
background-position: left top;
}
.sub-content-border div div div div div {
background-image: url(/images/borders/sub-content/top-right.gif);
background-repeat: no-repeat;
background-position: right top;
}
.sub-content-border div div div div div div {
background-image: url(/images/borders/sub-content/bottom-left.gif);
background-repeat: no-repeat;
background-position: left bottom;
}
.sub-content-border div div div div div div div {
background-image: url(/images/borders/sub-content/bottom-right.gif);
background-repeat: no-repeat;
background-position: right bottom;
padding: 18px;
}
.sub-content-border div div div div d开发者_如何学运维iv div div div {
background-image: url(/images/blank.gif);
padding: 0px;
}
This is my HTML:
<div class="sub-content-border"><div><div><div><div><div><div><div><div>
Test
<div class="sub-content-border"><div><div><div><div><div><div><div><div>
Test
</div></div></div></div></div></div></div></div></div>
</div></div></div></div></div></div></div></div></div>
However, rather than getting a frame inside a frame, the inside frame does no exist (see image: i47.tinypic.com/kcihcy.jpg)
Does anyone know why?
However, if i do a dirty trick and add the CSS in styles, it shows up:
<div class="sub-content-border"><div><div><div><div><div><div><div><div>
Test
<div class="sub-content-border" style="background-image: url(/images/borders/sub-content/top.gif); background-repeat: repeat-x; background-position: top;">
<div style="background-image: url(/images/borders/sub-content/bottom.gif); background-repeat: repeat-x; background-position: bottom;">
<div style="background-image: url(/images/borders/sub-content/left.gif); background-repeat: repeat-y; background-position: left;">
<div style="background-image: url(/images/borders/sub-content/right.gif); background-repeat: repeat-y; background-position: right;">
<div style="background-image: url(/images/borders/sub-content/top-left.gif); background-repeat: no-repeat; background-position: left top;">
<div style="background-image: url(/images/borders/sub-content/top-right.gif); background-repeat: no-repeat; background-position: right top;">
<div style="background-image: url(/images/borders/sub-content/bottom-left.gif); background-repeat: no-repeat; background-position: left bottom;">
<div style="background-image: url(/images/borders/sub-content/bottom-right.gif); background-repeat: no-repeat; background-position: right bottom; padding: 18px;">
<div style="background-image: url(/images/blank.gif); padding: 0px;">
Test
</div></div></div></div></div></div></div></div></div>
</div></div></div></div></div></div></div></div></div>
see image: http://i46.tinypic.com/2dh9ut2.jpg
use div > div > div
etc.
div div
will match every div below another div
精彩评论