I changed the font root size with this html embed (to be visible directly in the designer):
<style>
html { font-size: 20px; }
@media (min-width: 1920px) {
html { font-size: 23px; }
}
@media (min-width: 1440px) {
html { font-size: 22px; }
}
@media (min-width: 1280px) {
html { font-size: 21px; }
}
@media (max-width: 991px) {
html { font-size: 19px; }
}
@media (max-width: 767px) {
html { font-size: 18px; }
}
@media (max-width: 478px) {
html { font-size: 17px; }
}
</style>
So far, so good. But there are two problems:
The breakpoints 1440px and up and 1920 px and up ignore the code and stay at 21 px. You can check that on the starting page in the lower area. There are two divs. Left one with the px height and the right one with rem height. All other breakpoints works fine.
Every time the page is loaded, in the upper left the html emebd code is visible for some mili seconds.
It would be awesome if someone could help me. This is my basic template for all my website projects. So it is very important for me. Many thanks in advance!
The important bit here is "cascading " as in flowing downwards.
CSS is implemented in the order that you write it WITH LATER CSS OVERRIDING EARLIER CSS
So the reason your 1920px and 1440px media queries are not working is because they are being over riden by the later 1280px one. You can fix this by changing the order of your CSS like so:
html { font-size: 20px; }
@media (min-width: 1280px) {
html { font-size: 21px; }
}
@media (min-width: 1440px) {
html { font-size: 22px; }
}
@media (min-width: 1920px) {
html { font-size: 23px; }
}
@media (max-width: 991px) {
html { font-size: 19px; }
}
@media (max-width: 767px) {
html { font-size: 18px; }
}
@media (max-width: 478px) {
html { font-size: 17px; }
}
I’m unable to see the live site so cant see what you mean about the visibilty of the code. Can you provide a link to the site?
Yeah I can see the flickering you are talking about.
The reason for this - you have some plain text inside your body tag. This text reads “html { font-size: 20px; }” so it’s a bit of your code that got loose:
This can occur when CSS isn’t wrapped inside the tags that it needs to properly function.
Since this is happening on every page it’s likely that this error is found in the custom code area of your site settings. This isn’t something I can look at from your read only link so do you want to have a look yourself?
If you look in the custom code I think you will see something like this:
html { font-size: 20px; } <style>
your code here </style>
It could also be in the embed but looks like you removed it?