quick css question

  • rottenberry
  • Newbie
  • Newbie
  • User avatar
  • Posts: 12

Post 3+ Months Ago

Does it matter if you use "." or "#" when naming css styles?
For example:

.text {}

or

#text {}



thanks!
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • digitalMedia
  • a.k.a. dM
  • Genius
  • User avatar
  • Posts: 5149
  • Loc: SC-USA

Post 3+ Months Ago

Code: [ Select ]
.text{}

<p class="text"></p>
<p class="text"></p>
<p class="text"></p>
  1. .text{}
  2. <p class="text"></p>
  3. <p class="text"></p>
  4. <p class="text"></p>


Code: [ Select ]
#text{}

<p id="text"></p>
  1. #text{}
  2. <p id="text"></p>


"id " refers to a single instance. "class" refers to multiple instances. The best analogy I've heard is that a student has an ID to indentify them individually, but is a member of a CLASS, which referes to many idividuals.
  • Mas Sehguh
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 1853

Post 3+ Months Ago

Classes are also useful because you can give a single element multiple classes.
  • Mr. Wiggles
  • Graduate
  • Graduate
  • Mr. Wiggles
  • Posts: 160
  • Loc: Brizzle

Post 3+ Months Ago

Could this work for divs? If so, could there be a way where when an udate is posted using php, the html for a new div to be added to a page can be inserted?
  • neksus
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 2194
  • Loc: Canada

Post 3+ Months Ago

Just use the same div as a class repeatedly.

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 53 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.