开发者

How do I assign negative positioning in percentage for elements in css?

I have a panel which has top:-138px; I want to give this in %, i tried givin开发者_开发问答g negative percentage but it doesn't seem to be working.


You can do this as long as its parent element has a defined height, whether in pixels or percentage. If you play around with this fiddle, you'll notice that the inner element's top attribute is only respected if you give the container an explicitly-definied height.

http://jsfiddle.net/KcWSr/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜