Codepen easier method to center text/images

Codepen easier method to center text/images


I am doing the portfolio proyect in codepen and I have to center some text, I am currently using in every line the class text-center, just like this:

<div class="text-center">line 1</div>
<div class="text-center"> line 2</div>

but I would like to use an easier method to center a paragraph with the same results as in the other method using html.
Could you suggest me an easier solution?


Hey. If you have a container wrapping those divs you could just give the “text-center” class to that instead, like this:

<div class="text-center">
  <div>line 1</div>
  <div>line 2</div>


So much thanks! I tried that way and it worked pretty well.