HighDots Forums  

default css for browsers

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss default css for browsers in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: default css for browsers - 09-03-2005 , 09:13 AM






Spartanicus <invalid (AT) invalid (DOT) invalid> wrote:

Quote:
"Xah Lee" <xah (AT) xahlee (DOT) org> wrote:

is there somewhere i can find the default css for browsers?

No such thing. They all use different default styles.
Besides, they have presentational idiosyncrasies that are not describable
in CSS, and they may have failed to present their default style sheet (real
or virtual) to the public. For example, for IE, we need to infer things
from the browser's behavior. It's more difficult than you might think,
since the rendering of an element depends on context. (For example,
vertical margins for elements may disappear if the element is the content
of a table cell - rather naturally, but it complicates things.)

Quote:
That said, w3c published a sample default stylesheet
http://www.w3.org/TR/REC-CSS2/sample.html
That sample stylesheet makes obscure claims on describing carefully the
actual browser behavior _and_ on recommending how browsers should behave.
Don't rely on it at all, though you might use it as a checklist of things
that browsers _might_ do and you _might_ wish to do.

(Besides, CSS 2 is effectively dead and CSS 2.1 isn't born yet. Not
surprisingly, the sample style sheets in CSS 1, CSS 2, and CSS 2.1 are
all different, in essential ways.)

The morale is that when writing an author style sheet, you should be
prepared to anything reasonably imaginable in browsers' default style
sheets, and somewhat more. For example, if you would like to make the
indentation of list smaller than what browsers typically use, you should
set all of the following: padding-left and margin-left for the list element
(ul or ol) and for the list item elements (li). You cannot know, or you
should at least pretend you don't know, which of them a browser uses for
the indentation. So if you naively just set e.g. margin-left: 1.5em for
a ul element, you might actually _increase_ the nesting, on browsers that
by default use padding-left to create considerable indentation (and
default margin-left to zero).

--
Yucca, http://www.cs.tut.fi/~jkorpela/


Reply With Quote
  #12  
Old   
Quasimido CSS
 
Posts: n/a

Default Re: default css for browsers - 09-04-2005 , 05:15 AM






Roedy Green <look-on (AT) mindprod (DOT) com.invalid> in
news:l6jhh193kn7t9tih6ng49kioktf9t02gc8 (AT) 4ax (DOT) com:

Quote:
On 2 Sep 2005 14:31:10 -0700, "Xah Lee" <xah (AT) xahlee (DOT) org> wrote or
quoted :

p.l {display:list-item}

The catch is p comes with baggage, including a display:block. You have
to fiddle to make sure your choice overrides.
ah, baggage.
just coincidentally i recently solved a :hover problem when i editd the element description.
had been
p (etc)
became
a (etc)
this cleared up some characteristics that i refused to "reverse", even when I tried explicitly
"overriding" them in the styles
(yeah, this was a *really* annoying problem :-) )


Quote:
A crude starting point would be:

p.l {display:list-item !important}


Reply With Quote
  #13  
Old   
Xah Lee
 
Posts: n/a

Default Re: default css for browsers - 09-08-2005 , 03:04 AM




Richard Lewis wrote:
Thanks a lot! Very interesting. Quality answer.

Xah
xah (AT) xahlee (DOT) org
http://xahlee.org/

Quote:
Hi,
have a look at
http://www.meyerweb.com/eric/thought...ndoing-htmlcss

The gist is, if you're using Firefox, you can find a file on your system
called html.css
(in C:\Program Files\Mozilla Firefox\res and C:\Program
Files\Netscape\Netscape Browser\res
for me, but the files are exactly the same.) which contain default .css used
by the browser

ul> and <li> are basically:

ul {
display: block;
list-style-type: disc;
margin: 1em 0;
-moz-padding-start: 40px;
-moz-counter-reset: -html-counter 0;
}

li {
display: list-item;
-moz-float-edge: margin-box;
}

I've not tried these, and I know nothing about mozilla proprietary
properties, but it looks
quite plausible.
There's also a lot of stuff to do with stuff nested inside of lists, eg
ul ul, ul ol, ul dir, ...

all very interesting. Go to the article for more info




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.