Notice: This thread is over two years old; the information may be outdated. Please consider creating a new thread if you require free support. If you have an active SiteOrigin Premium license, you can email our premium support desk at [email protected].
We set some font in visual editor to 24pt which looks really nice on computer screens but in mobile devices looks ridiculous and cut up. Is there a way to have the font smaller for mobile devices only.
URL: http://melapc.net
Hi mela
In the Text tab of the Visual Editor or Visual Editor widget (which ever one you’re using) try wrapping your text in a span tag as follows:
Then at Appearance > Custom CSS target that class as follows:
You can adjust the 680px breakpoint where you’d like this to kick in.
Let me know how it goes :)
I can’t seem to get this to work. I am using visual editor.
In the text tab if I do as you suggest
The text disappears from the page.
If I do this
This is a test of font size in mobile devices
the text reappears but doesn’t change in mobile. I have entered the custom CSS code as you suggested
When I add text in visual editor with font 24pt, without changing anything, this is what the text tab looks like
This is a test
I guess I can’t show the code in a post, it disappears also. How do I show you code as text??
Hi mela
(Just below the comment field we indicate how to wrap code in code tags.)
Did you insert any text into the span tags that I posted? Text should be inserted under the comment but before the closing span tag.
Thanks
In visual editor I have text 24pt and the code in the text tab looks like this
[<span style="font-size: 24pt;">this is a test</span>]
If I do, as I think you suggest, the code looks like this and the text disappears
[<span class="large-type">
<!– This is a test –>
</span>]
If I do this, the text reappears but does not adjust in mobile devices
[<span class="large-type" style="font-size: 24pt;">This is a test</span>]
I entered the CSS code you suggested.
[/* Mobile */
@media (max-width: 680px) {
.large-type * {
font-size: 10px;
}
}]
Hi mela
Please try entering in content after the HTML comment:
Hi Andrew,
Thanks for your patience, as you can tell I'm new at this.
So that worked, the text is back…but when I adjust the font to 24pt
(which is what I want on devises other than mobile) the code looks like this
[<span class="large-type" style="font-size: 24pt;">This is a test for adjusting font size in mobile only.</span>]
In the custom CSS I have this
/* Mobile */
@media (max-width: 680px) {
.large-type * {
font-size: 14px;
}
}
The mobile font size is *not* changing to 14px
:(
Hi Mela
I hope you do not mind me jumping in here.
Please try changing the custom CSS you have entered to this
Let us know how you get on
Magus
Thank you Magus
Unfortunately that didnt work :(
Hi Mela
I have just looked at your site and it does not seem to be processing any of the custom CSS you have entered. If you navigate to Appearance do you have two entries for Custom CSS. If so please make a copy of all the custom CSS you have entered and then disable the custom CSS plugin you have installed. Then return to Appearance->Custom CSS and enter the previous Custom CSS.
Let me know how you get on
Magus
Hi Magus
I only have one Custom CSS and it has other items in it which are working,
just not this recent set for the mobile font size.
Hi Mela
It seems this method does not work on plain text. Please remove the class statement from the span tag, then open the attributes section to the right of the Visual Editor.
In the Widgets Class box please enter ‘large-type’ without the quotes.
This should make it work. You may want to adjust the final font size in your Custom CSS to meet your requirements.
Let us know if this works
Magus
Success!!! Thank You!!
If i wanted different mobile font sizes on different pages can I change the name 'large-font' to another name and put in a new Costum CSS code with the new name?
Hi Mela
that is exactly right. You can also use the same method to control the styling on any widget that works with PageBuilder.
Magus
Great! Thanks for all your help Andrew and Magus!