2013-06-27 0:29, COM wrote:

my css all begin like what's pasted below.

A somewhat odd piece of a stylesheet, but let's fovus on this pary:

I have no idea what things ought to be inside the html selector.

The <html> element consists of the <head> element and the <body> element, and <head> normally does not cause any visible display (this can be changed with CSS to some extent, but there is hardly ever any reason to do so). However, it might have default margin or padding, so just to be sure, set them to zero so that they have no unexpected effect on the spacing you set for <body>. Other than this, anything that you wish to set on the page as a whole can be set just on the <body> element directly.

*{
        margin:0;
        padding:0;
}

There are different opinions on "CSS resets" like the above. Removing _all_ margins and paddings means that you also remove default spacing between paragraphs, much of the default rendering of <ol> and <ul>, default cell padding, etc., so there is a lot you *must* do to get a decent rendering. But as said, this is a hot topic. What matters here is that the rule sets margin and padding to zero for *all* elements.

html{
}

The only thing that you might find useful to set here is zeroing margin and padding, but the first rule already did this.

You could set e.g. font properties here, and they would be inherited by <body> unless font properties are set directly on it. But what would be the point? It is simpler to set them directly on <body>. Setting background is a little different, since it is not inherited, but it largely acts as if it were: if background is not set for <body>, it is transparent (the initial value), so the background for <html> "shines thru". But again, it is simpler to just set background on <body>.

body{
        font-size:16px;
        color:rgb(0,0,0);
        font-family:helvetica-neue, Verdana, Arial, sans-serif;
}

Technically, if you wish to have such settings as a global default for your pages, setting them on <body> rather than <html> is the way to go.

Yucca


______________________________________________________________________
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to