Jump to content

Text size as % of div. Is it possible?


johnsmith153

Recommended Posts

Can I set text size based on a % of the parent div ?

 

So I could set to 5% and if div was 300x300 the font size would be 15px.

 

This is mainly for when the div itself is a % of the browser window (so changes as you resize the window).

 

I have a layout which on a mobile phone obviously has a narrow div, and on a desktop it is very wide. I would like small px text on the mobile and larger on the desktop (% of div size).

 

I don't want to use different stylesheets etc. I want the text to resize as the window does.

Link to comment
https://forums.phpfreaks.com/topic/218432-text-size-as-of-div-is-it-possible/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.