请老师检查下代码,谢谢。
来源:4-8 自由编程
不厌_
2021-05-22 23:55:53
CSS代码如下:
相关代码:
* {
margin: 0;
padding: 0;
}
a {
text-decoration: none;
}
ul,ol {
list-style: none;
}
body {
font: normal 14px/25px "微软雅黑";
}
/* header区域 */
header {
width: 100%;
height: 80px;
background-color: #07cbc9;
}
header .header-top {
width: 1200px;
height: 80px;
margin: 0px auto;
}
header .header-top .logo {
width: 260px;
height: 48px;
float: left;
padding-top: 16px;
padding-bottom: 16px;
}
header .header-top .logo img {
width: 260px;
height: 48px;
}
header .header-top .main-nav {
height: 80px;
float: right;
}
header .header-top .main-nav ul {
height: 80px;
}
header .header-top .main-nav ul li {
width: 100px;
height: 80px;
float: left;
margin-right: 20px;
text-align: center;
line-height: 80px;
}
header .header-top .main-nav ul li a{
display: block;
width: 100px;
height: 80px;
color: white;
font-size: 16px;
}
header .header-top .main-nav ul li a:hover {
background-color: orange;
}
/* banner区域 */
.banner {
width: 100%;
height: 800px;
position: relative;
}
.banner .banner-pictures{
width: 100%;
height: 800px;
}
.banner .banner-pictures img{
width: 100%;
height: 800px;
}
.banner .banner-shade {
position: absolute;
width: 100%;
height: 800px;
top: 0px;
left: 0px;
background-color:rgba(0, 0, 0, 0.5);
}
.banner .banner-form {
width: 504px;
/* 实现水平居中 */
position: absolute;
left: 50%;
margin-left: -252px;
top: 100px;
overflow: hidden;
/* 输入框居中 */
text-align: center;
}
.banner .banner-form input,textarea {
background: none;
color: #808080;
/* 鼠标点击时去掉边框 */
outline: none;
}
.banner .banner-form .input-box {
width: 500px;
height: 36px;
border: 2px solid #808080;
margin-bottom: 30px;
}
.banner .banner-form .comment {
width: 500px;
height: 106px;
border: 2px solid #808080;
margin-bottom: 30px;
}
.banner .banner-form .send-message {
width: 196px;
height: 36px;
border: 2px solid #808080;
}
/* about区域 */
.content .about{
width: 1201px;
margin: 0 auto;
overflow: hidden;
}
/* <!-- about区域的标题和简短描述 --> */
.content .about .about-title-short-description {
width: 1201;
padding-top: 30px;
}
.content .about .about-title-short-description h2 {
text-align: center;
font-size: 32px;
}
.content .about .about-title-short-description .divider {
width: 60px;
height: 3px;
background-color: #07cbc9;
margin: 10px auto;
}
.content .about .about-title-short-description p {
font-size: 14px;
color: gray;
text-align: center;
}
/* about区域的详细描述 */
.content .about .about-detailed-description {
width: 1201px;
height: 434px;
padding-top: 30px;
position: relative;
}
/* 左部分区域 */
.content .about .about-detailed-description .about-left {
float: left;
}
.content .about .about-detailed-description .about-left h2{
margin-bottom: 20px;
margin-right: 158px;
}
.content .about .about-detailed-description .about-left .about-left-description {
width: 300px;
padding: 20px;
border: 1px solid gray;
font-size: 18px;
position: absolute;
top: 50%;
left: 0;
margin-top: -100px;
background:rgba(255, 255, 255, .5)
}
.content .about .about-detailed-description .about-left .about-left-description a{
display: block;
width: 140px;
height: 40px;
background-color: black;
color: white;
line-height: 40px;
text-align: center;
margin-top: 30px;
}
/* 中部图片区域 */
.content .about .about-detailed-description .about-among{
width: 650px;
height: 435px;
float: left;
}
.content .about .about-detailed-description .about-among img {
width: 650px;
height: 435px;
}
/* 右部分区域 */
.content .about .about-detailed-description .about-right {
width: 260px;
float: right;
}
.content .about .about-detailed-description .about-right .about-right-box {
width: 178px;
padding: 40px;
border: 1px solid #07cbc9;
text-align: center;
}
.content .about .about-detailed-description .about-right .about-right-box p{
font-size: 28px;
font-weight: bold;
}
.content .about .about-detailed-description .about-right .about-right-box .divider {
width: 60px;
height: 3px;
background-color: #07cbc9;
margin: 10px auto;
}
.content .about .about-detailed-description .about-right .top {
margin-bottom: 30px;
}
HTML代码如下:
相关代码:
<!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">
<meta name="Keywoeds" content="#">
<meta name="Description" content="#">
<title>Career-Builder</title>
<link rel="stylesheet" href="css/css.css">
</head>
<body>
<!-- 网页头部 -->
<header>
<div class="header-top">
<!-- 网页的LOGO -->
<div class="logo">
<img src="images/logo.png" alt="">
</div>
<!-- 网页的导航 -->
<nav class="main-nav">
<ul>
<li><a href="">HOME</a></li>
<li><a href="">ABOUT</a></li>
<li><a href="">GALLERY</a></li>
<li><a href="">FACULTY</a></li>
<li><a href="">EVENTS</a></li>
<li><a href="">CONTACT</a></li>
</ul>
</nav>
</div>
</header>
<!-- 网页的横幅 -->
<section class="banner">
<!-- 网页横幅的图片 -->
<div class="banner-pictures">
<img src="images/banner3.jpg" alt="">
</div>
<!-- 网页横幅的遮罩层 -->
<div class="banner-shade">
</div>
<!-- 网页横幅的表单 -->
<div class="banner-form">
<form action="" method="POST">
<p>
<input class="input-box" type="text" placeholder="your Name">
</p>
<p>
<input class="input-box" type="text" placeholder="your Phone">
</p>
<p>
<input class="input-box" type="email" placeholder="your Email">
</p>
<p>
<textarea class="comment" cols="30" rows="10" placeholder="Write Your Comment Here"></textarea>
</p>
<p>
<input class="send-message" type="submit" value="SEND MESSAGE">
</p>
</form>
</div>
</section>
<!-- 网页的内容区域 -->
<section class="content">
<!-- 网页的标题和描述区域 -->
<div class="about">
<!-- 标题和简短描述 -->
<div class="about-title-short-description">
<!-- 标题 -->
<h2>ABOUT</h2>
<!-- 简短描述 -->
<div class="divider"></div>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting <br> industry. Lorem Ipsum has been the industry's standard dummy <br> text ever since the 1500s.</p>
</div>
<!-- 详细描述 -->
<div class="about-detailed-description">
<!-- 左部分 -->
<div class="about-left">
<!-- 左边部分标题 -->
<h2>A AWORD <br> ABOUT US</h2>
<!-- 左边部分内容 -->
<div class="about-left-description">
<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>
<a href="">EXPLORE</a>
</div>
</div>
<!-- 中部 -->
<div class="about-among">
<img src="images/bb3.jpg" alt="">
</div>
<!-- 右部分 -->
<div class="about-right">
<!-- 右边上部分内容 -->
<div class="about-right-box top">
<p>70000</p>
<div class="divider"></div>
<div>Students</div>
</div>
<!-- 右边下半部分内容 -->
<div class="about-right-box bottom">
<p>600</p>
<div class="divider"></div>
<div>Faculty</div>
</div>
</div>
</div>
</div>
<!-- 网页的图文混排区域 -->
<div class="pictures-and-text">
<!-- 第一块内容 -->
<div class="pictures-and-text-one">
<!-- 图片1 -->
<div class="picture1">
<img src="images/b1.jpg" alt="">
</div>
<!-- 文字2 -->
<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>
<a href=""><div class="pictures-and-text-one-link">EXPLORE</div></a>
</div>
</div>
<!-- 第二块内容 -->
<div class="pictures-and-text-two">
<!-- 图片3 -->
<div class="picture3">
<img src="images/b2.jpg" alt="">
</div>
<!-- 文字4 -->
<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>
<a href=""><div class="pictures-and-text-two-link">EXPLORE</div></a>
</div>
</div>
<!-- 第三块内容 -->
<div class="pictures-and-text-three">
<!-- 文字5 -->
<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>
<a href=""><div class="pictures-and-text-three-link">EXPLORE</div></a>
</div>
<!-- 图片6 -->
<div class="picture6">
<img src="images/b3.jpg" alt="">
</div>
</div>
<!-- 第四块内容 -->
<div class="pictures-and-text-four">
<!-- 文字7 -->
<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>
<a href=""><div class="pictures-and-text-four-link">EXPLORE</div></a>
</div>
<!-- 图片8 -->
<div class="picture8">
<img src="images/b4.jpg" alt="">
</div>
</div>
</div>
<!-- 网页的展示区 -->
<div class="gallery">
<!-- 标题和简短描述 -->
<div class="gallery-title-short-description">
<!-- GALLERY标题 -->
<div class="gallery-title">
<h2>GALLERY</h2>
</div>
<!-- 简短描述 -->
<div class="gallery-short-description">
<p>分割线</p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting <br> industry. Lorem Ipsum has been the industry's standard dummy <br> text ever since the 1500s.</p>
</div>
</div>
<!-- 详细信息区 -->
<div class="detailed-information">
<!-- 第一块内容 -->
<div class="detailed-information-one">
<dl>
<dt><img src="images/03-01.jpg" alt=""></dt>
<dd>Science Lab</dd>
</dl>
</div>
<!-- 第二块内容 -->
<div class="detailed-information-two">
<dl>
<dt><img src="images/03-02.jpg" alt=""></dt>
<dd>Indoor Stadium</dd>
</dl>
</div>
<!-- 第三块内容 -->
<div class="detailed-information-three">
<dl>
<dt><img src="images/03-03.jpg" alt=""></dt>
<dd>Transportation</dd>
</dl>
</div>
<!-- 第四块内容 -->
<div class="detailed-information-four">
<dl>
<dt><img src="images/03-04.jpg" alt=""></dt>
<dd>Kids Room</dd>
</dl>
</div>
<!-- 第五块内容 -->
<div class="detailed-information-five">
<dl>
<dt><img src="images/03-05.jpg" alt=""></dt>
<dd>Meditation Classes</dd>
</dl>
</div>
<!-- 第六块内容 -->
<div class="detailed-information-five">
<dl>
<dt><img src="images/03-06.jpg" alt=""></dt>
<dd>Kids Play Ground</dd>
</dl>
</div>
</div>
</div>
</section>
<!-- 网页的页脚 -->
<footer>
<p>©2016 imooc.com 京ICP备13046642号</p>
</footer>
</body>
</html>
1回答
同学你好,代码布局以及实现效果很棒。继续加油,祝学习愉快!
相似问题