我正在用 wordpress 做一个网站。在导航下,我有容器(id =“cover_photo”)用于图像(id =“cover_photo_image)。我用边距居中,但我想将它向下移动,并将它放在容器中,但如果我放容器,容器会跟随边距。
HTML
<div id="cover_photo">
<p id="cover_photo_image">
</p>
</div>
CSS
#cover_photo {
width: 100%;
height: 278px;
background-color: #6b0c0b;
box-shadow: inset 0px 0px 3px 0px #888, 0px 0px -3px 0px #888;
}
p#cover_photo_image {
width: 821px;
height: 172px;
display: block;
margin: 0 auto;
margin-top: 6px;
background-image: url(images/cover_photo.png);
}