CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 14th, 2001, 07:17 AM
ron273 ron273 is offline
PHP-addict
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Location: Netherlands
Posts: 54 ron273 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 2 h 37 m 50 sec
Reputation Power: 12
CSS question

I'm trying to master the art of CSS, so I was examining a stylesheet. Most of it seems pretty obvious, but the are two things I don't get:
1. What does these lines mean:
Code:
.Content>p {margin:0px;}
.Content>p+p {text-indent:30px;}

2. What is the difference between a class and an id ?
For instance: <div id=menu> or <div class=menu>

Hope somebody can help me,

Thanks,

Ronald
__________________
"Yes dear, I'll come to bed in a minute"
R. Smit
http://www.rsdev.nl

Reply With Quote
  #2  
Old October 15th, 2001, 02:56 AM
binky's Avatar
binky binky is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Oct 2001
Location: New Zealand
Posts: 1,774 binky User rank is Sergeant (500 - 2000 Reputation Level)binky User rank is Sergeant (500 - 2000 Reputation Level)binky User rank is Sergeant (500 - 2000 Reputation Level)binky User rank is Sergeant (500 - 2000 Reputation Level)binky User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 58 m 15 sec
Reputation Power: 23
An ID is a handle for that tag between it's opening and closing tags. Any JavaScript/CSS reference to that handle is applicable to the tags given that ID. A class on the other hand is defined inside the CSS style tags. A class is used when two or more items on a page display similar attributes (such as <p>, <h2> etc where you want all fonts to be black and 10pt and italic for example).

I don't know what the p and p+p means on the other bit. Never seen it before, but the .content is similar to having a.whiteLink where a is for the anchor tag and .whiteLink is the whiteLink class.

Reply With Quote
  #3  
Old October 20th, 2001, 07:30 PM
evildj evildj is offline
Beelzebub
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2001
Location: The nether regions...ok, San Diego
Posts: 164 evildj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 12
I've never seen any descriptors like that...seems like a typo.

Just to add to binky's explanation...

An ID is used for more than CSS, its a handle for that element in JavaScript as well. Its intended to be a unique identifier. If you give more than one element the same ID, the script associated with that element won't work. Of course you can assign CSS rules to it like this...
#id_name {position: absolute.....}

A class is only used in CSS and can be applied to any element, as many as you like....

.class_name {color: blue}
a.red {color: red}

CSS doesn't care if you define an ID or class the same way.

Happy Coding!

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > CSS question

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap