【发布时间】:2017-06-29 15:35:27
【问题描述】:
在这里,我正在构建的页面上出现“顶部白线”的典型问题,在这种情况下,经典的 css 重置 不起作用。
表格的黑色边框和浏览器中的黑色线条之间有一条细小的白线。
这是页面的骨架:
* {
margin: 0;
padding: 0;
border: 0;
outline: 0;
}
body {
font-family: "Lato", sans-serif;
}
#menu {
width: 12%;
height: 100%;
float: left;
position: relative;
background-color: #ff0000;
}
#list {
top: 140px;
width: 100%;
position: absolute;
}
#list a:hover {
color: #a6a6a6;
}
ul {
list-style: none;
background-color: #ff0000;
}
li {
width: 95%;
padding: 12px 0px 12px 15px;
}
li a {
font-size: 25px;
color: #ffffff;
display: block;
white-space: nowrap;
text-decoration: none;
transition: 1.0s;
}
#header {
z-index: 1;
height: 10%;
width: 100%;
position: relative;
background-color: #0066ff;
}
table {
width: 100%;
height: 100%;
position: absolute;
}
table,
td {
border: 1px solid black;
}
td {
color: #ffffff;
text-align: center;
}
#title {
font-size: 30px;
width: 90%;
}
#logout {
font-size: 20px;
width: 10%;
}
img {
float: right;
width: 50%;
height: 90%;
margin: auto;
opacity: 0.2;
}
<div id="menu">
<div id="list">
<ul>
<li> </li>
<li> <a href="#">Customers</a> </li>
<li> <a href="#">Students</a> </li>
<li> <a href="#">Teachers</a> </li>
<li> <a href="#">Android</a> </li>
</ul>
</div>
</div>
<div id="header">
<table>
<tr>
<td id="title">
<p> Android Panel </p>
</td>
<td id="logout">
<p> Logout </p>
</td>
</tr>
</table>
</div>
<img src="https://image.freepik.com/free-vector/android-boot-logo_634639.jpg " />
如您所见,我正在对页面中的每个元素应用 css 重置,作为 StackOveflow suggests 上的一些问题。
我想了解,我在这个 css 中有哪些配置,这对 css 重置的配置有任何阻力,或者可能是这里缺少哪个配置。
P.S:我正在使用 Google Chorme。
【问题讨论】:
-
从给定的代码中,它显示了这个jsfiddle.net/ucxap5yf/1