jeevika sharma jeevika sharma - 2 months ago 8
CSS Question

Border color + font color in HTML?

How should I give color to a table tr along with a separate border color.

Here is my class properties in style.css.



table tr {
background: #9a9a9a;
border-color: #000000;
font-size: 21px;
color: #fff;
font-weight: bold;
}

<table>
<tr>
<td>Cell1</td>
<td>Cell2</td>
</tr>
</table>





I need to give black color to the border and font color as white with background color as dark grey.

How to do this?

Era Era
Answer

You need to apply border on td

tr td { 
      background: #9a9a9a;
      border:1px solid #000000;
      font-size: 21px;
      color: #fff;
      font-weight: bold;
    }

border will apply from all 4 sides. you can change border sides with border-top, border-bottom, border-left, border-right

Comments