Forum Moderators: not2easy

Message Too Old, No Replies

help me align a div to right (and center?)

         

papachumba

12:09 pm on Oct 4, 2007 (gmt 0)

10+ Year Member



Anyone knows how can i center a div with flash in the middle of the page for wide resolutions, but if the resolution is smaller than the width of the flash file the file will overflow to left and its right edge will keep sitting on the right edge of the browser window?

I have a 1262px wide flash file. What happens is that my current code works beautifully up to a resolution of 1280px. The flash content fills the page horizontally, and its right edge is sitting on the right side of the browser. If i drag the window and make it smaller, the flash starts overflowing to the left, staying positioned on the right side, which is what i want. This can be done by setting the div to float to right or right:0px; properties. Problem is with wide screen monitors. If resolution is say, 1600px i have a nasty white gap on the left side of my div.

I could redesign the flash file to be bigger than 1600px, but it contains some heavy code for image transitions, and i really cannot do this, it also means all my images for that flash file would need to be sized over 1600 in width, which increases loading times... Is there anyway i can do this, or should i just center the blasted thing in the middle?

penders

12:51 pm on Oct 4, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If resolution is say, 1600px i have a nasty white gap on the left side of my div.

Set a background(-color) on your flash container (DIV) that more closely matches the background of your flash anim - at least avoid a 'white' gap!?

papachumba

12:59 pm on Oct 4, 2007 (gmt 0)

10+ Year Member



mmm i thought of this but it cannot work - my flash contains a sequence of images, so i cannot set that gap to any color - it still looks horrible...The best thing i can currently do is center in middle of page which leaves equal gaps on each side at big res. Now if i could somehow get this image to overflow left when browser is sized down, instead of staying on the left edge - my problem would be solved...