I'm trying to create a div that smoothly transitions from a set height to a height based on its text content. This likely involves considering the window width, as narrower windows cause text wrapping and increase the required height.
#object {
width: 100%;
height: 50px;
-webkit-transition: height 0.5s;
}
#object:hover {
height: <!-- new height is determined by text length and
window size for wrapping -->
}
Is there an effective method to achieve this?