css2-10作业问题
*{margin: 0;
padding: 0;
font-size: "Microsoft YaHei UI"}
.header{background-color: #07cbc9;
width:100%;
height:80px;
position: fixed;
z-index: 9;}
.logo{width:200px;
height:50px;
float: left;
padding: 15px 100px;
}
.nav{float: right;
padding-right: 100px;}
.nav ul li{list-style: none;
float: left;
line-height: 80px;
margin:auto 10px;
color: #fff;
}
.nav ul li a{text-decoration: none;
color: #fff;}
.nav ul li:hover{background: #000;}
.banner img{width:100%;
height: 600px;
margin-top: 80px;}
.banner-top{width:100%;
height:600px;
position: absolute;
top:80px;
background: #000;
z-index: 2;
opacity: 0.5;}
.banner-from{width:100%;
height: 600px;
position: absolute;
top:80px;
z-index: 3;
}
.table{width:400px;
height:400px;
margin:0 auto;
}
.table form{padding-top: 130px;
}
.table input{padding: 8px;
margin:10px;
background: transparent;
color:#fff;
border-width: 2px;}
textarea{margin:10px;
padding:8px;
background: transparent;
color:#fff;
font-weight: bold;
border-width: 2px;}
.table form .button{margin-left: 150px;}
.table form input:hover{border-color: #07cbc9;}
.table form textarea:hover{border-color: #07cbc9;}
.table .button:hover{background:#07cbc9;}
.about-top{width:100%;
height: auto;
text-align: center;}
.about-title{font-size: 40px;
margin-top: 30px;
font-weight: bolder;}
.hr{background:#07cbc9;
height: 2px;
width: 30px;
margin:5px auto;}
.about-word{color: gray;}
.about-middle{width: 1000px;
height:auto;
margin:0 auto;}
.m-title{font-size: 30px;
width: 200px}
.m-word{background: #fff;
opacity: 0.5
width:100px;
height: 200px;}
.about-middle img{margin-left: 200px;
float: right;
position: relative;
left: -200px;}
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>css作业</title>
<link rel="stylesheet" type="text/css" href="css2-10作业.css">
</head>
<body>
<!-- 顶部 -->
<div class="header">
<div class="logo">
<a href="#"><img src="images2\logo.png"></a>
</div>
<div class="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="#"> EYENTS</a></li>
<li><a href="#"> CONTACT</a></li>
</ul>
</div>
</div>
<!-- banner图 -->
<div class="banner">
<img src="images2\banner3.jpg">
</div>
<!-- 遮罩层 -->
<div class="banner-top"></div>
<!-- 遮罩层上的表单 -->
<div class="banner-from">
<div class="table">
<form>
<input type="text" name="name" size="60" placeholder="your Name"><br>
<input type="text" name="phone" size="60" placeholder="your Phone"><br>
<input type="text" name="email" size="60" placeholder="your Email"><br>
<textarea name="comment" rows="3" cols="55" placeholder="Write Your Comment Here"></textarea><br>
<input class="button" type="button" name="send" value="SEND MESSAGE">
</form>
</div>
</div>
<!-- about区 -->
<div class="about">
<!-- top部分 -->
<div class="about-top">
<div class="about-title">ABOUT</div>
<div class="hr"></div>
<div class="about-word">Lorem lpsum is simply dummy text the printing and typesetting<br> industry.Loram lpsum has been the industry's stardard dummy<br> text ever since the 1500s</div>
</div>
<!-- middle部分 -->
<div class="about-middle">
<div class="m-title">
A WOED<br>ABOUT US
</div>
<div class="m-word">
Praesent dignissim viverra est.sed<br>bibendum ligula congue non.Sed ac nisiet telis gravida commodo?Suspendisse<br>eget uliamcorper ipsum.Suspendisse diam amet.
</div>
<img src="images2\bb3.jpg">
<div m-r>
<div class="list1">
</div>
<div class="list2">
</div>
</div>
</div>
<!-- bottom部分 -->
<div class="bottom"></div>
</div>
<!-- gallery区 -->
<div class="gallery">
</div>
<!-- 页脚区-->
<div class="footer">
</div>
</body>
</html>
老师,这个作业到about-middle部分我不会设置了,请老师指点一下。
左边的文字和中间的图以及右边的list,怎样让他们按照要求排列在一起呢?如果用浮动的话好像不行,是用position吗,还是二者结合?感觉自己用了好长时间,可是还是没有弄好,很是苦恼,有很大的挫败感。请老师给一定的提示和解答,万分感谢!
正在回答
如果有新问题,在提问区重新提问新问题,以便更快的回复,新代码的建议如下:
开发中外层使用div,具体内容根据具体情况选择使用的标签。
该问题不是很清楚,可以在详细描述,同时把代码和效果图截下图。
文本框对齐,使用css样式统一设置宽度。
左侧文字和按钮部分,使用两个div块实现(框和内容),这块可以合并成一个。
动手实践下,祝学习愉快。
*{margin: 0;
padding: 0;
font-family: "Microsoft YaHei UI"}
.header{background-color: #07cbc9;
width:100%;
height:80px;
position: fixed;
z-index: 9;}
.logo{width:200px;
height:50px;
float: left;
padding: 15px 100px;
}
.nav{float: right;
padding-right: 100px;}
.nav ul li{list-style: none;
float: left;
line-height: 80px;
margin:auto 10px;
color: #fff;
}
.nav ul li a{text-decoration: none;
color: #fff;}
.nav ul li:hover{background: #000;}
.banner img{width:100%;
height: 600px;
margin-top: 80px;}
.banner-top{width:100%;
height:600px;
position: absolute;
top:80px;
background: #000;
z-index: 2;
opacity: 0.5;}
.banner-from{width:100%;
height: 600px;
position: absolute;
top:80px;
z-index: 3;
}
.table{width:400px;
height:400px;
margin:0 auto;
}
.table form{padding-top: 130px;
}
.table input{padding: 8px;
margin:10px;
background: transparent;
color:#fff;
border-width: 2px;}
textarea{margin:10px;
padding:8px;
background: transparent;
color:#fff;
font-weight: bold;
border-width: 2px;}
.table form .button{margin-left: 150px;}
.table form input:hover{border-color: #07cbc9;}
.table form textarea:hover{border-color: #07cbc9;}
.table .button:hover{background:#07cbc9;}
.about-top{width:100%;
height: auto;
text-align: center;}
.about-title{font-size: 40px;
margin-top: 30px;
font-weight: bolder;}
.hr{background:#07cbc9;
height: 2px;
width: 30px;
margin:5px auto;}
.about-word{color: gray;}
.about-middle{width: 1000px;
height:auto;
margin:25px auto;
position: relative;}
.m-l{width:150px;
height:auto;
float: left; }
.m-m{width:550px;
height: auto;
float: right;
position: relative;}
.m-m img{width:550px;
height: 350px;
text-align: center;}
.m-r{float: right;
width: 250px;
height: auto;
}
.list1,.list2{width:200px;
height:120px;
text-align: center;
vertical-align: middle;
border:1px solid #07cbc9;
margin:0 0 25px 25px;
}
.stu{padding: 25px;}
.stu-p{font-size: 25px;font-weight: bolder;}
.about-toplayer{background-color: #fff;
opacity: 0.3;
width:320px;
height: 200px;
position: absolute;
left: 15px;
top:80px;
z-index: 8;
border:1px solid #000;}
.m-title{font-size: 30px;
width: 200px;
text-align: center;}
.m-word{width:300px;
height: 200px;
position: absolute;
left: 15px;
top:80px;
z-index: 9;
padding: 15px;}
.button2{width: 80px;
height: 40px;
background: #000;
color: #fff;
border:1px solid #000;
margin-top: 20px;}
.button2:hover{background: #fff;
color: #000;}
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>css作业</title>
<link rel="stylesheet" type="text/css" href="css2-10作业.css">
</head>
<body>
<!-- 顶部 -->
<div class="header">
<div class="logo">
<a href="#"><img src="images2\logo.png"></a>
</div>
<div class="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="#"> EYENTS</a></li>
<li><a href="#"> CONTACT</a></li>
</ul>
</div>
</div>
<!-- banner图 -->
<div class="banner">
<img src="images2\banner3.jpg">
</div>
<!-- 遮罩层 -->
<div class="banner-top"></div>
<!-- 遮罩层上的表单 -->
<div class="banner-from">
<div class="table">
<form>
<input type="text" name="name" size="60" placeholder="your Name"><br>
<input type="text" name="phone" size="60" placeholder="your Phone"><br>
<input type="text" name="email" size="60" placeholder="your Email"><br>
<textarea name="comment" rows="3" cols="50" placeholder="Write Your Comment Here"></textarea><br>
<input class="button" type="button" name="send" value="SEND MESSAGE">
</form>
</div>
</div>
<!-- about区 -->
<div class="about">
<!-- top部分 -->
<div class="about-top">
<div class="about-title">ABOUT</div>
<div class="hr"></div>
<div class="about-word">Lorem lpsum is simply dummy text the printing and typesetting<br> industry.Loram lpsum has been the industry's stardard dummy<br> text ever since the 1500s</div>
</div>
<!-- middle部分 -->
<div class="about-middle">
<div class="m-l">
<div class="m-title">
A WORD<br>ABOUT US
</div>
</div>
<!-- about的遮罩层 -->
<div class="about-toplayer"></div>
<div class="m-word">
Praesent dignissim viverra est.sed bibendum ligula congue non.Sed ac nisiet telis gravida commodo?Suspendisseeget uliamcorper ipsum.Suspendisse diam amet.
<input class="button2" type="button" name="explore" value="EXPLORE">
</div>
<div class="m-r">
<div class="list1">
<div class="stu">
<p class="stu-p"> 70000</p>
<div class="hr"></div>
students
</div>
</div>
<div class="list2">
<div class="stu">
<p class="stu-p"> 600</p>
<div class="hr"></div>
faculty
</div>
</div>
</div>
<div class="m-m">
<img src="images2\bb3.jpg">
</div>
</div>
<!-- bottom部分 -->
<div class="bottom"></div>
</div>
<!-- gallery区 -->
<div class="gallery">
</div>
<!-- 页脚区-->
<div class="footer">
</div>
</body>
</html>
- 参与学习 人
- 提交作业 11218 份
- 解答问题 36713 个
从一个不会编程的小白到一个老司机是需要过程的,首先得入门,学习基础知识,然后才能进阶,最后再到精通,本专题是你走进前端世界的不二选择!
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星