訪客:  註冊 | 登錄 | 統計 | 幫助 | 社區功能 | 界面風格 | 繁体中文


標題: [問題] 如何可以實現CSS3 物件置中功能
用戶組 : 進階會員 [詳情]
會員 : henryip
帖子 : 61[詳情]
UID : 77855
積分 : 140[詳情]
狀態 :
失蹤 : 706  天 [詳情]
  第 1 帖 發表於 2014-5-22 05:01 PM


<!DOCTYPE html>
<html>
<head>
<style>
.menucenter
{
margin:auto;
width:100%;
background-color:#b0e0e6;
}
</style>
</head>

<body>
<div class="menucenter">
<p>In my younger and more vulnerable years my father gave me some advice that I've been turning over in my mind ever since.</p>
<p>'Whenever you feel like criticizing anyone,' he told me, 'just remember that all the people in this world haven't had the advantages that you've had.'</p>
</div>
<p><b>Note: </b>Using margin:auto will not work in IE8, unless a !DOCTYPE is declared.</p>
</body>
</html>

如何可以實現CSS3 物件置中功能??
資料 主頁 文集 短消息 頂部
Rank: 7Rank: 7Rank: 7Rank: 7Rank: 7Rank: 7Rank: 7
用戶組 : 熟手打雜 [詳情]
會員 : 別問我是誰
帖子 : 2718[詳情]
UID : 1
積分 : 5128[詳情]
狀態 :
失蹤 : 0 天 [詳情]
  第 2 帖 發表於 2014-5-22 09:05 PM


引用回應
<!DOCTYPE html>
<html>
<head>
<style>
.menucenter
{
margin: auto;
width:100%;
background-color:#b0e0e6;
}
</style>
</head>

<body>
<center>
<div class="menucenter">
<p>In my younger and more vulnerable years my father gave me some advice that I've been turning over in my mind ever since.</p>
<p>'Whenever you feel like criticizing anyone,' he told me, 'just remember that all the people in this world haven't had the advantages that you've had.'</p>
</div>
<p><b>Note: </b>Using margin: auto will not work in IE8, unless a !DOCTYPE is declared.</p>
</body>
</html>

資料 主頁 文集 短消息 頂部

Powered by Discuz! 5.0.0  © 2001-2006 Comsenz Inc.
頁面執行時間 » 0.019616 秒 » 數據庫查詢 » 6 次 » Gzip » 已啟用
當前時區 GMT+8 , 現在時間 2020-2-26 09:29 AM - 網頁空間由 TEAMagic 提供
清除 Cookies - 聯繫我們 - 雄 之 網 頁 - Archiver - WAP