tags:

views:

43

answers:

2

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 div 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

+1  A: 

use div > div > div etc.

div div will match every div below another div

knittl
I've noticed that this works for every browser except IE6... is there anyway around this for IE6?I renamed stuff like .thisforexample > div > div > div
cappuccino
this does not work in IE6, because IE6 does not support full css 2, to work around you can use classes or ids. but i really recommend to rethink your whole approach, there's too much divs there, i bet there's an easier solution to solve this
knittl
A: 

THANKS knittl!!!!!!!!!!! worked like a charm, i'm still getting a handle on css so thanks for that :)

cappuccino