Almost ashamed to ask... vertical centering with CSS
It's been ages since I've done any CSS (2 years, to be exact). Back then, I remember it was quite complicated to position an element vertically centered on the page. I also remembered there are quite a lot of hacks and workarounds.
Right now, I've tried like four of them, and none of them works.
I have an object (it's actually an object. A swf) with a fixed width and a fixed height. I want to position it right in the middle of the page, vertically and horizontally. Of course, I want it centered for small resolutions, as well as for 27" screens.
Up to now, I was able to center it horizontally (and surprisingly, the only thing that worked was to set the text-align property of the body tag to "center". The margins and such didn't work at all).
So, is it me, or is there really a problem with vertical alignment and CSS ? I've done it already, several times, and I never had any trouble with it. I tried it with a simple div (without my swf object), and it works, but as soon as I put the swf in it, all vertical alignement is jammed. The thing gets aligned at the top of the window. Why is it so ? Is there a really good hack out there ?
Here is my code, for what it's worth... I took an old code of mine, that's still perfectly working on the website it's on.
Thanks for all suggestions !
<div id="bloc"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="950" height="550" id="bureaunew-s15" >
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="bureaunew-s15.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#666666" /> <embed src="bureaunew-s15.swf" quality="high" bgcolor="#666666" width="950" height="550" name="bureaunew-s15" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread