Forum Moderators: not2easy
<ul>
<li>Stuff</li>
<li class="myClass">Things</li>
<ul>
<li>Foo</li>
<li>Bar</li>
</ul>
<li>Other stuff</li>
</ul>
.myClass {
background: red;
}
I would think this would be a common problem, but I haven't been able to find any solutions on google.
Thanks very much for any help. Let me know if you would like to see a less abstract example.
It should be.
<ul>
<li>Stuff</li>
<li class="myClass">Things
<ul>
<li>Foo</li>
<li>Bar</li>
</ul>
</li>
<li>Other stuff</li>
</ul> However this will make the problem you are having appear in both browsers.
to over come this, you ned to overwrite the myclass bg, like so:
.myClass {
background: red;
}
.myClass ul{
background: green;
}
.myClass {
border-left: thin solid red;
}
.myClass ul {
border-left: none;
}
You end up with something like this (forgive ASCII):
¦Thing
¦ ¦Foo
¦ ¦Bar
Other Stuff
¦Thing
¦Foo
¦Bar
Other Stuff
.myClass a {
border-left: thin solid red;
}
¦Long wrapping
¦text
¦Foo
¦Bar
¦Long wrapping
text
¦Foo
¦Bar
Any suggestions for that? Thanks much for the help you've offered so far.
1. Set the parent
<li> a background image of a border on the left (li { background: #fff url('images/border.jpg') repeat-y; }) 2. Set the nested
<ul> to remove its default margin and replace it with padding instead (li ul { margin: 0px; padding: 5px 10px 5px 25px; }) 3. Set nested
<ul>'s to have another background image, which is your different type of border (whether it's just an image with 10px of whitespace to the left of it or whatever) Check: Dependent on whether you want this border to show throughout the entire parent
<ul>, you can set the background image to the <ul> itself, instead of the <li> in step 1. Hope that helps :)