博主信息
博文 5
粉丝 0
评论 0
访问量 10106
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
网站中常用固定广告位的制作
花舞花落淚的博客
原创
4396人浏览过

实例

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>网站中常用固定广告位的制作</title>
    <style>
     body{margin: 0;padding: 0;}
    .nav{
        width:100%;
        background: #2c73fa;
        height: 40px;
        }
    .header{
        width: 1000px;
        margin: 0px auto;
        }
    .header ul{
        margin: 0px;
        padding: 0px;
        list-style: none;
        }
    .header ul li{
        list-style-type: none;
        }
    .header ul li a{
        color:#fff;
        text-decoration:none;
        font-size:16px;
        line-height:40px; 
        float: left;
        text-align: center;
        width: 200px;
        }
    .header ul li a:hover{
        background:#f60;
        }
    .content{
        width: 600px;
        height: 500px; 
        margin: 5px auto;
        background: #ccc;
        }
    .content p{
        margin: 0px;
        color:#fff;
        font-size: 16px;
        line-height: 500px;
        text-align: center;
              
    }
    .mail{
        width: inherit;
        min-height: 500px;
        background: #2c73fa;
        }
    .left{
        width: 200px;
        height: 500px;
        background: orange;
        margin-left: -100%;
        position: relative;
        left:-200px;
        }
    .right{
        width: 200px;
        height: 500px;
        background: orange;
        margin-left: -200px;
        position: relative;
        left:200px;
        }
    .mail,.left,.right{
        float: left;
        }
    .footer{
        width: 100%;
        background:#000;
        }
    .footer .foot{
        width: 1000px;
        height: 100px;
        margin: 0px auto;
        }
    .footer .foot p{
        margin: 0;
        text-align: center;
        padding: 10px;
        color: #fff;
        }
    .footer .foot p a{
        color: #fff;
        font-size: 14px;
        text-decoration: none;
        }
    .footer .foot p a:hover{
        color:#f60;
        }
    .ad{
        width:300px;
        height:250px;
        border: #ddd;
        background: coral;
        right: 0px;
        bottom: 0px;
        position: fixed;
        }
    button{margin-right: 10px;float: right;margin-top:10px;}

    </style>
    <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
</head>
<body>
<div class="nav">
    <div class="header">
       <ul>
        <li><a href="#">首页</a></li>
        <li><a href="#">关于我们</a></li>
        <li><a href="#">产品中心</a></li>
        <li><a href="#">在线留言</a></li>
        <li><a href="#">联系我们</a></li>
       </ul>
   </div>
</div>
<div class="content">
        <div class="mail"><p>主体部分</p></div>
        <div class="left"><p>左侧部分</p></div>
        <div class="right"><p>右侧部分</p></div>
</div>

<div class="footer">
    <div class="foot">
    <p><a href="">关于我们</a>  |  <a href="">联系我们</a>  |  <a href="">产品分类</a>  |  </p>
    <p>XXXX公司版权所有     沪ICP备:888888888</p>
 </div>

 <div class="ad">
        <button onclick="">关闭</button>
     <h2>这是一个广告标题</h2>
     <p>html课程练习中</p>

 </div>
 <script>
     $('button').click(function(){
     $('.ad').hide()
     })
 </script> 
</div>
</body>
</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例

网页中常用简单广告位制作实例

批改状态:未批改

老师批语:
本博文版权归博主所有,转载请注明地址!如有侵权、违法,请联系admin@php.cn举报处理!
全部评论 文明上网理性发言,请遵守新闻评论服务协议
0条评论
作者最新博文
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号

  • 登录PHP中文网,和优秀的人一起学习!
    全站2000+教程免费学