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 295 views
1 answer 227 views
1 answer 249 views
2 answers 299 views
2 answers 329 views
1 answer 272 views
1 answer 231 views
...