Site logo

Archived topic

How to set a content to display differently on desktop vs mobile

8 replies · Started by Kenny on June 19, 2017

Viewing posts 1–9 of 9

Thanks for the help agian. The home page message we have on https://fimicimplement.com/ , we want to it display 16 font on desktop but it will be too large to view for mobile. Ideally 8px is perfect for mobile viewing but it will be too small for desktop. How do i separate them in codes to display both version depending on the device? Below is the code i have for the message.

#Home-1 {font-size: 10px;
font-family: Georgia, 'Times New Roman', serif;
color: #000;
text-align: center;
font-weight: 100;
font-family: 'Hoefler Text', Georgia, 'Times New Roman', serif;
font-weight: normal;
font-size: 1.0em;
letter-spacing: .1em;
line-height: 1.0em;
margin:0px;
text-align: center;
text-transform: uppercase;}

Try this for mobile:

@media (max-width: 768px) {
    #Home-1 {
        font-size: 10px;
        font-family: Georgia, ‘Times New Roman’, serif;
        color: #000;
        text-align: center;
        font-weight: 100;
        font-family: ‘Hoefler Text’, Georgia, ‘Times New Roman’, serif;
        font-weight: normal;
        font-size: 1.0em;
        letter-spacing: .1em;
        line-height: 1.0em;
        margin:0px;
        text-align: center;
        text-transform: uppercase;
    }
}

This shows you all the break points if you are interested: https://generatepress.com/forums/topic/how-do-i-search-for-my-previous-posts/#post-263744

I tried that but no matter what i entered as font size, it will always display the designated font size under page builder.

I tried to add !important; but that didnt help.

i got it to work.. thank you so much :)

but i have another dumb question, once the font are shrink-ed, there is an opening white space at the bottom of the page, the space varies depending on device.
https://fimicimplement.com/wp-content/uploads/2017/06/Screenshot_20170621-005837.png
https://fimicimplement.com/wp-content/uploads/2017/06/1497977891674.jpg

These spaces were originally the footer which i hid on mobile view. Is there anyway to eliminate it completely on mobile?

help please?

I tried this but it didnt help :(

html:after {
content: "";
width: 100%;
height: 100%;
background: #FFF;
position: fixed;
}

Typically you should just make it so your pages are long enough. It's a standard thing with websites - they're only as tall as your content.

This archived topic is closed to new replies.