[Solved] something about css text-align:center


span has no align style defaults, but p does, so span inherits p style including left alignment.
First of all i dont see any reason to put this span into a p, you can simply use the P, but it’s not relevant…
You must add a class on the container and container > paragraf to center text as follows:

.foo, .foo > p{text-align:center;}
<div class="foo">
  <p class="foo2">
    <span>
      lorem ipsum dolor sit amet
    </span>
  </p>
</div>

It must work without using child declaration but as i dont know your stylement i let you as is to prevent errors. And please, don’t style in html tags -.-

Cheers!

solved something about css text-align:center