css独立文件后样式失效,请老师指导
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" type="text/css" href="index.css">
</head>
<body>
<!--头部-->
<div class="header">
<!--左边logo-->
<div class="logo"><img src="logo.png"></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="#">EVENTS</a></li>
<li><a href="#">CONTACT</a></li>
</ul>
</div>
</div>
<!--主体-->
<div class="main">
<!--banner图-->
<div class="top">
<img src="banner3.jpg">
</div>
<!--遮罩层-->
<div class="topLayer"></div>
<!--遮罩层上方文字-->
<div class="topLayer-top">
<div class="text"><input type="text" value="Your Name"></div>
<div class="text"><input type="text" value="Your Phone"></div>
<div class="text"><input type="text" value="Your Email"></div>
<textarea >Write Your Comment Here</textarea>
<button class="button">SEND MESSAGE</button>
</div>
<!--about-->
<div class="about">
<div class="title">ABOUT</div>
<div class="ttext">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.</div>
<div class="left">
<div class="leftTitle">A WORD ABOUT US</div>
<div class="leftText">
<div>Praesent dignissim viverra est,sed bibendum ligula congue non. Sed ac nislet felis gravida commodo? Suspendisse eget ullamcorper ipsum. Suspendisse diam amet.</div>
<button>EXPLORE</button>
</div>
</div>
<div class="mimg"><img src="bb3.jpg"></div>
<div class="right">
<div class="block">
<div>70000</div>
<div>Student</div>
</div>
<div class="block">
<div>600</div>
<div>Faculty</div>
</div>
</div>
</div>
<!--about下展示区-->
<div class="boxDisplay">
<div class="box">
<div class="img"><img src="b1.jpg" alt="aboutBottom-pic1"></div>
<div class="text">
<div class="title">Conference Hall</div>
<div class="content1">Lorem Ipsum is simply dummy text of the printing and typesetting industry.</div>
<div class="content2">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 mack a type specimen book.</div>
<button>EXPLORER</button>
</div>
</div>
<div class="box">
<div class="text">
<div class="title">Library</div>
<div class="content1">Lorem Ipsum is simply dummy text of the printing and typesetting industry.</div>
<div class="content2">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 mack a type specimen book.</div>
<button>EXPLORER</button>
</div>
<div class="img"><img src="b2.jpg" alt="aboutBottom-pic1"></div>
</div>
<div class="box">
<div class="img"><img src="b3.jpg" alt="aboutBottom-pic1"></div>
<div class="text">
<div class="title">Play Ground</div>
<div class="content1">Lorem Ipsum is simply dummy text of the printing and typesetting industry.</div>
<div class="content2">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 mack a type specimen book.</div>
<button>EXPLORER</button>
</div>
</div>
<div class="box">
<div class="text">
<div class="title">Computer Lab</div>
<div class="content1">Lorem Ipsum is simply dummy text of the printing and typesetting industry.</div>
<div class="content2">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 mack a type specimen book.</div>
<button>EXPLORER</button>
</div>
<div class="img"><img src="b4.jpg" alt="aboutBottom-pic1"></div>
</div>
</div>
<!--Gallery区-->
<div class="gallery">
<div class="gtitle">GALLERY</div>
<div class="gtext">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.</div>
<div class="box">
<div class="gbox">
<div class="img"><img src="03-01.jpg"></div>
<div class="itext">  SCIENCE LAB</div>
</div>
<div class="gbox">
<div class="img"><img src="03-02.jpg"></div>
<div class="itext">  JNDOOR STADIUM</div>
</div>
<div class="gbox">
<div class="img"><img src="03-03.jpg"></div>
<div class="itext">  TRANSPORTION</div>
</div>
<div class="gbox">
<div class="img"><img src="03-04.jpg"></div>
<div class="itext">  KIDS ROOM</div>
</div>
<div class="gbox">
<div class="img"><img src="03-05.jpg"></div>
<div class="itext">  MEDITATION CLASSES</div>
</div>
<div class="gbox">
<div class="img"><img src="03-06.jpg"></div>
<div class="itext">  KIDS PLAY GROUND</div>
</div>
</div>
</div>
</div>
<div class="footer">2019 imooc.com 京ICP备13046642号</div>
</body>
</html>
*{
padding:0;
margin:0;
}
.header{
width: 100%;
height: 100px;
background-color: #07cbc9;
}
.header .logo{
float: left;
width: 200px;
height: 75px;
padding-left: 100px;
padding-top: 13px;
}
.header .nav{
float: right;
}
.header .nav ul{
padding-right: 80px;
}
.header .nav ul li{
float: left;
list-style: none;
width: 80px;
height: 100px;
line-height: 100px;
color: #ffffff;
font-family: "微软雅黑";
font-size: 20px;
font-weight: bolder;
margin-left: 40px;
}
.header .nav ul li a{
text-decoration: none;
color: #ffffff;
}
.header .nav ul li a:hover{
color: #ffffff;
}
.main{
width: 100%;
height: 2000px;
overflow: hidden;
zoom:1;
}
.main .top{
width: 100%;
height: 600px;
}
.main .top img{
width: 100%;
height: 600px;
}
.main .topLayer{
position: absolute;
top: 100px;
left: 0;
width: 100%;
height: 600px;
background-color: #000;
opacity: 0.5;
}
.main .topLayer-top{
width: 300px;
height: 400px;
position: absolute;
top: 100px;
right: 50%;
top: 50%;
z-index: 2;
margin-top: -200px;
margin-right: -150px;
float: left;
padding-left: 150px;
}
.main .topLayer-top .text{
width:250px;
height:50px;
padding-bottom: 10px;
}
.main .topLayer-top input{
width: 250px;
height: 30px;
background-color: transparent;
color: #ffffff;
font-family: 微软雅黑;
}
.main .topLayer-top textarea{
width:250px;
height:60px;
padding-bottom: 10px;
font-family: 微软雅黑;
color: #ffffff;
background-color: transparent;
}
.main .topLayer-top .button{
margin-top: 20px;
margin-left: 60px;
width: 120px;
height: 50px;
font-family: 微软雅黑;
background-color: transparent;
color: #ffffff;
}
.main .about{
height: 600px;
width: 100%;
overflow: hidden;
zoom: 1;
}
.main .about .title{
font-size: 30px;
margin-left:900px;
margin-top: 30px;
margin-bottom: 10px;
font-family: "微软雅黑";
font-weight: bolder;
}
.main .about .ttext{
width: 350px;
font-size: 12px;
font-family: "微软雅黑";
margin-left: 800px;
margin-bottom: 20px;
}
.main .about .left{
float: left;
width: 400px;
height: 400px;
margin-left: 250px;
z-index: 1;
}
.main .about .left .leftText{
position: absolute;
background-color: #fffff;
opacity: 0.5;
margin: 20px;
border: 1px solid gray;
font-family: "微软雅黑";
font-size: 20px;
width: 400px;
height: 250px;
margin-top: 20px;
margin-left: 120px;
padding: 10px;
z-index: 1;
}
.main .about .left .leftTitle{
width: 200px;
margin-left: 220px;
font-family: "微软雅黑";
font-size: 30px;
}
.main .about .mimg{
float: left;
width: 600px;
height: 400px;
z-index: -1;
}
.main .about img{
float: left;
width: 600px;
height: 400px;
}
.main .about button{
width: 120px;
height: 60px;
background-color: #000;
font-size: 20px;
margin-top: 20px;
margin-left: 120px;
color: #ffffff;
}
.main .about .right{
float: left;
width: 400px;
height: 300px;
}
.main .about .right .block{
width: 200px;
height: 140px;
padding: 10px;
font-size: 40px;
font-family: "微软雅黑";
color: #000;
text-align: center;
border: 2px solid #07cbc9;
margin-left: 10px;
margin-bottom: 20px;
}
.boxDisplay{
width: 1200px;
height: 600px;
position: absolute;
top: 2300px;
right: 0;
left: 0;
bottom: 0;
margin: auto;
overflow: hidden;
zoom: 1;
/*border: 1px solid #5d5d5d;*/
}
.boxDisplay .box{
width: 300px;
height: 600px;
float: left;
}
.boxDisplay .box .img{
width:300px;
height: 300px;
}
.boxDisplay .box img{
width:300px;
height: 300px;
}
.boxDisplay .box .text{
width:300px;
height: 300px;
background-color: #07cbc9;
}
.boxDisplay .box .text .title{
padding: 20px;
font-size: 20px;
color: #ffffff;
font-family: "微软雅黑";
font-weight: bolder;
}
.boxDisplay .box .text .content1{
padding:10px 10px;
font-family: "微软雅黑";
font-size: 16px;
color: #ffffff;
}
.boxDisplay .box .text .content2{
padding:10px 10px;
font-family: "微软雅黑";
font-size: 12px;
color: rgb(220,220,220);
}
.boxDisplay .box .text button{
display: block;
width: 100px;
height: 30px;
line-height: 20px;
text-align: center;
background-color: #000000;
color: #ffffff;
border: 2px solid #000000;
margin-left:100px;
margin-top: 20px;
}
.main .gallery{
position: absolute;
top: 1950px;
height: 800px;
width: 100%;
}
.main .gallery .gtitle{
font-size: 30px;
margin-left:900px;
margin-top: 30px;
margin-bottom: 10px;
font-family: "微软雅黑";
font-weight: bolder;
}
.main .gallery .gtext{
width: 350px;
font-size: 12px;
font-family: "微软雅黑";
margin-left: 800px;
margin-bottom: 20px;
}
.main .gallery .box{
position: absolute;
left: 0;
right: 0;
margin: auto;
height: 600px;
width: 1200px;
}
.main .gallery .box .gbox{
float: left;
width: 400px;
height: 300px;
}
.main .gallery .box .gbox img{
width: 380px;
height: 250px;
}
.main .gallery .box .gbox .itext{
width: 380px;
height: 30px;
color: #ffffff;
background-color: #000;
font-family: "微软雅黑";
font-size: 20px;
margin-top: -5px;
margin-bottom: 10px;
padding-top:10px;
}
.footer{
position: absolute;
top: 2800px;
width: 100%;
height: 100px;
background-color: #07cbc9;
text-align: center;
color: #ffffff;\
font-family: "微软雅黑";
}2
收起
正在回答 回答被采纳积分+1
1回答
从网页搭建入门Java Web2018版
- 参与学习 人
- 提交作业 1088 份
- 解答问题 10204 个
如果你有Java语言基础,又想以后从事Java Web开发,那么本路径是你的不二选择!本路径从网页搭建开始入手,通过大量案例来学习Java Web基础。定能助你完成Java Web小白的蜕变!
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星