View Full Version : Div class background doesn't show in IE


mary_maier
07-29-2006, 11:00 PM
I'm trying to create a menu with an unlinked section above a group of links (in a list). The site can be found here (http://marymaier.com/lala), but I included what I believe is the problem. The problem is, the darker orange background (#ff9900) won't show up in IE but shows up fine in FF.

If you're looking at my site, the unlinked areas currently shows the lighter background (elsewhere in CSS files) instead of the darker one that I want it to show.

I'm only including the problematic CSS since the rest of it seems to work fine.

.lefttitle
{
border-left: none;
border-right: solid 1px #000;
border-top: none;
border-bottom: none;
background:#FF9900;
padding: 2px 8px;
font-size:14px;
font-weight:bold;
}
.righttitle
{
border-left: solid 1px #000;
border-right: none;
border-top: none;
border-bottom: solid 1px #000;
background:#FF9900;
padding: 2px 8px;
font-size:14px;
font-weight:bold;
}

And here is the HTML.

<div class="lefttitle">General Info (needs bg)</div>
<ul>
<li><a href="">General Info (link)</a></li>
</ul>

mary_maier
07-30-2006, 01:57 AM
Nevermind, got it! I figured a way around it by changing the background color of the border of the page container that gave the menu its lighter orange color. Weird but hey, I'm not arguing with it.

bourdelson
07-30-2006, 04:26 AM
Simple enough! I must be getting better at this or something, haha. :D

Just so you know, though, in CSS classification, if you're using a color for your background, you should use background-color:#000000; as opposed to just background:#000000;.

Turquoise
07-30-2006, 11:44 AM
background:#000000 is fine, it's a shorthand property of CSS.
(see this link (http://www.456bereastreet.com/archive/200502/efficient_css_with_shorthand_properties/))

bourdelson
07-30-2006, 02:31 PM
Hmm. I was taught that you weren't supposed to do use just background:blah blah; unless you were combining multiple background elements. Oh, well. :)

pb&j
07-30-2006, 05:58 PM
i would side with bourdelson.

yes it is shorthand, but if there is only one value, then its not really shorthand is it? you would use BORDER when there are more than one value. this same ideal is displayed on the linked page from Turquoise post.

there have been cases when using only BORDER for only the color has posed problems in some browsers. so if you are only specifying one part, then its best to use its correct property designation.

Turquoise
07-30-2006, 06:07 PM
Really? Sorry for being misleading then, I always just assumed the other way was, while perhaps not better, still acceptable usage.

I'm fine with being wrong though, in fact, I'm pretty sure I am at the moment! ;)