开发者

CSS absolute positioning among multiple resolutions

The main section of my web site contains multiple DIVs, one of which sits in the "background" (z-index:-1;) with Flash. Outside of that DIV, I have another one (just text) that needs to overlap with the Flash DIV. I can't have them sit side-by-side because the Flash has a width of 100%. So I've done some overlap with CSS absolute positioning. However, this breaks when the browser开发者_运维技巧 width or height is adjusted.

What are the options for keeping the second DIV in a very specific part of the screen?

UPDATE - code added

<div id="yjsg2">
    <div id="adv1" class="yjsgxhtml" style="width:72.00%;">
    <div id="adv2" class="yjsgxhtml" style="width:28.00%;">
</div>

The CSS looks something like

#adv1 {width:100% !important;}
#adv2 {position:absolute; left:665px; top:110px;} 

So its fairly simple code, it's all a matter of the positioning of it all.


If you can, set the container element to have relative position as absolutely positioned elements are positioned based on their relative position to their parent if given any position other than static (default)


CSS absolute positioning and resizable pages do not mix well, as the box model does not provide great support for this (There are numerous rants / complaints about it). One option is javascript based layout managers like http://layout.jquery-dev.net/

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜