...

View Full Version : Division Background color only shows in IE...Why?



solyluna
10-06-2004, 04:22 PM
Some items of importance on our home page our highligted.
The color shows fine in IE, but Mozilla, FireFox, Opera and NS seem to ignore it.
I created different classes for different colors,
Example:<div class="highlight"> SomeText </div> will give the color assigned to 'highlight" in IE, but is totally ignored in other browsers.
Is there a work around for this?

gohankid77
10-06-2004, 05:07 PM
Um, could we possibly obtain a URL or see some code?

It sounds like you did everything right:



div.highlight {
background-color: #00f; /* just an example */
}

Catman
10-06-2004, 05:37 PM
As gohankid77 says, it's hard to say without seeing the code. But my first guess is that you've used an uppercase letter in naming your class but used all lower case in the HTML. All the browsers you list as not showing the background color require that the class name match exactly, both case and letters.

AaronW
10-06-2004, 05:39 PM
And if the text is inline, you ought to be using a <span> :P

solyluna
10-06-2004, 05:58 PM
http://www.kpft.org


<span> tag cuts of at the end of the sentence, and makes the display look ugly, hence the <div>.

body {text-decoration:none; font-family:Verdana, Arial, Helvetica, sans-serif; font-weight:normal; font-size:11px; }
.maintext{
position:relative;
left:11px;
overflow: scroll;
visibility: visible;
z-index: auto;

}
.sidemenu{ position:relative;left:5px}
table {text-decoration:none; font-family:arial, sans-serif; font-size:11px; }
td {text-decoration:none; font-family:arial, sans-serif; font-size:11px; }
.menutext {font-family: Arial, Helvetica, sans-serif;color: #FFFFCC;font-size: 11px;}
a:link {text-decoration:none; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; font-color=#333333; }
a:visited {text-decoration:none; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; font-color: #800040; }
A:hover {color: #dedeca ; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; text-decoration: underline; background-color: #330000; }
.class.special{ background-color: #cccccc; }
.class.background{ background-color: #cccc99; }
.class.highlight{ background-color: #9affbc; }
.class.bgone{ background-color: #ffcc99; }
.class.bgtwo{ background-color: #ffcccc; }
.class.bgthree{ background-color: #9999ff; }
.class.bgfour{ background-color: #bbf888; }
.class.bgfive{ background-color: #ffc18c; }
.class.bgsix{ background-color: #d9bddb; }
.class.bgseven{ background-color: #f887bd; }
.class.bgeight{ background-color: #c9f69d; }
.class.bgnine { background-color: #7bbd2e; }
.class.marker { background-color: lime; }
.class.frontpage { background-color: #21176f; }
.class.maincontent { background-color: #304e72; }
.class.congrats { background-color: #b2a860; }

AaronW
10-06-2004, 06:07 PM
Remove .class for your class names...

The proper syntax for a class selector:

.className {}

That would select class="className". Why you have .class.className, I have no idea...

gohankid77
10-06-2004, 06:14 PM
Perhaps solyluna is used to scripting? I don't know since I don't script (much).

AaronW
10-06-2004, 06:15 PM
She got .sidemenu and .maintext right, though... Heh. Unless it was a collaborative style sheet.

solyluna
10-06-2004, 08:36 PM
Thanks!
That's what you get for not looking at Everything when you let some one else work on a collaborative effort. Since it worked in IE I never paid a lot of attention to the syntax.
Thanks for putting me straight - IE is WAAAYYY too forgiving...

solyluna
10-10-2004, 04:00 PM
Everything looks right now in ALL browsers, except Netscape 4.8.
Thanks again!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum