How to horizontally center HTML DIV element in CSS

1 Answer

0 votes
.center-text {
   display: flex;
   justify-content: center;
}
<div class="center-text">  
  <h1>text text text</h1>
</div>

 



answered May 21, 2021 by avibootz

Related questions

2 answers 447 views
2 answers 420 views
1 answer 300 views
300 views asked Dec 18, 2018 by avibootz
4 answers 698 views
1 answer 381 views
2 answers 418 views
1 answer 325 views
...