You can do this as long as its parent has a certain height, whether in pixels or percent. If you play with this violin, you will notice that the attribute of the inner element topis respected only if you give the container explicitly defined height.
http://jsfiddle.net/KcWSr/
source
share