Page is a not externally linkable
- Code, Content, and Presentation
-- HTML
---- Is It Okay to Use CSS and HTML in the Same Statement?


lucy24 - 5:59 am on Jul 31, 2012 (gmt 0)


If you don't declare a size and/or name, the user's browser will use the default values. Depending on just how computer-illiterate the user is, this in turn will be

EITHER
the browser's original defaults (probably something like 12pt Times Roman for body text). This may or may not be what the user likes, but it's definitely what they are used to.

OR
the defaults set by the user through the appropriate Preferences option. Some browsers even have a "meta-preference" that says something like "always use my own styles".

My own preference in HTML is to say nothing about the body text, but set the headings the way I want them. The default in most browsers is boldface, left-justified, and the sizes tend to be completely wrong-- either way bigger or much smaller than I like :) So I've got a generic CSS that says

:: shuffling papers ::

h1, h2, h3, h4, h5, h6 {text-align: center;
font-style: normal; font-weight: normal;
padding: 0; margin: 1em 0; line-height: 1.2;}


... and then set the individual sizes and margins the way I like them.

Browsers have default values for top and bottom margins, table positioning, text alignment in table cells, and so on. If you look at the w3c css page you will see that each item has a value called "initial". That's what the browser will use if you haven't said anything to the contrary. For example, ordinary text defaults to left-aligned. (Or, ahem, right-aligned if you are in a rtl script like Hebrew.) Table cells default to left-aligned and vertically centered. This is almost never what I want, so my generic CSS includes the line
td {vertical-align: top}

The most dreaded line is "depends on user agent", meaning that the browser will do whatever it ### well feels like. This is fine for body text, where users can set a preference, but not so fine in other areas.

You can experiment simply by making a little www page that has no explicit styles at all, just using the regular html properties like tables and paragraphs and lists. What you see is your browser's defaults. Or rather browsers', plural, because of course you will look in all possible browsers.

In particular, Opera has an absolutely demented array of preference settings for every conceivable type of text. I can't imagine anyone bothering to go in and change them all. Conversely, they constrain your default point size so I have to go 1 point smaller than I would like :(


Thread source:: http://www.webmasterworld.com/html/4475562.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com