jeudi 29 octobre 2020

Why div tag not reading mentioned class? [duplicate]

I want my div tags to have different background color than body background color but my browser only shows first div color changed not second one. why?

body {
  background-color: Linen;
}

.names {
  background-color: Yellow;
}

.title {
  background-color: rgb(255, 0, 0)
}
<!doctype html>
<html>

<head>
  <title>Our Blog</title>
  <link rel="stylesheet" type="text/css" href="style.css">
</head>

<body>

  <div class="title">
    <h1 align="center">O</h1>
  </div>

  <div class="names">
    <h2 style="float: left">M</h2>
    <h2 style="float: right">F</h2>
  </div>

</body>

</html>

But output is showing just first div background-color change not the second one




Aucun commentaire:

Enregistrer un commentaire