break free by learning
  • Home
  • About
  • Free Stuff
Monthly Archive: April 2009

CSS Two Classes for one Item

Apr 14, 2009 | css | fyd

css tips and tricksUsing Two Classes on one item in CSS.

Here's a quick CSS Tip you can use if you need to style an item with two(or more) classes.

Sometime you might need to make something stand out a little more than the rest of the elements using the same CSS Class. You could throw a span tag around it or you can uses a second CSS Class. This way if you need to use this style again you aren't constantly having to type out the whole span tag.

It's actually pretty simple…
The HTML

<div class="one two">This text has TWO classes.</div>

The CSS
.one
{
color: #ff0000;
}
.two
{
font-size: 1.5em;
}

and here is the result:

This text has TWO classes.

A simple but very useful CSS Tip.

Popularity: 11% [?]

0
comments

Categories

  • css (8)
  • freelance (2)
  • illustrator (1)
  • inspiration (4)
  • jquery (1)
  • photoshop (9)
  • resources (8)
  • site news (6)
  • the basics (4)
  • web design (1)
  • whats good (1)
  • wordpress (1)

Recent Posts

    Archives

    • April 2010 (1)
    • April 2009 (1)
    • May 2008 (3)
    • April 2008 (14)
    • March 2008 (8)
    • February 2008 (8)
    • January 2008 (11)

    ©2013 freeyourdesign | Designed by Michael Hargis | | twitter icons