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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.