Set the background color of <th> elements to "pink". - HTML CSS CSS

HTML CSS examples for CSS:Quiz

Description

Set the background color of <th> elements to "pink".

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<style>
table, td, th {
    border: 1px solid black;
}
th {<!--from   w w  w.ja  v  a  2  s  . c  om-->
    background-color: pink;
}
</style>
</head>
<body>

<table>
  <tr>
    <th>Firstname</th>
    <th>Lastname</th>
  </tr>
  <tr>
    <td>A</td>
    <td>B</td>
  </tr>
  <tr>
    <td>C</td>
    <td>B</td>
  </tr>
</table>

</body>
</html>

Related Tutorials