Banner

Sponsor

Login


Welcome Back!
Guest
Guest

Register

Lost your password?

70 users online



[CSS] -- ID and CLASS differences?

[CSS] -- ID and CLASS differences?

Currently viewing this thread: 1 (0 members and 1 guests)


Adaghost

Adaghost

Status: Offline!

[CSS] -- ID and CLASS differences?

What's the difference between using the two? Advantages or disadvantages?

evan

evan

Neverside Newbie
Status: Offline!

ID should only be used once per page.
CLASS is for using more than once per page.

Rad

Rad

thinking of something witty to put here
Status: Offline!

ID is for a unique item.
Classes are for a group of similar items.

riah

riah

spottieottiedopaliscious
Status: Offline!

also, multiple classes can be apllied to a single element

___________________

http://codetch.com/skin/sig.png
riah.mat1c.org

Rad

Rad

thinking of something witty to put here
Status: Offline!

The way you do that is like this:

Code:


<a class="one two"></a>


That element will use classes one and two.

freak

freak

Neverside Newbie
Status: Offline!

The Selectutorial is a great resource for learning everything about CSS selectors.

// freak

___________________

Tables for layout is an abuse. -- Internet Explorer is unsafe.

Adaghost

Adaghost

Status: Offline!

Thanks all. Great info Smile

schmeg007

schmeg007

Status: Offline!

I wrote this after someone from this site requested it....and now you can use it too Smile
http://www.tizag.com/cssT/cssid.php

___________________

"Don't live your life by other people's quotes. Figure out life for yourself." ~Sum Wize Guy
CSS Tutorials
HTML Tutorials
Web Host Guide - Stuff you should know before choosing a web host.

Quick Jump:

Main Navigation


Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach


NeverAPI generated this page in 0.0184 seconds.