Click here to Skip to main content
14,492,143 members
Rate this:
Please Sign up or sign in to vote.
See more:
I am working on building my website on Squarespace. I have my coding set up for some text with the "vw" (variable width) for my font.
It shows up on my computer with no problem, but when I view on mobile, the text becomes really small.

any suggestions?

What I have tried:

I have searched a few places online and have come up unlucky. Here is my code below.

<span style="font-size:1vw; letter-spacing:2px; line-height:1">APPARENTLY THIS PAGE TOOK THE DAY OFF TO GO BUY A HOME AND IS PROBABLY OUT LOOKING AT THE MOMENT... THATS OUR BAD...YOU CAN BE OUT LOOKING TO! JUST FOLLOW THE LINK BELOW! OR CLICK THE "GO BACK HOME BUTTON"</span>

Edit fiddle - JSFiddle[^]
Posted
Updated 17-Sep-19 6:51am
v2
Comments
Richard Deeming 17-Sep-19 12:44pm
   
I've removed the link from your question, since it could possibly be considered "spam". I've added a link to JSFiddle example of your code instead.

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Two possible solutions from this StackOverflow thread[^]:

1) Use calc:
font-size: calc(10px + 1vw);
Edit fiddle - JSFiddle[^]

2) Use media queries:
.responsive-text {
    font-size: 10px;
    letter-spacing: 2px;
    line-height: 1;
}

@media (min-width:1000px) {
    .responsive-text {
        font-size: 1vw;
    }
}
Edit fiddle - JSFiddle[^]
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100