我在頁面中使用了一個jQuery動畫,它添加了一些CSS屬性,我不明白爲什麼margin: auto
不起作用。使用margin auto的中心不起作用
的HTML代碼(通過加入jQuery的樣式屬性):
<body style="overflow: hidden;">
<div id="tuto_wamp" style="width: 7680px; height: 923px; ">
<!-- Step 1 -->
<div style="height: 549px; width: 1280px; margin-top: 0px; margin-left: 0px; position: absolute; overflow-y: hidden; overflow-x: hidden; ">
<div class="content_tuto">
<img src="images/install1.png" alt="">
</div>
</div>
</div>
</body>
我的CSS代碼:
#tuto_wamp
{
background: #3a393c;
width: 100%;
}
.content_tuto
{
width: 100%;
margin: auto;
display: block;
}
我不知道哪個屬性塊margin: auto
居中圖像。
謝謝。
您正在測試哪個瀏覽器? –
Chrome Firefox和Opera – Guillaume
寬度:100%,margin:auto;我不清楚你的問題,請http://jsfiddle.net – ShibinRagh