I have a challenge with two div elements in my HTML code as shown below:
<div id="parent">
<div id="child">
<p class="child-text"> ..... </p>
<a class="child-link"> ..... </a>
<p class="child-text"> ..... </p>
</div>
</div>
#parent{ height: 400px; width:100px}
How can I make the contents of the #child
div to fit vertically within the parent div?
I am searching for a solution that will automatically resize the content of the child div based on its ID. I tried using jQuery.fittext
, but it only works with the child-text
class and not the entire child
div. It seems like it doesn't have the intelligence to recognize the inner elements within the child div and adjust them accordingly.
Are there any other alternatives available for this task?