两个 div 标签之间的空格
您好,我正在尝试在两个 div 标签之间设置空格,但我不知道该怎么做,我一直在搜索,但我不明白我找到的示例,
这是 CSS 代码:
#logo{
position:absolute;
top:160px;
left:65px;
}
#desc{
position:relative;
margin-top:290px;
left:65px;
}
#desc_entry{
position:relative;
margin-top:5px;
left:65px;
}
.pressed {
color:#999;
padding: 10px;
background: #111;
border: 1px solid #000;
border-right: 1px solid #353535;
border-bottom: 1px solid #353535;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
这是我设法在 div 标签之间进行分离的唯一方法,但问题是因为我使用的是 pressed 类,所以它会用这样的样式填充 div http://i54.tinypic.com/uoux0.jpg 我不希望它全部被填满。有什么想法吗?
Hi I'm trying to set a space between two div tags but I don't know how to do it, I've been searching but I don't understand the examples that I've found
Here's the CSS code:
#logo{
position:absolute;
top:160px;
left:65px;
}
#desc{
position:relative;
margin-top:290px;
left:65px;
}
#desc_entry{
position:relative;
margin-top:5px;
left:65px;
}
.pressed {
color:#999;
padding: 10px;
background: #111;
border: 1px solid #000;
border-right: 1px solid #353535;
border-bottom: 1px solid #353535;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
this is the only way I've managed to get a separation between the div tags but the problem is that because I'm using the pressed class it fills the div with this style like this
http://i54.tinypic.com/uoux0.jpg
And i don't want it to be all filled. Any thoughts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
就像其他人所说,您需要发布 html 或至少说明您想要向哪个元素添加空间。话虽这么说,我敢打赌你需要的是一些明确的:两者都在某个地方,因为这是从 CSS 开始的人最常见的错误
like other people said, you need to post the html or at least say what element do you want to add space to. This being said, I bet what you need is some clear:both somewhere, because that's the most common mistake on people starting with CSS