Click here to Skip to main content
15,878,814 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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

Two possible solutions from this StackOverflow thread[^]:

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

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

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

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900