HighDots Forums  

Div names

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


Discuss Div names in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
JB
 
Posts: n/a

Default Div names - 03-02-2006 , 03:59 AM






Hi All,

What's the difference between:

#header {
width: 100%;
}

and

div.header {
width: 100%;
}

Thanks,

Jeff



Reply With Quote
  #2  
Old   
Els
 
Posts: n/a

Default Re: Div names - 03-02-2006 , 04:14 AM






JB wrote:

Quote:
Hi All,

What's the difference between:

#header {
width: 100%;
}

and

div.header {
width: 100%;
}
#header applies the styles to any element with id="header", while
div.header applies the styles to divs with class="header".

--
Els http://locusmeus.com/
accessible web design: http://locusoptimus.com/

Now playing: Cinderella - The More Things Change


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

Default Re: Div names - 03-02-2006 , 04:21 AM



Once upon a time *JB* wrote:
Quote:
Hi All,

What's the difference between:

#header { width: 100%; }
Selects any element with an *id* attribute that equals "header".
E.g. <div id="header"> or <p id="header"> Same ID can only apear once on
each page.

Quote:
and

div.header { width: 100%; }
Selects any *div* element with a *class* attribute that contains the
word "header".
E.g. <div class="header"> but *not* <p class="header"> Same class can
apear many times on each page, and with different elements.

--
/Arne

Google Group Users, read about The Usenet Improvement Project:
http://blinkynet.net/comp/uip5.html


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.