How can I change the font size on PC and Mobile.

This topic has 4 replies, 2 voices, and was last updated 3 years, 10 months ago ago by Olga Barlow

  • Avatar: east_ikebukuro
    east_ikebukuro
    Participant
    February 23, 2021 at 09:02

    I put following code in additional CSS area to make some text big. and it worked.

    p.dai{
    	font-size:2.6rem;
    	font-weight:bold;
    	line-height:3.8rem;
    	border:0px solid #000;
    	/*margin:1.6rem 0.4rem 1.6rem 0.4rem;*/
    	}

    I put the following code in the additional CSS area to make the same text smaller on mobile screen. But it doesn’t work. How can I make this work?

    @media only screen and (max-width: 1023px){
    p.dai{
    	font-size:1.9rem;
    	font-weight:bold;
    	line-height:2.6rem;
    	border:0px solid #000;
    	/*margin:1.6rem 0.4rem 1.6rem 0.4rem;*/
    	}
    }
    3 Answers
    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    February 23, 2021 at 18:41

    Hello,

    Provide us with link to page where you used these paragraphs and with temporary WP Dashboard access to check your settings and help you.

    Regards

    Avatar: east_ikebukuro
    east_ikebukuro
    Participant
    February 24, 2021 at 01:01

    I removed following code from theme customize additonal CSS area and put it on child theme’s CSS file. And it worked.

    p.dai{
    font-size:2.6rem;
    font-weight:bold;
    line-height:3.8rem;
    border:0px solid #000;
    /*margin:1.6rem 0.4rem 1.6rem 0.4rem;*/
    }

    but code in “@media only screen and (max-width: 1023px){}” still doesn’t work. Font size doesn’t change even on mobile screen even after clearing cache.

    @media only screen and (max-width: 1023px){
    p.dai{
    font-size:1.9rem;
    font-weight:bold;
    line-height:2.6rem;
    border:0px solid #000;
    /*margin:1.6rem 0.4rem 1.6rem 0.4rem;*/
    }
    }

    Please contact administrator
    for this information.
    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    February 24, 2021 at 12:22

    Hello,

    If you add code for the same elements then take into account the priority of styles. Put the code for the smaller devices below the code for the large devices https://prnt.sc/105lvl4

    Check your site now.

  • Viewing 4 results - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.