I have a background image with a div. I want to write some text, but this text should change the font size through the div.
I have a background image with a div . I want to write some
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I understand your question this way, you would like to fit some text into a given div with a fixed dimension, and if the div is too small to show all the text, the font size should be shrinked until the text fits into the div. If that’s the point, here is my solution.
Here is an example with a jQuery implementaion: http://jsfiddle.net/MYSVL/2/
Here is a div
With a fixed size
This JavaScript will do the job.