<address id="bbrpp"><listing id="bbrpp"><meter id="bbrpp"></meter></listing></address>
<form id="bbrpp"><th id="bbrpp"><th id="bbrpp"></th></th></form>

      <strike id="bbrpp"><p id="bbrpp"><dl id="bbrpp"></dl></p></strike>
        <noframes id="bbrpp"><address id="bbrpp"></address>
        <form id="bbrpp"></form>
        <noframes id="bbrpp"><address id="bbrpp"><nobr id="bbrpp"></nobr></address>
          <noframes id="bbrpp"><form id="bbrpp"><th id="bbrpp"></th></form>

          云南網站建設創新企業 昆明多彩網絡公司

          |網頁對話|電話:0871-63215311

          div布局頁面無法居中的問題

          來源:昆明多彩網絡公司 日期:2010-09-17 閱讀: 發表評論

          在div布局中,都是使用margin:0 auto的css來是div居中,但是前提是需要使用xhtml標準,如果沒有使用該標準,div將無法居中

          看看不能居中的代碼實例:

          <html>
          <head>
          <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
          <title>無標題文檔</title>
          </head>
          <body>
          <div style="width: 1002px; height:100px; margin: 0 auto"><a href="http://www.spiro-crafts-skegness.com">昆明網站建設</a></div>
          </body>
          </html>
           

          雖然將div定義了高度和寬度,并且設置了marign屬性,但是任然無法實現div居中,正確代碼應該是:

          <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
          <html xmlns="http://www.w3.org/1999/xhtml">
          <head>
          <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
          <title>無標題文檔</title>
          </head>
          <body>
          <div style="width: 1002px; height:100px; margin: 0 auto"><a href="http://www.spiro-crafts-skegness.com">昆明網站建設</a></div>
          </body>
          </html>

          發表評論評論列表(有 條評論)

          相關文章:
          暫無相關文章
          最熱文章:
          新手怎么制作網頁? 閱讀:7660
          jcarousellite中文文檔 閱讀:6507
          表單元素input、按鈕、文字完美垂 閱讀:6247
          怎么使chrome(谷歌google 閱讀:6145
          phpMailer中文文檔手冊 閱讀:4639
          網頁對話 0871-63215311
          国产无码字幕在线_碰超免费人妻中文字幕_先锋亚洲精品资源_亚洲人妻电影播放