欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

第七步:html布局div(header/nav/section/footer)

程序员文章站 2022-07-06 22:01:44
...

html文件:

<html>
    <head>
        <meta charset="utf-8">
        <title>html布局</title>
        <link rel="stylesheet" href="../css\test_07.css">
    </head>
    <body>
        <div id="header">
            <h1>City Gallery</h1>
            
        </div>

        <div id="nav">
            London <br>
            Paris <br>
            ToKey <br>
        </div>

        <div id="section">
            
                <p>
                    London is the capital city of England. It is the most populous city in the United Kingdom,
                    with a metropolitan area of over 13 million inhabitants.
                    </p>
                    <p>
                    Standing on the River Thames, London has been a major settlement for two millennia,
                    its history going back to its founding by the Romans, who named it Londinium.
                    </p>
           

        </div>
            
        <div id="footer">
            <h3>Copyright ? W3Schools.com</h3>
        </div>
    </body>
</html>

test_07.css文件:

#header{
    background-color: black;
    color: cornsilk;
    text-align: center;
    padding: 20px;
}

#nav{
    background-color: #eeeeee;
    height: 300px;
    width: 100px;
    line-height: 90px;
    float: left;
    text-align: center;
    padding: 3px;
}

#section{
    width: 350px;
    float: left;
    padding: 10px;
}

#footer{
    background-color: black;
    color: white;
    clear: both;
    text-align: center;
    padding: 5px;
}

第七步:html布局div(header/nav/section/footer)

相关标签: css html5 html