tags:

views:

41

answers:

1

Hello all,

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 can 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

A: 

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>
LightningWrist
Thank you very much for your help.The issue that I have is that the div with the SWF is above in the code, and then there is the script tag with the div it should go into. I had to remove the div with the SWF outside of the main structure because I want it to load at the beginning. I then grab the script template, but I want the SWF inside it, at a specific place. I am not sure how to use your solution. Thanks.
Rudy
if you use the above and put it inside a your script tag, it should work
LightningWrist
But where would I put the <script> tag please?
Rudy
I found a different solution:I had to separate my template in two templates, and put the SWF in between.Thank you for the help anyway.
Rudy