HighDots Forums  

Why do this in a style list

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


Discuss Why do this in a style list in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
MMan22@hotmail.com
 
Posts: n/a

Default Why do this in a style list - 08-03-2005 , 05:28 AM






I'm learning how to use style sheets and so I've been looking how other
people use them. I found a style file that set borders and padding to
most of the std Tags to zero (sample below). Some get redefined again
later.

Apart from putting all the tags onto one line (comma seperated), why
would you do this ?
Is it to do with setting different client defaults ?

Leigh


HTML {
BORDER-TOP-WIDTH: 0px; PADDING-RIGHT: 0px; PADDING-LEFT: 0px;
BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; PADDING-BOTTOM: 0px;
MARGIN: 0px; PADDING-TOP: 0px; BORDER-RIGHT-WIDTH: 0px
}
BODY {
BORDER-TOP-WIDTH: 0px; PADDING-RIGHT: 0px; PADDING-LEFT: 0px;
BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; PADDING-BOTTOM: 0px;
MARGIN: 0px; PADDING-TOP: 0px; BORDER-RIGHT-WIDTH: 0px
}
UL {
BORDER-TOP-WIDTH: 0px; PADDING-RIGHT: 0px; PADDING-LEFT: 0px;
BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; PADDING-BOTTOM: 0px;
MARGIN: 0px; PADDING-TOP: 0px; BORDER-RIGHT-WIDTH: 0px
}
OL {
BORDER-TOP-WIDTH: 0px; PADDING-RIGHT: 0px; PADDING-LEFT: 0px;
BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; PADDING-BOTTOM: 0px;
MARGIN: 0px; PADDING-TOP: 0px; BORDER-RIGHT-WIDTH: 0px
}
LI {
BORDER-TOP-WIDTH: 0px; PADDING-RIGHT: 0px; PADDING-LEFT: 0px;
BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; PADDING-BOTTOM: 0px;
MARGIN: 0px; PADDING-TOP: 0px; BORDER-RIGHT-WIDTH: 0px
}
P {
BORDER-TOP-WIDTH: 0px; PADDING-RIGHT: 0px; PADDING-LEFT: 0px;
BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; PADDING-BOTTOM: 0px;
MARGIN: 0px; PADDING-TOP: 0px; BORDER-RIGHT-WIDTH: 0px
}
H1 {
BORDER-TOP-WIDTH: 0px; PADDING-RIGHT: 0px; PADDING-LEFT: 0px;
BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; PADDING-BOTTOM: 0px;
MARGIN: 0px; PADDING-TOP: 0px; BORDER-RIGHT-WIDTH: 0px
}
.....etc


Reply With Quote
  #2  
Old   
Barbara de Zoete
 
Posts: n/a

Default Re: Why do this in a style list - 08-03-2005 , 05:36 AM






On 3 Aug 2005 02:28:24 -0700, <MMan22 (AT) hotmail (DOT) com> wrote:

Quote:
I'm learning how to use style sheets and so I've been looking how other
people use them. I found a style file that set borders and padding to
most of the std Tags to zero (sample below). Some get redefined again
later.


HTML {
BORDER-TOP-WIDTH: 0px; PADDING-RIGHT: 0px; PADDING-LEFT: 0px;
BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; PADDING-BOTTOM: 0px;
MARGIN: 0px; PADDING-TOP: 0px; BORDER-RIGHT-WIDTH: 0px
}
BODY {
BORDER-TOP-WIDTH: 0px; PADDING-RIGHT: 0px; PADDING-LEFT: 0px;
BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; PADDING-BOTTOM: 0px;
MARGIN: 0px; PADDING-TOP: 0px; BORDER-RIGHT-WIDTH: 0px
}
[ snipped the rest ]

Quote:
Apart from putting all the tags onto one line (comma seperated),

This is a piece of code that's written badly. * { padding:0;border:0;margin:0; }
Would suffice.

Quote:
why
would you do this ?
Is it to do with setting different client defaults ?

Yes. It could be. Default padding, borders and margins on elements can be set
differently for different browsers. With setting all of them to nill (and
defining where you need them, how you want them) you can try to eliminate those
differences.

You can also except them for what they are: minor differences. A visitor is not
going to see a site in various browsers (or is unlikely to). Minor differences
in rendering really don't matter at all. Pixel perfect desing cannot be achieved
anyway (images and pdf's might do the trick, but hey, this is ciwas, and who
would want that).

--
,-- --<--@ -- PretLetters: 'woest wyf', met vele interesses: ----------.
Quote:
weblog | http://home.wanadoo.nl/b.de.zoete/_private/weblog.html |
webontwerp | http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html |
zweefvliegen | http://home.wanadoo.nl/b.de.zoete/html/vliegen.html |
`-------------------------------------------------- --<--@ ------------'



Reply With Quote
  #3  
Old   
Spartanicus
 
Posts: n/a

Default Re: Why do this in a style list - 08-03-2005 , 06:02 AM



MMan22 (AT) hotmail (DOT) com wrote:

Quote:
I'm learning how to use style sheets and so I've been looking how other
people use them.
Bad idea, the majority of HTML and CSS out there is of very poor
quality. Even looking at good code doesn't teach you how and why it was
used, or how to do it yourself.

Only a good HTML and CSS tutorial can teach you how to do it yourself.

--
Spartanicus


Reply With Quote
  #4  
Old   
junk
 
Posts: n/a

Default Re: Why do this in a style list - 08-03-2005 , 08:03 PM



MMan22 (AT) hotmail (DOT) com wrote:
Quote:
I'm learning how to use style sheets
have a look at http://webhost.bridgew.edu/etribou/layouts/index.html

the layouts are well commented.


Reply With Quote
  #5  
Old   
MMan22@hotmail.com
 
Posts: n/a

Default Re: Why do this in a style list - 08-04-2005 , 05:30 AM



Thanks for the tips eyeryone

Leigh


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.