我正在为一个班级作业写一个小型网页。我希望将文本保留在列中以及我正在计划放置图像的段落之间。如何在不改变尺寸的情况下将图像保存在列中?使用CSS保持图像居中
CSS
body {
background-image:url("Some Image");
background-size:cover;
background-repeat:none;
}
.body-box {
display:block;
margin-left:33%;
margin-right:33%;
padding-left:3%;
padding-right:3%;
border-left:4px solid black;
border-right:4px solid black;
word-wrap:break-word;
text-align:justify;
font-family:'Lato:300',serif;
color:black;
background-color:white;
}
HTML
<div class="body-box">
<h1>Some Text</h1>
<a href="Some Image"><img src="Some Link"
alt="Something Vague" width="auto" height="auto" align="center"></a>
<h2>Some Text</h2>
<p>Some Paragraph</p>
现在跟你没关系,http://stackoverflow.com/questions/19532568 /保持图像为中心使用css/19532714#19532714? – KarSho