Forum Moderators: not2easy

Message Too Old, No Replies

Where can I find the default CSS values for a tag?

i.e. what does <body> look like without any modifications?

         

crowthercm

5:03 pm on Aug 17, 2003 (gmt 0)

10+ Year Member



What I'd like to do is create a second element that is identical to body's default but I don't know what that is.

Does anyone know where I can find the default css values for tags? Namely, if I don't do any modifications to <body> what would it look like in css?

body{
margin:?
padding:?
positional attributes?
etc
}

Thanks,
Chris

Longhaired Genius

5:25 pm on Aug 17, 2003 (gmt 0)

10+ Year Member



The default css values are chosen by each individual browser for itself. If you think about it, that's the way it has to be.

You learn about the differences by building a page and looking at it in various browsers.

crowthercm

5:54 pm on Aug 17, 2003 (gmt 0)

10+ Year Member



Hm, are you sure it's not the way that browsers interpret the same default css elements?

rjohara

6:59 pm on Aug 17, 2003 (gmt 0)

10+ Year Member



This is an extremely important question that does not have a clear answer. Each browser has a "default stylesheet" built into it, but to my knowledge these have never been published by the browser manufacturers and they have to be "reverse engineered." Although it's about five years old, the most important work done on this question was the collection of brilliant pages by Todd Fahrner; sadly for the Web, he moved on to other work soon after. His version of the base stylesheet for all Mosaic-derived browsers is at:

[style.cleverchimp.com...]

This is something that W3C should develop further. If they have, I'd be glad to learn of it.

patrickhouweling

8:57 pm on Aug 17, 2003 (gmt 0)

10+ Year Member



What about the Sample style sheet for HTML 4.0 [w3.org] in the CSS2 specs [w3.org]?

Patrick

seindal

9:24 pm on Aug 17, 2003 (gmt 0)

10+ Year Member



The default style sheets for mozilla are a part of the installation as separate files with names like html.css, forms.css, quirk.css. At least I have them installed on my linux system.

René

Hester

8:36 am on Aug 18, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That's right. If you navigate to your Mozilla folder (eg: C:\Program Files\Mozilla) then look in the \res\ folder, all the stylesheets are listed there. The main one I think is called html.css. Looking inside it I see this rule for the body:

body {
display: block;
margin: 8px;
}

This is why it's a good idea to start your page with this:

body, html {margin:0; padding:0;}

It gets rid of any browser padding or margins regardless of browser.

DrDoc

2:35 pm on Aug 18, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Funny thing about the Mozilla style sheet is that they've styled the input button part of a file upload element. But, using the same code does, of course, not work ;)

Hester

2:52 pm on Aug 18, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I noticed they have a special style for a blockquote if the attribute 'type' is set to "cite". It puts a blue border down the left side.

They also have something odd in there. It appears to be a method of making a vertical marquee. Here's the code:


<marquee direction="up">

Or you can use "down" but neither work when I copy the code. Is this something for future releases?