PDA

View Full Version : CSS validation woes ...



brothercake
Jan 21st, 2003, 11:11 PM
This is all very picky I know, but I've been going back to basics lately, trying to eradicate all the proprietary hacks I've picked up over the last couple of years ...


Anyway - w3c's CSS validator gives a number of warnings I don't get. Here's one:

Line : 74 Level : 2 Redefinition of margin-left : div.column

On this:

div.column {
float:left;
margin:1px;
margin-left:4px;
}


Now there are no global div definitions, and no other element.column definitions, so what's it talking about? Does this mean it computes to the same as what would have cascaded that far anyway, and that's why it's a redefinition?

I don't understand at all; it's not like I can take it out .. I need it ..

Anyone know wassup?

brothercake
Jan 21st, 2003, 11:13 PM
nevermind ... I realised as soon as I read it back to myself ... it's this isn't it ..

margin:1px;
margin-left:4px;


when what I need is

margin-top:1px;
margin-bottom:1px;
margin-right:1px;
margin-left:4px;

brothercake
Jan 21st, 2003, 11:24 PM
But this one I really don't get ..

h1,h3,big,strong {
color:#ff9900;
background-color:transparent;
}

big,strong {
font-weight:bold;
}

big {
font:120% arial,helvetica,sans-serif;
}

strong {
font:110% verdana,arial,helvetica,sans-serif;
}


Those four are *all* the BIG declarations in the style sheet, but still I get a warning "Redefinition of font-weight : big "


??


And then .. it's flagged up "Redefinition of line-height : strong " but there aren't *any* line-height definitions for that element.

Is the validator just screwed, or am I missing something ?

Roy Sinclair
Jan 21st, 2003, 11:30 PM
Maybe it's an declaration order thing, try it in this order:

big {
font:120% arial,helvetica,sans-serif;
}

strong {
font:110% verdana,arial,helvetica,sans-serif;
}


h1,h3,big,strong {
color:#ff9900;
background-color:transparent;
}

big,strong {
font-weight:bold;
}

brothercake
Jan 21st, 2003, 11:58 PM
Thanks, but that hasn't made a difference, it just flags the warnings at the new line numbers ..

meow
Jan 22nd, 2003, 01:56 AM
Hi Brothercake! :p

Ahem, what do you refer to when you say 'validator'? The w3c one doesn't flag any warnings about redefined font-weight. :confused:

<Edit: Oops! Board didn't like that long URLs>
http://jigsaw.w3.org/css-validator/

About your first problem with redefined margins. That warning is a very friendly one. There's absolutely nothing wrong with doing it the way you originally did. The warning is just to make you aware of the redefinition in case it wasn't intentional. I use that method all the time so it must be all good. :D

brothercake
Jan 22nd, 2003, 02:42 AM
It was that same validator .. you have to choose "all" in the warnings box

But well, if it's simply a case of warning in case I didn't mean something (rather than, warning because of some potential accessibility problem, or such like) then that's fine.

So er, what do I have to do to be able to use one of the "CSS" buttons on the pages .. or is that it?

meow
Jan 22nd, 2003, 02:49 AM
I used "all". Tried again just now to be certain.. :confused:

Copy it and upload it to your server. A warning is not an error (if there is a warning). :D