The problem is. The big box is the parent div in which there is a smaller div (smaller box) that contains an image. The rest of the bigger div should be filled with text (red/pink lines). Text is formatted in paragraphs (<p> .... </p> <p> .... </p>) and there are some links within text.
Sizes of divs are dynamic, they change when window size changes. So I want the font size to change to fit the main div. Is there any solution? I would really appreciate it.
Shouldn't i write <script> something something </script> somewhere with the path of the script.
And where should I place this line you wrote?
Sorry for those questions, I haven't done anything like this before. Yet, I would like to make a website by myself. So all the help is appreciated. Thanks!
<p> text </p>
<p> text </p>
<p> text </p>
<p>text <a href="link" target="_blank">Link</a>!</p>
</div>
</body>
</html>
As you can see, there is the main div called "taust" and there is div "top_foto" inside it. There's also one additional photo and text with hyperlinks.
Thanks for your response, but I have to admit it, it does not work the way I would like. This fits the last row of each paragraph, but I would like to fit whole text into the div "taust". Because if I change my browser's window size, the size of the div "taust" changes, but the text size does not change, and breaks out of the div, but I would like the text to fit the div, yet I would not like to stretch my div. So I would like to manipulate the font size in order to fit it in the div. I think it is not possible just using html and/or css, that's why I would like to know, how to use the script you mentioned.
I'm still looking at this. That script seems to handle fitting text horizontally. It sounds like you need something that will fit the text both horizontally and vertically.
I'm always up for networking with fellow web professionals. Connect with me on LinkedIn if you like!
Yeah, it should be simple procedure - if the text breaks out of the div, then decrease font-size. And function should do it until it fits. I would do it myself, but I don't have the skills writing javascript.
Still, thanks for your time and effort! Seems like no-one is able to help me
Bookmarks