Reputation: 1024
I have a picture of a view of text inside a div which is a center alignment. The views of texts are shown as -
another example
But if I use the following code -
margin-left: auto;
margin-right: auto;
text-align: center;
but this code gives me
Here is the code in jsfiddle-
https://jsfiddle.net/2bu0gym3/
How to get the desired alignment view, thanks in advance!
Upvotes: 0
Views: 67
Reputation: 1642
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;
}
Upvotes: 0
Reputation: 31
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.
Upvotes: 1
Reputation: 2364
You have to center p itself or its parent.
.testimonials p ,.events P{
margin: 0% 3%;
text-align:center;
}
Upvotes: 1