开发者

CSS Inline Coding

开发者 https://www.devze.com 2023-03-19 08:15 出处:网络
I hav开发者_开发问答e following code with a div #letmeout in it. Due to the outer <div> having position:relative and overflow hidden; set, the #letmeout div is not displayed. I need to display #

I hav开发者_开发问答e following code with a div #letmeout in it. Due to the outer <div> having position:relative and overflow hidden; set, the #letmeout div is not displayed. I need to display #letmeout without modifying the outer <div>.

<div style="position: relative; overflow: hidden;"> 
    <div id="letmeout" width="100%" height="1000px" style=".....">ok</div>
</div>

I tried adding an inline style background:red; position: absolute; z-index: 10000; color:blue; left: 0px; top: 0px; height:10000px; display:marker; overflow:auto; margin:0px; but #letmeout is still not shown. How can I do this without modifying the outer div and only using inline styles on #letmeout?


By assigning relative positioning to the parent you "locked" the sub (child) into the parent container.

If you really need a screen takeover (as your code suggests) #letmeout { position:fixed; } may help. Be warned though, fixed positioning doesn't act like absolute or relative. fixed elements take their position based on the viewport.

Check it out: http://www.w3.org/TR/CSS2/visuren.html#fixed-positioning

You will also find explanations to your positioning and float options at that URL as well.

0

精彩评论

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