Make text center aligned only on mobile and tablet

Q : Is there a way to have text center aligned ONLY on mobile and tablet, but left aligned on desktop?

A: You can use media queries and target screen size. Set text left align by default and target it by id or class inside a media query for tablet/mobile. Add this css to Divi options custom css area (theme options). Don’t forget to go in module css and set the id to : mytext

@media screen and (max-width: 768px) {
#mytext {

Contributed by Fabrice Esquirol

Tuts Directory Rating


  • The comment section is for blog post/tutorial rating and reviewing purposes only. If you have any questions about a tutorial, please post them in the tutorial publisher's website.

    Leave a Reply

    Notify of