一个。图片 (960x7) b. div(宽度:960,填充:10)
我想定位 (a),使其距顶部 50 像素,居中。 我想将 (b) 放置在 (a) 的正下方,没有空格。
我的 CSS 如下:
@charset "utf-8";
* {margin:0;padding:0;}
body {background-color:#999;}
.pagetop {margin:50 auto;background:url(../img/pgtop.gif) top center no-repeat;}
.page {margin:0 auto;width:960px;background-color:#fff;padding:10px;}
我的 HTML 如下:
<body>
<div class="pagetop" />
<div class="page">
<p>Warning <a href="#">sign</a>, warning sign...I see it but I...pay it no mind.</p>
</div>
我正在尝试创建一个在灰色背景上具有圆 Angular 边缘的白色容器。我怎样才能简单而智能地做到这一点?
最佳答案
检查圆边的这个问题:
对于对象的定位,我会采用这样的方式:
topimage {
position: absolute;
top: 50px;
text-algin: center;
}
关于CSS - 定位,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1132880/