Forum Moderators: not2easy

Message Too Old, No Replies

Using "html" or "*"

         

fischermx

4:50 am on Jun 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If I want to define a global wide property for all my pages and all elements, like "margin:0;padding:0" where I should to put it?
What 's the difference between using "html" or "*"?

Setek

5:11 am on Jun 21, 2006 (gmt 0)

10+ Year Member



Using
html
will assign properties to the
html
selector, and whichever child selectors have such properties to inherit.

Using

*
is different - it's a wildcard that says "assign these properties to -every single- selector"

So, if you want to reset some properties to save you hassle, you'd use

*
:)

4css

12:27 pm on Jun 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You should also add borders to that mix.

* {margin: 0px;
padding: 0px;
border: 0px;
}

And as stated above, it takes care of everything and you can add it as you go along to whatever you need them on.

fischermx

3:02 pm on Jun 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks for your answer.

Is there a place to know the defaults margins/padding/borders in IE/Firefox for the most commonly used elements, like for example H1-H6?

DrDoc

4:00 pm on Jun 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In FF you can always look at the browser CSS. In IE etc, not without scripting you can't ...
That being said, you shouldn't rely on browser defaults, even if they fit what you need, since they are subject to change.

fischermx

5:30 pm on Jun 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Where do I look for the browser CSS in FF?
I'm googling it and find nothing.