The Little Guy Posted November 30, 2008 Share Posted November 30, 2008 I have user names, that are in a div, in a h1 tag. Is it possible to use css to resize the name according to the name length? I tried this, but doesn't it work: <div> <h1 style="font-size:100%;">The Little Guy</h1> </div> Quote Link to comment Share on other sites More sharing options...
haku Posted November 30, 2008 Share Posted November 30, 2008 You can only do this with javascript, it won't work with just CSS. CSS cannot do calcuations based on content. Quote Link to comment Share on other sites More sharing options...
josephman1988 Posted November 30, 2008 Share Posted November 30, 2008 Agreed, or PHP, count the characters in a string and implement a CSS style depending on the lentgh. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.