I'm attempting to make a div with a defined height transition to a new height that is determined by its textual contents. Presumably, this requires factoring in the width of the window, because as the window width decreases, the text wraps more, becomes longer, and requires a larger height value.
#object {
width: 100%;
height: 50px;
-webkit-transition: height 0.5s;
}
#object:hover {
height: <!-- new height depends on length of inner text, but also
how small the window size is, because of wrapping -->
}
Is there an efficient way to accomplish this?