Content section with border : content section « CSS « HTML / CSS






Content section with border

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
     <head>
      <meta http-equiv="content-type" content="text/xhtml; charset=windows-1252" />
      <meta http-equiv="content-language" content="en-us" />
        <style type="text/css">
            h1, h2 {
                margin: 0;
                background: gray;
            }
            h1 {
                font-size: 1.6em;
                padding: 0.3em;
                border-bottom: 5px solid black;
                letter-spacing: -0.08em;
            }
            div {
                background: lightgrey;
                padding: 0.7em;
                clear: left;
            }
            h2 {
                font-size: 1em;
                padding: 0.2em;
            }
            p {
                border: 0.05em solid black;
                padding: 0.8em;
            }
            h3:target {
                color: yellow;
                background: red;
            }
        </style>
    </head>
    <body>
        <h1>This is the title</h1>
        <div>
            <h2>This is the sub title</h2>
            <ul id='top'>
                <li><a href='#'>This is a test. </a></li>
                <li><a href='#'>This is a test. </a></li>
                <li><a href='#'>This is a test. </a></li>
                <li><a href='#'>This is a test. </a></li>
                <li><a href='#'>This is a test. </a></li>
                <li><a href='#'>This is a test. </a></li>
            </ul>
            <h3 id=''>header 3<a href=''></a></h3>
            <p>
                This is a test. 
            </p>
        </div>
    </body>
</html>

 








Related examples in the same category

1.Use
2.use
3.use
4.Set

in extra content

5.Set

and

in extra content section

6.Content scrolls, fixed footer
7.Content DIV
8.Content background
9.stretching content