css div grow upwards dynamically

拟墨画扇 提交于 2019-12-06 14:24:45

Here's an edited fiddle: http://jsfiddle.net/Z8fg3/

Notice two main differences: the class bubble is also absolutely positioned (like the character), and, instead of specifying a top, it has a bottom equal to the height of the character (plus some padding for the arrow and stuff).

(I moved one of the character both to fit the bubble and to show that it sticks to it regardless.)

I suppose you could set the container of the bubble to be relative and set the bubble to absolute with a bottom of 0 and add enough margin-bottom so it's no longer on of it's container (the character)... it should expand upward rather than downward since it's fixed to the container..

There's quite a few problems with your CSS though and I doubt much of this is going to be very cross-browser friendly.

See this fiddle: http://jsfiddle.net/HnezM/

.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!