<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="initial-scale=1, user-scalable=0, minimal-ui">
<link rel="stylesheet" href="css/index.css" />
<script type="text/javascript" src="js/index.js"></script>
<title></title>
</head>
<body>
<header>网页头部</header>
<nav>
<div id="computer" onclick="sziitjx_timeout()">
<img src="img/laptop.png">
<!-- <h1 id=>修电脑</h1>-->
</div>
</nav>
<nav>
<div id="mobile" onclick="sziitsw_timeout()">
<img src="img/mobile1.png">
<!--<h1>修手机</h1>-->
</div>
</nav>
<footer><h3>脚部</h3></footer>
</body>
</html> html,
body {
width: 100%;
height: 100%;
margin: 0px;
padding: 0px;
color: white;
text-align:center
}
header {
background-color: #4CAF50;
height: 10%
}
nav {
height: 40%;
width: 100%;
}
footer{
background-color: #;
height: 10%;
background-color: #FFC90E;
}
#computer {
width: 100%;
height: 100%;
background-color: #F36F36;
margin: auto;
}
#mobile {
width: 100%;
height: 100%;
background-color: #00A89C;
}
nav {
-webkit-transition: width 2s, height 2s, -webkit-transform 2s; /* For Safari 3.1 to 6.0 */
transition: width 2s, height 2s, transform 2s;
/*background-color: #F36F36;*/
}
nav:hover {
-webkit-transform: rotate(180deg); /* Chrome, Safari, Opera */
transform: rotate(180deg);
}footer中不写标签则全部贴合在一起
3 回答
PARADISELIN
TA贡献4条经验 获得超0个赞
写页面最好加入reset.css或者normalize.css这些重置样式的层叠样式表
回到问题
因为h3标签有默认外边距 margin 所以会你所说的缝隙
给h3设置margin:0;就不会了
添加回答
举报
0/150
提交
取消