Friday, November 28, 2008

[Tip] CSS: Multiple classes in an element

When one knows this one, it seems obvious. But when one doesn't it comes as welcome as a breath of fresh air that one can use more than one class to style an element.

Example:

<p class="MyMainCssClass AnotherCssClass">The paragraph's content here.</p>

Remember that the cascading effect still applies. Properties in AnotherCssClass will override those same properties in the MyMainCssClass class.

PS: Our CSS course is getting ever more popular. This is good as I really would like to encourage designers to use more CSS and do it smarter. See our course schedule for the next course.

No comments: