You are here:   Home > CSS - cascading style sheets
Register   |  Login

Programmer Newsletter

Minimize

Master Programmer

Minimize

Find articles on computer software, programming, ASP.net, Sql server, databases, C#, websites, Internet, Windows, Outlook macros.

Programming Articles

Minimize
03

Here is some CSS to make highlighting information on your website easy.

Rather than putting the highlighting directly in your HTML code, you create a CSS class and use the CSS class on the part you want to highlight.

By using different CSS classes, you can have a consistent means of highlighting information throughout your website, which you can easily change.

This highlighted text above is accomlished with this html.

<span class="info">highlighting information</span>

The highlighted boxes on this page, are accomplished with this html.

<div class="infobox">text</div>

Here is the CSS for the inline text and the simple box above.

/*----------------------------------------*/
.info
{
    background-color:#DDDDDD;
}
/*----------------------------------------*/
.infobox
{
    background-color:#DDDDDD;
    border:solid 1pt black;
    padding:.5em;
}
/*----------------------------------------*/

For a compatible table with similar formatting, see this article CSS Tables without HTML CellPadding and CellSpacing to Remove Space Between Cell Borders

By Andrew Weitzen, Bronze Inc. (c) 2010

Bronze is the publisher of several online Internet journals including: InternetHandholding.com, DomainNames.gs, DotNetNuke.bz, Programmer.bz, Software.vg, WebHosting.vg

Post Rating

Comments

There are currently no comments, be the first to post one.

Post Comment

Name (required)

Email (required)

Website

Programmer Newsletter

Minimize

Subscribe to the Internet Handholding newsletter



Reccomend Programmer.bz

Minimize

Share/Bookmark Bookmark and Share