html,css基本项目框架搭建

搭建框架

1.css样式

* {
            margin: 0;
            padding: 0;
        }

        body {
            background-color: brown;
        }

        #box {
            margin: 0 auto;
            width: 1200px;
            height: 900px;
        }

        header {
            width: 1000px;
            height: 60px;
            border-bottom: 1px solid #ccc;
            margin-top: 30px;
            margin: 0 auto;
            background-color: aliceblue;
        }

        h2 {
            height: 60px;
            line-height: 60px;
            text-align: center;
        }

        nav {
            width: 1000px;
            height: 60px;
            margin: 0 auto;
            background-color: aliceblue;
        }

        section {
            width: 1000px;
            height: 510px;
            margin: 20px auto;
            background-color: aliceblue;
        }

        aside {
            float: left;
            width: 430px;
            height: 400px;
            margin: 20px 20px;
            background-color: rgb(97, 97, 97);
        }

        article {
            float: left;
            width: 510px;
            height: 400px;
            margin: 20px 0;
            background-color: rgb(97, 97, 97);
        }

        hgroup {

            width: 480px;
            height: 60px;
            margin: 0 auto;
            background-color: rgb(141, 22, 22);
        }

        p {
            width: 480px;
            height: 140px;
            margin: 20px auto;
            background-color: rgb(141, 22, 22);
            text-align: center;
            line-height: 120px;
        }

        span {
            font-weight: 600;
            font-size: 25px;
        }

        footer {
            width: 1000px;
            height: 60px;
            border-bottom: 1px solid #ccc;
            margin-top: 10px;
            margin: 0 auto;
            background-color: aliceblue;
        }

2.html框架

 <div id="box">
        <h2>body</h2>
        <header>
            <h2>header</h2>
        </header>
        <nav>
            <h2>nav</h2>
        </nav>
        <section>
            <h2>section</h2>
            <aside>
                <h2>aside</h2>
            </aside>
            <article>
                <h2>article</h2>
                <hgroup>
                    <h2>hgroup</h2>
                </hgroup>
                <p><span>p</span></p>
                <hgroup>
                    <h2>dialog</h2>
                </hgroup>
            </article>
        </section>
        <footer>
            <h2>footer</h2>
        </footer>
    </div>

3.搭建效果

 

  • 10
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值