边框底部样式没有效果

时间:2016-08-28 03:47:44

标签: html css border

我有这个html片段,显示网格状结构。它看起来像我想要的大部分,除了我想要最后三行的虚线下划线。我尝试使用以下样式设置底部边框:

风格="下边框:点缀; border-bottom-color:black;边界底部宽度:2px的">

然而,即使调整宽度等,它根本没有效果,我缺少什么?

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title></title>
</head>
<body>
  <div id="AnimalGrid" style="border:solid; border-width:2px; border-color:lightgray; padding-left:12px;padding-top:8px;margin:10px">
    <table style="width:100%">
      <tr>
        <td style="font-family:Calibri; font-size:large; color:midnightblue; text-align:left"><b>RESULT DETAILS</b></td>
      </tr>
      <tr>
         <td style="width:25%; font-size:large; padding-left: 2px"><i>Animal<sup>1</sup></i></td>
         <td style="width:25%; font-size:large; padding-left: 6px"><i>Animal</i></td>
         <td style="width:25%; font-size:large; padding-left: 6px"><i>Speed<sup>2</sup></i></td>
         <td style="width:25%; font-size:large; padding-left: 6px"><i>Type<sup>3</sup></i></td>
      </tr>
      <tr style="border-bottom-style:dotted; border-bottom-color: black; border-bottom-width:2px">
         <td style="width:25%; font-size:large; padding-left: 6px">Cheetah</td>
         <td style="width:25%; font-size:large; padding-left: 6px">Tiger</td>
        <td style="width:25%; font-size:large; padding-left: 6px">60mph</td>
        <td style="width:25%; font-size:large; padding-left: 6px">Carnivore</td>
    </tr>

    <tr style="border-bottom:dotted; border-bottom-color: black; border-bottom-width:2px">
        <td style="width:25%; font-size:large; padding-left: 6px">Lion</td>
        <td style="width:25%; font-size:large; padding-left: 6px">Zebra</td>
        <td style="width:25%; font-size:large; padding-left: 6px">40mph</td>
        <td style="width:25%; font-size:large; padding-left: 6px">Mixed</td>
    </tr>

    <tr style="border-bottom:dotted; border-bottom-color: black; border-bottom-width:2px">
        <td style="width:25%; font-size:large; padding-left: 6px">Horse</td>
        <td style="width:25%; font-size:large; padding-left: 6px">Cow</td>
        <td style="width:25%; font-size:large; padding-left: 6px">10mph</td>
        <td style="width:25%; font-size:large; padding-left: 6px">Herbivore</td>
    </tr>
    </table>
    </div> 
  </body>
  </html>

1 个答案:

答案 0 :(得分:1)

喜欢这个吗?

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title></title>
</head>
<body>
  <div id="AnimalGrid" style="border:solid; border-width:2px; border-color:lightgray; padding-left:12px;padding-top:8px;margin:10px">
    <table style="width:100%">
      <tr>
        <td style="font-family:Calibri; font-size:large; color:midnightblue; text-align:left"><b>RESULT DETAILS</b></td>
      </tr>
      <thead>
         <th style="width:25%; font-size:large; padding-left: 2px"><i>Animal<sup>1</sup></i></th>
         <th style="width:25%; font-size:large; padding-left: 6px"><i>Animal</i></th>
         <th style="width:25%; font-size:large; padding-left: 6px"><i>Speed<sup>2</sup></i></th>
         <th style="width:25%; font-size:large; padding-left: 6px"><i>Type<sup>3</sup></i></th>
      </thead>
      <tr>
         <td style="width:25%; font-size:large; padding-left: 6px; border-bottom:dotted; border-bottom-color: black; border-bottom-width:2px">Cheetah</td>
         <td style="width:25%; font-size:large; padding-left: 6px; border-bottom:dotted; border-bottom-color: black; border-bottom-width:2px">Tiger</td>
        <td style="width:25%; font-size:large; padding-left: 6px; border-bottom:dotted; border-bottom-color: black; border-bottom-width:2px">60mph</td>
        <td style="width:25%; font-size:large; padding-left: 6px; border-bottom:dotted; border-bottom-color: black; border-bottom-width:2px">Carnivore</td>
    </tr>

    <tr>
        <td style="width:25%; font-size:large; padding-left: 6px; border-bottom:dotted; border-bottom-color: black; border-bottom-width:2px">Lion</td>
        <td style="width:25%; font-size:large; padding-left: 6px; border-bottom:dotted; border-bottom-color: black; border-bottom-width:2px">Zebra</td>
        <td style="width:25%; font-size:large; padding-left: 6px; border-bottom:dotted; border-bottom-color: black; border-bottom-width:2px">40mph</td>
        <td style="width:25%; font-size:large; padding-left: 6px; border-bottom:dotted; border-bottom-color: black; border-bottom-width:2px">Mixed</td>
    </tr>

    <tr>
        <td style="width:25%; font-size:large; padding-left: 6px; border-bottom:dotted; border-bottom-color: black; border-bottom-width:2px">Horse</td>
        <td style="width:25%; font-size:large; padding-left: 6px; border-bottom:dotted; border-bottom-color: black; border-bottom-width:2px">Cow</td>
        <td style="width:25%; font-size:large; padding-left: 6px; border-bottom:dotted; border-bottom-color: black; border-bottom-width:2px">10mph</td>
        <td style="width:25%; font-size:large; padding-left: 6px; border-bottom:dotted; border-bottom-color: black; border-bottom-width:2px">Herbivore</td>
    </tr>
    </table>
    </div>
  </body>
</html>