Where's the background?

W

wolfing1

Can someone show me the light?
I have this piece of code:
<td><div id="size2" class="notSelectedSize">L</div></td>

and these are the CSS classes:
..notselectedsize
{
BORDER-RIGHT: #ffe4b5 1pt solid;
BORDER-TOP: #ffe4b5 1pt solid;
FONT-SIZE: 8pt;
BORDER-LEFT: #ffe4b5 1pt solid;
WIDTH: 25px;
CURSOR: pointer;
COLOR: black;
BORDER-BOTTOM: #ffe4b5 1pt solid;
FONT-FAMILY: Arial;
HEIGHT: 20px;
BACKGROUND-COLOR: #b9ac97;
TEXT-ALIGN: center
}

Why does it show with the dark background and 25x20 size (from class
NotSelectedSize) in firefox as I want it, but in IE6 it shows with no
background and small size? Guess I can understand the size as I don't
think I can control a <div> width and height via CSS, but what about
the background and foreground colors? why don't they show in IE?
 
B

Beauregard T. Shagnasty

Edwin said:
(e-mail address removed) wrote:

[snip]
TEXT-ALIGN: center
there is a ";" missing.

No, that's ok for the last one in the class, though it is certainly
advisable to put a semi-colon there - in case you want to add another
attribute later. <g>

The OP's CSS could use some consolidation, too, such as combining all
the border sides to one line. And of course changing the font size from
points to a percentage. Points are for printing.
 
W

wolfing1

Toby said:
thisisinlowercase

--
Are CSS class names case sensitive? I didn't copy/paste the text so
it's all probably lowercase anyway, but I'll check when I get back to
the office on Monday.
Thanks for the suggestions but so far no explanation of why IE would
not show the background and Firefox would (unless it's in the
lowercase/camelcase difference that maybe Firefox ignores case and IE
doesn't? but still the case may be all lowercase but I just typed it
in camelcase). Don't think consolidating the style in one line would
change anything but guess that's better coding style?
 
T

Toby Inkster

wolfing1 said:
Are CSS class names case sensitive?

CSS says that they're case sensitive if the document language (i.e. HTML
in this case) is case sensitive. In HTML, element names aren't case-sensitive,
but classes and IDs are.
Thanks for the suggestions but so far no explanation of why IE would
not show the background and Firefox would (unless it's in the
lowercase/camelcase difference that maybe Firefox ignores case and IE
doesn't?

It seems to depend on quirks mode. Just make sure you're consistent with
cases and you should be OK.
 
W

wolfing1

Toby said:
CSS says that they're case sensitive if the document language (i.e. HTML
in this case) is case sensitive. In HTML, element names aren't case-sensitive,
but classes and IDs are.


It seems to depend on quirks mode. Just make sure you're consistent with
cases and you should be OK.
Oh, forgot to put some final comments here for future generations :)
It was indeed the case! I'll be damned, I thought CSS was case
insensitive. Normally it's not a problem for me as I use lowercase
most of the time, but for some reason I decided to use some uppercases
for a couple of styles, and that was the problem. In fact, I guess
different browsers treat case sensitivity differently, as Firefox took
the styles while IE didn't.
Thanks! I would have NEVER found this problem out on my own.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top