会员可以在此提问,百战程序员老师有问必答
对大家有帮助的问答会被标记为“推荐”
看完课程过来浏览一下别人提的问题,会帮你学得更全面
截止目前,同学们一共提了 132358个问题

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      * {
        margin: 0;
        padding: 0;
      }

      .nav {
        width: 100%;
        height: 50px;
        line-height: 50px;
        background-color: #666;
      }

      .nav ul {
        width: 1200px;
        margin: 0 auto;
      }

      .nav ul::after {
        content: "";
        display: block;
        clear: both;
      }

      .nav ul li {
        list-style: none;
        float: left;
        padding: 0 30px;
      }
      .nav ul li a {
        color: #b0b0b0;
        text-decoration: none;
        font-size: 20px;
      }
      .nav ul li a:hover {
        color: white;
      }

      .nav ul li:hover {
        background-color: #222;
      }
    </style>
  </head>
  <body>
    <div class="nav">
      <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>
      <p>这是一个p标签</p>
    </div>
  </body>
</html>

这个要实现鼠标在导航上方的时候li的背景颜色和字体颜色同时改变要如何实现呀老师

WEB前端全系列/第一阶段:HTML5+CSS3模块/浮动与定位 16楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/前端入门与基础知识 19楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/HTML5基础元素 20楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/HTML5新增元素 21楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/HTML5新增元素 25楼

<style>
        .container{
            width: 1400px;
            height: 1400px;
            margin: 0 auto;
            background-color: brown;
        }
        .header{
            height:80px;
            background-color: antiquewhite;
        }
        .nav{
            height:80px;
            margin-top: 10px;
            background-color: antiquewhite;
        }
        .main{
            height:80px;
            margin-top: 10px;
        }
        .left{
            float: left;
            width: 900px;
            height: 600px;
            background-color: bisque;
        }
        .right{
            float: right;
            width: 480px;
            height: 600px;
            background-color: antiquewhite;
        }
        .footer{
            height: 80px;
            margin-top: 10px;
            background-color: bisque;
        }
        
 </style>
 <body>
   
    <div class="container">
        <div class="header">网站头部</div>
        <div class="nav">网站导航</div>
        <div class="main">
            <div class="left">主要内容</div>
            <div class="right">侧边栏</div>
        </div>
        <div class="footer">网站底部</div>

    </div>
</body>
跟着老师敲的代码,怎么运行出来最后一个footer容器怎么是这样显示的

image.png

WEB前端全系列/第一阶段:HTML5+CSS3模块/HTML5新增元素 26楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/浮动与定位 27楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/表单 30楼

课程分类

百战程序员微信公众号

百战程序员微信小程序

©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园
网站维护:百战汇智(北京)科技有限公司
京公网安备 11011402011233号    京ICP备18060230号-3    营业执照    经营许可证:京B2-20212637