0

I have a picture of a view of text inside a div which is a center alignment. The views of texts are shown as -

View1

another example

View 2

But if I use the following code -

margin-left: auto;
margin-right: auto;
text-align: center;

but this code gives me

enter image description here

Here is the code in jsfiddle-

https://jsfiddle.net/2bu0gym3/

How to get the desired alignment view, thanks in advance!

Community
  • 1
  • 1
Achy97
  • 994
  • 1
  • 14
  • 29

3 Answers3

1

You have to center p itself or its parent.

.testimonials p ,.events P{
  margin: 0% 3%;
  text-align:center;
}
m1k1o
  • 2,344
  • 16
  • 27
1

You simply add:

p {
text-align: center
}

It should work. As far as I can tell, there's nothing (no class, id or something else) in your code right now that should make the text be center aligned.

0

in @media you forgot add .testimonials p

@media only screen and (max-width:767px){
  .testimonials img,.work-service,.testimonials p{
    margin-left:auto;
    margin-right: auto;
    text-align: center !important; 
  }
sadegh
  • 1,720
  • 1
  • 16
  • 30