老师,看下代码正不正确
来源:4-4 自由编程
慕用6234762
2021-01-10 20:13:22
<!DOCTYPE html>
<html lang="en">
*{
margin: 0;
padding: 0;
}
ul{
list-style: none;
}
a{
text-decoration: none;
}
header{
height:80px ;
background-color: #07cbc9;
}
header .header{
margin: 0 auto;
width: 1200px;
height: 80px;
}
header .header .logo{
margin-top: 16px;
float: left;
}
header .header nav{
float: right;
}
header .header nav ul li{
float: left;
font-size: 16px;
display: inline-block;
color: white;
line-height: 80px;
margin-left: 20px;
}
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="Keywords" content="">
<meta name="Description" content="">
<title>Document</title>
<link rel="stylesheet" href="css/css.css">
</head>
<body>
<!-- Header区域 -->
<header>
<div class="header">
<div class="logo">
<img src="images/logo.png">
</div>
<nav>
<ul>
<li>HOME</li>
<li>ABOUT</li>
<li>GALLERY</li>
<li>FACULTY</li>
<li>EVENTS</li>
<li>CONTACT</li>
</ul>
</nav>
</div>
</header>
<!-- banner区域 -->
<div class="banner">
<div class="banner-images">
<img src="images/banner3.jpg">
</div>
<div class="banner-cover">
banner遮罩层
</div>
<div class="banner-form">
<form action="" method="POST">
<input type="text" placeholder="your Name"><br>
<input type="text" placeholder="your Phone"><br>
<input type="email" placeholder="you Email"><br>
<textarea cols="50" rows="10" placeholder="Write your Comment Here"></textarea><br>
<input type="submit" value="SEND MESSAGE">
</form>
</div>
</div>
<!-- about区域 -->
<div class="about">
<!-- 标题和介绍 -->
<div class="about-title">
<h2>ABOUT</h2>
<p>分割线</p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting Ipsum has been the industry's standard
dummy ever since the 1500s.</p>
</div>
<!-- 详细内容介绍 -->
<div class="about-content">
<div>
<h3>A WORD ABOUT US</h3>
<p>Praesent dignissim viverra est, sed bibendum ligula congue non. Sed ac nisl et felis gravida commodo?
Suspendisse eget ullamcorper ipsum. Suspendisse diam amet.</p>
<p>EXPLORE</p>
</div>
<div><img src="images/bb3.jpg"></div>
<div>
<div>
<p>70000</p>
<p>分割线</p>
<p>Students</p>
</div>
<div>
<p>600</p>
<p>分割线</p>
<p>Faculty</p>
</div>
</div>
</div>
</div>
<!-- 图文混排区域Library -->
<div class="images-and-text">
<div class="images1">
<img src="images/b1.jpg">
</div>
<div class="text2">
<h3>Library</h3>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry</p>
<p>Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer
took a galley of type and scrambled it to make a type specimen book.</p>
<p>EXPLORE</p>
</div>
<div class="images3">
<img src="images/b2.jpg">
</div>
<div class="text4">
<h3>Library</h3>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry</p>
<p>Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer
took a galley of type and scrambled it to make a type specimen book.</p>
<p>EXPLORE</p>
</div>
<div class="text5">
<h3>Library</h3>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry</p>
<p>Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer
took a galley of type and scrambled it to make a type specimen book.</p>
<p>EXPLORE</p>
</div>
<div class="images6">
<img src="images/b3.jpg">
</div>
<div class="text7">
<h3>Library</h3>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry</p>
<p>Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer
took a galley of type and scrambled it to make a type specimen book.</p>
<p>EXPLORE</p>
</div>
<div class="images8">
<img src="images/b4.jpg">
</div>
</div>
<!-- gallery区域 -->
<div class="gallery">
<!-- 标题和介绍 -->
<div class="gallery-title">
<h2>GALLERY</h2>
<p>分割线</p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the
industry's standard dummy text ever since the 1500s.</p>
</div>
<div calss="gallery-content">
<dl>
<dt><img src="images/03-01.jpg"></dt>
<dd>Science Lab</dd>
</dl>
<dl>
<dt><img src="images/03-02.jpg"></dt>
<dd>Indoor Stadium</dd>
</dl>
<dl>
<dt><img src="images/03-03.jpg"></dt>
<dd>Transportation</dd>
</dl>
<dl>
<dt><img src="images/03-04.jpg"></dt>
<dd>Kids Room</dd>
</dl>
<dl>
<dt><img src="images/03-05.jpg"></dt>
<dd>Meditation Classes</dd>
</dl>
<dl>
<dt><img src="images/03-06.jpg"></dt>
<dd>Kids Play Ground</dd>
</dl>
</div>
</div>
<!-- footer区域 -->
<footer>
<p>© 2016imooc.com 京ICP备13046642号</p>
</footer>
</body>
</html>
1回答
好帮手慕慕子
2021-01-11
同学你好,代码实现是正确的,建议优化:导航项设置浮动后,就可以实现在一排显示了,这样就不需要再给导航项设置display:inline-block;属性了,可以去掉这句代码,简化代码书写。
另外,同学将css代码放在html中粘贴过来时,可以将css代码放在style标签中哦
祝学习愉快~
相似问题