我想在页面顶部放置一个 ID 为“wrapper”的 div 标签,但问题是
div 标签“wrapper is yellow color”之间有一个空白区域
和页面顶部。
我的问题是如何删除 div 标签和顶部之间的空白 页面的?
这是我的代码
<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
body {
margin: 0;
padding:0;
}
#wrapper {
width:1000px;
text-align:center;
margin-right:auto;
margin-left:auto;
margin-top:0px;
background-color: yellow;
padding:0px;
}
</style>
</head>
<body>
<div id="wrapper">
Testing
</div>
</body>
</html>
最佳答案
在 css 代码中试试这个:
{
position:absolute;
top:0px;
}
您可以使用right
或left
在div 和 Angular 之间留出空间
关于CSS 将 Div 标签放在页面顶部,没有空格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19333190/