Page 1 of 1

Javascript - Time Greeting font size

Posted: Tue Oct 24, 2023 6:08 pm
by MGD4me
My website uses 4 breakpoints. When using the built-in Javascript 'Time Greeting' script, there doesn't seem to be a way to set the font size at each of the individual breakpoints to different values.

Is there a work-around, so that I can have larger fonts for wider viewports, and a reduced font size for phone/tablet viewports?

Thanks...

Re: Javascript - Time Greeting font size

Posted: Tue Oct 24, 2023 7:05 pm
by crispy68
You could add some CSS and use media queries to change the font size.

For example:

Code: Select all

<style>
@media (max-width:969px){#greeting{font-size:42px;}}
@media (max-width:767px){#greeting{font-size:24px;}}
</style>

Re: Javascript - Time Greeting font size

Posted: Wed Oct 25, 2023 11:05 pm
by MGD4me
Thanks, Crispy...

That did the trick!
I had to work out the breakpoint settings, and at first confused points versus pixels, but after a bit of tweaking, it now works perfectly. :D