所以我的代码中有这张图片,下面的代码它水平居中正确,
img#headerImage{
width: 600px;
margin-left:auto !important;
margin-right:auto !important;
}
但是当我添加margin-left:-300px;
图像时,它会适当地调整大小,但它会稍微向左偏移并且不再完全居中。
有任何想法吗?
另外,这里有一些 HTML:
<tr>
<td class="headerContent" id="logoContainer">
<img src="url" style="max-width:600px;"
id="headerImage" mc:label="header_image" mc:edit="header_image"
mc:allowdesigner="" mc:allowtext="" />
</td>
</tr>