【发布时间】:2014-09-15 22:52:51
【问题描述】:
我需要删除 .
之间的空格我已经尝试使用边距 0 但没有成功。
知道怎么解决吗?
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<title></title>
<style>
body {
margin: 0;
padding: 0;
background: transparent;
width: 1280px;
height: 720px;
}
#content {
position: fixed;
top: 0px;
left: 0px;
width: 1280px;
height: 720px;
outline: 1px solid red;
}
ul {
list-style-type: none;
margin: 0px;
padding: 0px;
}
#bar-header, #bar-footer {
position: fixed;
left: 0px;
width: 1280px;
height: 30px;
background-color: darkgray;
}
#bar-header {
top: 0px;
}
#bar-footer {
top: 690px;
}
.content-section {
background-color: lightgray;
outline: 1px solid black;
height: 300px;
}
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>
function start() {
};
</script>
</head>
<body onclick="start();">
<div id="page">
<div id="bar-header">Header</div>
<div id="content">
<div class="content-section">
<h2>Content 1</h2>
<a name="section-1"></a>
</div>
<div class="content-section">
<h2>Content 2</h2>
<a name="section-2"></a>
</div>
<div class="content-section">
<h2>Content 2</h2>
<a name="section-2"></a>
</div>
<div class="content-section">
<h2>Content 4</h2>
<a name="section-2"></a>
</div>
</div>
<div id="bar-footer">Footer</div>
</div>
</body>
</html>
编辑:
我也试过了
.content-section { 背景颜色:浅灰色; 轮廓:1px纯黑色; 高度:300px; 边距底部:-20px; }
它有效,但我宁愿选择其他解决方案。
【问题讨论】:
-
你有一些问题,试着把窗口变小,看看滚动条会发生什么