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/
精彩评论