Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add custom CSS for displaying on mobile screens in WordPress?

I'm using BeTheme, a premium Wordpress theme. I edited the CSS and added this,

.the_content_wrapper{
  font-size:27px;
  line-height:1.6em;
  padding-left:270px;
  padding-right:270px;
  position:relative;
  font-family:Oxford1;
}

This works fine while viewing on Desktops, but while I checked using Inspect Elememt for display in iPhones and other phones, I couldn't read at all. It was fully blank due to the Padding. When I changed the padding to 0, the site became responsive again.

How do I go about correcting it?

I tried installing Custom CSS for Mobiles and Jetpack, but the code I found doesn't work. I do not know what div or classes to use.

Can you all help me? How do I display in the mobile as so it seems responsive.

Thankyou!

like image 675
Joshua Avatar asked Dec 05 '25 17:12

Joshua


1 Answers

You need to use media queries like this:

@media (max-width:1024px){
    .the_content_wrapper{
        font-size:27px;
        line-height:1.6em;
        padding-left:0px;
        padding-right:0px;
        position:relative;
        font-family:Oxford1;
    }
}

@media (min-width:1025px){
    .the_content_wrapper{
        font-size:27px;
        line-height:1.6em;
        padding-left:270px;
        padding-right:270px;
        position:relative;
        font-family:Oxford1;
    }
}

N.B. Edit the width accordingly

like image 193
AndrewL64 Avatar answered Dec 08 '25 07:12

AndrewL64



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!