常用的CSS[持續更新]

來源:互聯網
上載者:User
文章目錄
  • 1,table 中的cellpadding與cellspacing的含義:
  • 2,水平置中 margin:0 auto;
1,table 中的cellpadding與cellspacing的含義:

cellpadding:規定單元邊沿與其內容之間的空白

cellpadding:規定的是單元之間的空間

View Code

<table border="1" cellpadding="20" cellspacing="10">     <tbody>          <tr>              <td>aaa</td><td>bbbb</td><td>ccc</td><td>dddd</td>          </tr>          <tr>              <td>aaa</td><td>bbbb</td><td>ccc</td><td>dddd</td>          </tr>          <tr>              <td>aaa</td><td>bbbb</td><td>ccc</td><td>dddd</td>          </tr>     </tbody></table>

2,水平置中 margin:0 auto;
<div style="width:600px;background-color:Aqua;">    <div style="width:200px; height:200px; background-color:Teal;margin:0 auto;"></div></div>

效果:

 

 
相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.