html层的css样式不能用,但是给层内的 标签设置的就能显示
软件:sublime text 4
页面展示:
foot层没有样式
foot p 样式可以出来
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>注册</title>
<link rel="stylesheet" type="text/css" href="css/register.css">
</head>
<body>
<div class="all">
<div class="logo">
<img src="images/logo.png" height="100" width="100">
<div class="logo_right">
<a href="name">首页</a>|
<a href="name">联系我们</a>
</div><!--right-end-->
</div><!--logo-end-->
<div class="nav">
<ul>
<li><a href="index.html">首页</a></li>
<li><a href="name">测试</a></li>
<li><a href="name">测试</a></li>
<li><a href="name">测试</a></li>
<li><a href="name">测试</a></li>
</ul>
</div><!--nav-end-->
<div class="main">
<form action="">
<div class="register">
账户:<input type="text" name="user" id="">
密码:<input type="password" name="password" id="">
重复密码:<input type="password" name="repasswordr" id="">
<input type="submit" value="注册">
</div>
</form>
</div><!--main-end-->
<div class="foot">
<p>作者:deft</p>
<p>©联系方式:xxxxxx</p>
</div>
</div>
</body>
</html>
*{
padding:0;
margin: 0;
list-style: none;
font-size: 16px;
}
.logo .main .footer{
clear: both;
}
.all{
width:1200px ;
height:1920px ;
margin: 0 auto;
}
.logo{
}
.logo_right{
float: right;
width: 200px;
color: red;
}
.nav{
width: 1200px;
height: 45px;
margin: 0 auto;
background-color: #ccc;
}
.nav li{
float: left;
width: 240px;
height: 45px;
line-height: 45px;
text-align: center;
}
.nav li a{
color: #000;
font-weight: bolder;
}
.main{
width: 1100px;
height: 500px;
}
.register{
width: 350px;
height: 200px;
background: rgba(255, 255, 255, 0.6);
position: absolute;
left:750px;
top:300px;
}
.register input{
width: 320px;
height: 35px;
margin:10px;
}
.register input[type='button']{
width: 37px;
}
}
.foot{
margin-left: 460px;
width: 1200px;
height: 40px;
}
.foot p{
width: 200px;
text-align: center;
}