Answers for "how to write a text inside a div"

1

how to write a text inside a div

<html>

<head>
  <style type="text/css">
    div {
      height: 100px;
      width: 100px;
      background: #ccc;
      text-align: center;
    }

    p {
      line-height: 100px;
    }

  </style>
</head>

<body>
  <div>
    <p>centered</p>
  </div>
</body>

</html>
Posted by: Guest on June-09-2021

Code answers related to "how to write a text inside a div"

Browse Popular Code Answers by Language