mkaz.com home photography web dev personal about

Cascading Style Sheets Reference

Example #1

Giants star Barry Bonds literally strolled into history July 4th, breaking Rickey Henderson's all-time Major League walks mark with a pair of free passes to give him 2,191 for his career.

Style Sheet

        .sbox1 { 
            width: 300px;
            background-color: #669966;
            padding: 3px;
        }
    
        .sbox2 {
            margin: -6px 0 0 -6px;
            background-color: #FFFFFF;
            border: solid 1px #669966;
            padding: 5px;
        }

HTML

        <div class='sbox1'><div class='sbox2'>
            CONTENT
        </div></div>
        


Example #2


Style Sheet


    <style type="text/css">
        .sidemenu { width: 150px; }

        .cbox { border: solid 1px #9999CC; background-color: #F0F0FF; }
        .cbox .title { padding: 1px; background-color: #9999CC; color: #003366; }

        .content { padding: 5px 5px 5px 10px; }
    </style>
    

HTML Code

    <div class="sidemenu cbox">
    <div class="title">My Content Box</div>
    <div class="content">
        <a href="#">First List Item </a><br/>
        <a href="#">Item Number Two </a><br/>
        <a href="#">This is Another One</a><br/>
        <br/>
        <a href="#">Random Item</a><br/>
    </div>
    </div>