Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Old 07-20-2008, 10:59 AM confusion
missingtime's Avatar
Skilled Talker

Posts: 83
Location: Athens, Greece
Trades: 0
Is this:

ul#mainNav {
margin: 0;
padding: 0;
list-style: none;
}

the same as this:

#mainNav ul {
margin: 0;
padding: 0;
list-style: none;
}

If so, why use one instead of the other?

Last edited by missingtime; 07-20-2008 at 11:01 AM..
missingtime is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-20-2008, 11:33 AM Re: confusion
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
No they are not the same.

the first would apply to a ul element with an id of mainNav, and the second would apply to a ul element that is a child element of a parent with an id of mainNav.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-20-2008, 12:55 PM Re: confusion
missingtime's Avatar
Skilled Talker

Posts: 83
Location: Athens, Greece
Trades: 0
Quote:
Originally Posted by chrishirst View Post
No they are not the same.

the first would apply to a ul element with an id of mainNav, and the second would apply to a ul element that is a child element of a parent with an id of mainNav.
Wouldn't they have the same effect though?
missingtime is offline
Reply With Quote
View Public Profile
 
Old 07-20-2008, 02:03 PM Re: confusion
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
the rules are identical so, yes the effect would be the same on the elements the CSS rules apply to.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to confusion
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.45151 seconds with 12 queries