CSS Tips: Class or ID?

September 1, 2010 by · Leave a Comment
Filed under: How-To 

I work a lot with websites, and I’m having this fond for WordPress engine since the  most thing that I should work with is how to re-design a theme. I’m not so good with image manipulation or graphic design, hence I work a lot with and the template parts.

CSS (Cascading Style Sheets) is used for styling the site (HTML) elements. By declaring how an element should look (or behave), the work is becoming less. Name it fonts size, colors, how images looks, and event positioning certain elements, all is become much easier once the styling has been declared.

Styling the elements can be done either generally, or specifically. For instance when you declare a single CSS for <p> tag, then every time you use that instance it will styled as you declared. But when you need to create a different looks for another <p> tag somewhere on your page, then you can be more specific by using an or a .

The easiest way to tell the difference is by looking at the CSS part of your website. An ID is noted by using “#” (hastag symbol) while a Class is noted by using “.” (period symbol).

Read more