I am making a website with html5 and css. I am trying to make this website responsive, but I don't know why the size of the font stay the same when I resize the browser window, even when I'm using em
or percentage
s such as: font-size: XXem
or font-size: XX%
.
How can I make font resizable?
Press and hold the Ctrl key, then move the mouse wheel up or down. Alternatively, you can press and hold the Ctrl key (or Command on Mac), then press + or - (plus or minus) to increase and decrease the font size. All major browsers also support pressing Ctrl + 0 (zero) to change the font to its default size.
Syntax: font-size-adjust: number|none|initial|inherit; Below are the examples that illustrates the use of font-size-adjust property.
You can not control the size of the window. You can use CSS to set min-width and min-height properties to ensure your page layout stays sane. using 'window. open' I can open a page with a fixed height width.
For HTML5 web pages I would highly suggest using Viewpoint Width/Height values. They function similarly to % but are font sizes that resize with the window.
For example...
.some-paragraph{ font-size: 5vw; }
This would set the font-size to always be 5% of the current viewport width, even on re-sizing!
Learn more here: http://www.w3.org/TR/css3-values/#viewport-relative-lengths
Note: You may need to have this in your head:
<meta name="viewport" content="initial-scale=1">
It's called Responsive
@media screen and (max-width: 1024px) { your font style goes here } @media screen and (max-width: 950px) { your font style goes here } @media screen and (max-width: 650px) { your font style goes here } @media screen and (max-width: 480px) { your font style goes here }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With