开发者

Relative div to another div that comes after

I have an issue with div positioning. I used to have a SWF inside my HTML that I would add after the last two divs:

<div id="content">
    <div style="position: absolute; left: 10px;">
         <div style="position: relative">

Something like that, it was working fine. Inside the last two divs was a SWF. Now I had to move the SWF out of this code because I am using the HTML code in the id "content" as a template, so I want the SWF to be outside of it. Unfortunately, I do not know if I can make the position of the SWF (into a div) relative to the div with id "content", although it appears before it.

Now it looks like there is a div with a SWF, and then:

<script type="text/html" id="template">
   <div id="content">....</div>
</script>

I would still like my SWF to be positioned at the same place, relative to the content. Is there anyway I c开发者_如何学Goan please do that? I am currently using absolute to place it where I want to, but the div id content is not static, so I would need to still use the relative positioning as before.

I really appreciate your help,

Thank you,

Rudy


If I am understanding correctly, it is very possible to use absolute positioning with dynamic content. That being said. I would try to put the SWF inside of its div class and absolute position that the way you want, and relative position the parent divs. Once again, if I am understanding your question correctly this should work.

<div id="main_structure_div"> /* this should be relatively positioned */
    <div id="SWF_house_div"> /* this should as well */
         <div id="SWF">
            SWF goes in here ( make this the absolute positioned element )
         </div>
    </div>
</div>
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜