html5 运用自适应 真不戳!

h5 自适应原来这么好用,还不赶紧学起来!

今天做了一个网页的首页哦,熟练运用float,background,margin,font,div,id啦!
希望下次可以用class嘻嘻~
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body,ul,li {padding: 0px; margin: 0px}

        #container {
            width: 90%;
            height: 600px;
            margin: 0px auto;
        }

        #topper{
            width: 100%;
            height: 6%;
            background-color: #5b945b;
        }
        #ul1{
            list-style: none;
        }
        #li1{
            float: left;
            width: 7%;
            height:6%;
            text-align: center;
            line-height: 36px;
            font-size: 12px;
            border-right:1px solid white;
        }
        #li4{
            float: left;
            width: 7%;
            height:6%;
            text-align: center;
            line-height: 36px;
            font-size: 12px;
        }
        #li2{
            float: right;
            width: 6%;
            height:6%;
            text-align: center;
            line-height: 36px;
            font-size: 12px;
            border-right:1px solid white;
        }
        #li3{
            float: right;
            width: 6%;
            height:6%;
            text-align: center;
            line-height: 36px;
            font-size: 12px;
            margin-right: 6%;
        }


        #head{
            width: 100%;
            height: 12%;
            background-color: white;
        }
        #ul2{
            list-style: none;
        }
        #li5{
            float: left;
            width: 17%;
            height:12%;
            text-align: center;
            line-height: 72px;
            font-size: 40px;
            margin-left: 3%;
            font-weight: 600;
        }
        #li6{
            float: right;
            width: 6%;
            height:12%;
            text-align: center;
            line-height: 72px;
            font-size: 12px;
            font-weight: 600;
        }
        #li7{
            float: right;
            width: 6%;
            height:12%;
            text-align: center;
            line-height: 72px;
            font-size: 12px;
            margin-right: 6.5%;
            font-weight: 600;
        }


        #content{
            width: 100%;
            height: 46%;
            background-image: url("pic1.jpg");
            background-size: 100%;
        }
        #ul3{
            list-style: none;
        }
        #li8{
            height: 120px;
            text-align: center;
            line-height: 160px;
            font-size: 25px;
        }
        #li9{
            height:20px;
            text-align: center;
            line-height: 10px;
            font-size: 14px;
        }


        #menu{
            width: 100%;
            height: 25%;
            background-color: white;
        }
        #ul5{
            list-style: none;
        }
        #li15{
            float: left;
            width:10%;
            height: 90px;
            background-color: #009f5a;
            background-image: url(p1.png);
            background-size: 50%;
            background-repeat: no-repeat;
            background-position: center;
            margin-left: 3%;
            margin-top: 30px;
        }
        #li11{
            float: left;
            width: 12.5%;
            height: 90px;
            background-color:#009f5a ;
            margin-top: 30px;
            line-height: 90px;
            text-align: center;
            font-size: 14px;
            font-weight: 600;
        }
        #li16{
            float: left;
            width:10%;
            height: 90px;
            background-color: #cfcfcf;
            background-image: url(p2.png);
            background-size: 50%;
            background-repeat: no-repeat;
            background-position: center;
            margin-left: 10px;
            margin-top: 30px;
        }
        #li12{
            float: left;
            width: 12.5%;
            height: 90px;
            background-color: #cfcfcf;
            margin-top: 30px;
            line-height: 90px;
            text-align: center;
            font-size: 14px;
            font-weight: 600;
        }
        #li17{
            float: left;
            width:10%;
            height: 90px;
            background-color: #009f5a;
            background-image: url(p3.png);
            background-size: 50%;
            background-repeat: no-repeat;
            background-position: center;
            margin-left: 10px;
            margin-top: 30px;
        }
        #li13{
            float: left;
            width: 12.5%;
            height: 90px;
            background-color:#009f5a ;
            margin-top: 30px;
            line-height: 90px;
            text-align: center;
            font-size: 14px;
            font-weight: 600;
        }
        #li18{
            float: left;
            width:10%;
            height: 90px;
            background-color: #cfcfcf;
            background-image: url(p4.png);
            background-size: 50%;
            background-repeat: no-repeat;
            background-position: center;
            margin-left: 10px;
            margin-top: 30px;
        }
        #li14{
            float: left;
            width: 12.5%;
            height: 90px;
            background-color: #cfcfcf;
            margin-top: 30px;
            line-height: 90px;
            text-align: center;
            font-size: 14px;
            font-weight: 600;
        }



        #footer{
            width: 100%;
            height: 11%;
            background-color:#5b945b;
            border-bottom:2px solid black;
        }
        #ul4{
            list-style: none;
        }
        #li10{
            height:11%;
            text-align: center;
            line-height: 110px;
            font-size: 7px;
        }
    </style>
</head>
<body>
    <div id="container">
        <div id="topper">
            <ul id="ul1">
                <li id="li1" style="color: white">社区</li>
                <li id="li1" style="color: white">助手</li>
                <li id="li1" style="color: white">动态</li>
                <li id="li4" style="color: white">云服务</li>
                <li id="li3" style="color: white">注册</li>
                <li id="li2" style="color: white">登录</li>
                <li id="li2" style="color: white">搜索</li>
            </ul>
        </div>
        <div id="head">
            <ul id="ul2">
                <li id="li5" style="color: #21762b">Logo</li>
                <li id="li7" style="color: black">服务</li>
                <li id="li6" style="color: black">体验店</li>
                <li id="li6" style="color: black">在线商城</li>
                <li id="li6" style="color: black">品牌</li>
                <li id="li6" style="color: black">产品</li>
                <li id="li6" style="color: black">首页</li>
            </ul>
        </div>
        <div id="content">
            <ul id="ul3">
                <li id="li8" style="color: white">发现生活的趣味和美好</li>
            </ul>
            <ul id="ul3">
                <li id="li9" style="color: white">旅行中、生活中,XXXX手机帮助您记录一个个精彩画面。感谢您的分</li>
                <li id="li9" style="color: white">享,在这里,您看到的都是XXXX手机拍摄的作品。</li>
            </ul>
        </div>
        <div id="menu">
            <ul id="ul5">
                <li id="li15"></li>
                <li id="li11" style="color: white"> 社区</li>
                <li id="li16"></li>
                <li id="li12" style="color: black">Color</li>
                <li id="li17"></li>
                <li id="li13" style="color: white">软件商店</li>
                <li id="li18"></li>
                <li id="li14" style="color: black">品牌中心</li>
            </ul>
        </div>
        <div id="footer">
            <ul id="ul4">
                <li id="li10" style="color: white">©2005-2016 XX市XXXX科技有限公司 版权所有 X ICP备00000000号-1</li>
            </ul>
        </div>
    </div>
</body>
</html>
看了一下,居然有296行,着实惊呆小白我了,可能id的命名上有点混乱,但我心中是清楚的hhhhhh
仔细看看就会觉得很简单啦!Yeahhhh!
运行后如下:在这里插入图片描述
今天就到这里啦!又是好好敲代码的一天呐!
最近几年随着百度、搜狗等搜索引擎对高质量新闻门户的鼓励和重视,新闻门户网站依然是最容易获取大流量的平台之一,而且中国网民的碎片化时间越来越多,时事热点新闻门户的受众群体也越来越多,之前很多人看新闻联播,但是现在不一样了,很多人都是工作之余上网浏览一下今天的最新实时动态。所以对于运营新闻门户网站的站长朋友来说,移动版显得异常重要,能够让更多的“低头族”爱上你的新闻门户。 今天分享的这套新闻门户网站就是一套非常不错的H5自适应门户网站,能够完美兼容电脑、平板和手机,让你的新闻门户受众群体尽可能的覆盖所有网络中断,当然,有了移动版,我们就很容易通过一些网站转APP的工具来给自己的网站生成一个APP客户端。这套源码整体是红色风格,界面按照科技类自媒体网站的排版方式布局,干净清爽,非常适合国人浏览新闻的习惯,只要你的网站能够按时按量的更新大量的新闻热点,相信很容易就能拥有大流量。 这套源码是使用织梦开源程序二次开发的,详细的安装说明可以下载源码以后,参考源码压缩包内的“源码使用说明.txt”来完成源码的安装和搭建,当然,如果你自己不会安装源码也可以联系友软科技的在线客服,付费帮你安装。源码安装过程中会提示你创建网站的管理员账号密码,自己牢记,安装完成后默认的管理地址是:http://你的网站/dede/ 默认的管理员账号密码就是你安装过程中自己创建的账号密码。安装完成以后的数据库是空的,你可以通过管理后台的【系统->数据备份/还原->数据还原】操作来恢复源码自带的栏目结构及新闻数据内容。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值