zoukankan      html  css  js  c++  java
  • 内边距:

    内边距:padding

    <html>
    <head>
    <style type="text/css">
    td.test1 {padding: 1.5cm}
    td.test2 {padding: 0.5cm 2.5cm}
    </style>
    </head>

    <body>
    <table border="1">
    <tr>
    <td class="test1">
    这个表格单元的每个边拥有相等的内边距。
    </td>
    </tr>
    </table>
    <br />
    <table border="1">
    <tr>
    <td class="test2">
    这个表格单元的上和下内边距是 0.5cm,左和右内边距是 2.5cm。
    </td>
    </tr>
    </table>
    </body>

    </html>

    外边距:margin

    <html>
    <head>
    <style type="text/css">
    p.margin {margin: 2cm 4cm 3cm 4cm}
    </style>
    </head>

    <body>

    <p>这个段落没有指定外边距。</p>

    <p class="margin">这个段落带有指定的外边距。这个段落带有指定的外边距。这个段落带有指定的外边距。这个段落带有指定的外边距。这个段落带有指定的外边距。</p>

    <p>这个段落没有指定外边距。</p>

    </body>

    </html>

  • 相关阅读:
    文言文
    【我回来了】TO DO LIST
    AFO
    [DP]
    [CF1221F]Choose a Square
    关于博主(2)
    自我介绍( 并不?
    老年选手的复健之路
    CSP/NOIP 2019 游记
    CSP前模板复习
  • 原文地址:https://www.cnblogs.com/dark-passion/p/5553997.html
Copyright © 2011-2022 走看看