Документация
HTML CSS PHP PERL другое

Styling the Caption

 
Previous Page
Table of Contents
Next Page

Styling the Caption

The next step is to apply some basic styles to the caption text, starting with color.

There are many ways that the color white can be specified, including white, #fff, #ffffff, rgb(255,255,255), and rgb(100%,100%,100%). In this case, the three-digit hexadecimal option will be usedcolor: #fff.

Text can be aligned to the left, right, center, or justify. This caption will be centered using text-align: center as shown in Listing 11.5. The results can be seen in Figure 11.4.

Listing 11.5. CSS Code Styling the Caption
div.imagecaption
{
    float: right;
    width: 182px;
    margin: 0 1em 1em 1em;
    display: inline;
    padding: 10px 10px 70px 10px;
    background: #036 url(chapter11.gif) repeat-x 0 100%;
    color: #fff;
    text-align: center;
}

Figure 11.4. Screenshot of styled caption.



Previous Page
Table of Contents
Next Page
© 2000- NIV