How to horizontally center text in element with CSS

1 Answer

0 votes
<!-- HTML -->

<!DOCTYPE html>
<html>
<body>
<div id="divid">
    <p>Horizontally center text in div element</p>
</div>
</body>
</html>
/* CSS */

#divid {
  text-align: center;
  border: 1px solid green;
  padding: 10px;
}

 



answered Dec 25, 2021 by avibootz

Related questions

2 answers 290 views
1 answer 223 views
1 answer 242 views
2 answers 295 views
2 answers 324 views
1 answer 271 views
1 answer 229 views
...