CSS: Using Multiple Classes
Using multiple CSS classes on an element can be powerful, and a time-saver. Here’s a simple example, let’s say you want to add a class called red to make certain text elements stand out. Try this:
<span class="boldtext red">for sale</a>
In the sample above, the text “for sale” will have the class boldtext and red applied to it. Multiple classes can be really helpful if you start working on a site you didn’t write, and don’t have the time to map out the previous web dude’s CSS fully, or even if you are just in a hurry, or your stylesheet has grown so big over time you want to place it safe.
| Print article | This entry was posted by George on August 5, 2009 at 12:15 am, and is filed under Web Design. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |
ABOUT COMMENTING ON THIS BLOG
Comments are moderated by a human and will be approved if they bring value to the discussion. This means comments are on topic, relevant and useful. Here are some ways to insure your comment is rejected, marked as spam or will be edited (at my discretion):
- Using keywords, business names or website names in the Name field
- Putting a spammy site/page in the Website field
- Foul, abusive or discriminatory language
- Comments for SEO only purposes