Jump to content

Scaling text


Sibkis
 Share

Recommended Posts

It it possible to scale text in the same way as scaling an imageI have been messing around with the CSS but am slowly coming to the conclusion that it can not be done.CSS#img1 IMG {width:100%; max-width:33%;}HTML<p id="img1"><img src="/HTML5/images/logo.jpg" alt=""></p>Any help would be great.Thanks

Edited by Sibkis
Link to comment
Share on other sites

http://www.w3schools.com/css/css_font.asphttp://www.w3schools.com/css/pr_font_font-size.asptry it with relative units of measurement. Edited by thescientist
Link to comment
Share on other sites

<!doctype html><html><head><title>Font Size Testing</title><meta charset="utf-8" /><script>body { font-size: 100%;}	   H1 {font-size: 250%;}H2 {font-size: 200%;}H3 {font-size: 150%;}H4 {font-size: 125%;}p { font-size: 100%; }H1 {font-size: 2.5em;}H2 {font-size: 2.0em;}H3 {font-size: 1.5em;}H4 {font-size: 1.25em;}p { font-size: 1.0em; }</script></head><body><h1> This Should Scale %</h1><h2> This Should Scale %</h2><h3> This Should Scale %</h3><h4> This Should Scale %</h4><p> This Should Scale %</p><h1> This Should Scale em</h1><h2> This Should Scale em</h2><h3> This Should Scale em</h3><h4> This Should Scale em</h4><p> This Should Scale em</p></body></html>

This a the test page I have been using what I am looking to acheive is for the text to automaticly resize when I make my window smaller.

Link to comment
Share on other sites

what I am looking to acheive is for the text to automaticly resize when I make my window smaller.
I don't think that's possible with just CSS. You might be able to do something with JavaScript, where you capture the resize event and change the font size of the body.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...