Robust CSS

D

dorayme

Line : 124 (Level : 2) You have some absolute and relative
lengths in padding. This is not a robust style sheet.

I got above from http://jigsaw.w3.org/css-validator/validator for:

padding: 0 0 0 1%;

I leave the 4 "values" as I work to try this and that as a
convenience, I realise padding:0 and/or padding-left:1% would do
too (though this gets a "warning" of a different kind not the
subject of this post, though if you want to comment, feel free -
I do this a lot too as it is so convenient and ignore the warning)

I was surprised at 0 0 0 1% being able to confuse any browser -
how could it happen? What would be a case where 0 as relative
would make a difference to 0 as absolute? Or this warning not
very good in that it does not take account of the special case of
zero? Perhaps that is it?

1% left margin div that is child of a body that defaults to
roughly browser window is 1% of the width of body? Yes? So 0% is
slap bang against the body left edge. But then so is 0px or 0cm
for left margin.
 
M

Mark Parnell

Deciding to do something for the good of humanity, dorayme
I was surprised at 0 0 0 1% being able to confuse any browser -
how could it happen? What would be a case where 0 as relative
would make a difference to 0 as absolute? Or this warning not
very good in that it does not take account of the special case of
zero? Perhaps that is it?

Does the warning go away if you make it 0% 0% 0% 1% ?
 
N

Neredbojias

To further the education of mankind, dorayme
Line : 124 (Level : 2) You have some absolute and relative
lengths in padding. This is not a robust style sheet.

I got above from http://jigsaw.w3.org/css-validator/validator for:

padding: 0 0 0 1%;

I leave the 4 "values" as I work to try this and that as a
convenience, I realise padding:0 and/or padding-left:1% would do
too (though this gets a "warning" of a different kind not the
subject of this post, though if you want to comment, feel free -
I do this a lot too as it is so convenient and ignore the warning)

I was surprised at 0 0 0 1% being able to confuse any browser -
how could it happen? What would be a case where 0 as relative
would make a difference to 0 as absolute? Or this warning not
very good in that it does not take account of the special case of
zero? Perhaps that is it?

1% left margin div that is child of a body that defaults to
roughly browser window is 1% of the width of body? Yes? So 0% is
slap bang against the body left edge. But then so is 0px or 0cm
for left margin.

The warning is completely bogus.

Suppose I have an image I want 8px from container left but margined right
at 1% of container width? The markup is:

<img style="margin:0 1% 0 8px" src="da.gif" alt="">

How does that make the page or ss "non-robust"? I think the w3c is a
little too full of itself, or a little too full of something.
 
D

dorayme

How does that make the page or ss "non-robust"?

I'm sure that was what I was asking?

:)

(Oy, MarkP... I lost your post by mistake, you won't accept
Google replies because you have followed Blinkey Bill ... but I
have not tried what you asked yet, I predict it will pass that
one .... where they are all in %...)
 
A

Adrienne Boswell

Gazing into my crystal ball I observed Neredbojias
The warning is completely bogus.

Suppose I have an image I want 8px from container left but margined
right at 1% of container width? The markup is:

<img style="margin:0 1% 0 8px" src="da.gif" alt="">

How does that make the page or ss "non-robust"? I think the w3c is a
little too full of itself, or a little too full of something.

It doesn't say it's wrong, it's a warning that it might break. IIRC,
when tables were used for layout, it was an issue then, too, not mixing
percentages and fixed sizes.
 
N

Neredbojias

It doesn't say it's wrong, it's a warning that it might break. IIRC,
when tables were used for layout, it was an issue then, too, not mixing
percentages and fixed sizes.

Well, perhaps there is some historical significance, but a page can break
with any code/markup/styling that is misapplied, valid or not. Hopefully
when I boldly mix my margin size values, I have a bit of an idea of what I
am doing.
 
D

dorayme

Adrienne Boswell said:
It doesn't say it's wrong, it's a warning that it might break. IIRC,
when tables were used for layout, it was an issue then, too, not mixing
percentages and fixed sizes.

Yes, there is this general point. Fair enough as I noticed in my
op... But when it is 0 0 0 1% what could be the problem. Just the
validator not being fine grained enough?
 

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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top