I use div align="center" to centre images and other objects.
However, internet explorer ( i tried it on v7) seems to be ignoring the closing of tag. So, entire webpage formatting is getting messed up.
Example : http://www.pallab.net/2007/05/28/ten-things-you-can-do-with-irfanview/
Or http://www.pallab.net/2007/05/29/email-bankruptcy-a-growing-reality/
Sample code :
<div align="center"><object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/AKabY1iPaBQ"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/AKabY1iPaBQ" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object></div>
Opera and firefox renders it properly. What am I doing wrong?
It's cleaner if you put the align in your css file
or you could also try
<div style='margin: auto; text-align: center;'>
margin: auto centers your content,
text-align: center also makes this work in IE
Also google for embedd and object.
W3C and IE have a different idea as to how you should embedd flash and youtube stuff in a page. Believe Alistapart also wrote some articles about it.
hope this helped
DE
also might wanna install webdevelopper plugin for firefox from http://chrispederick.com/work/web-developer/
Once installed, under the 'tools' option choose validate html. You'll notice that your page doesn't validate due to a link tag that isn't closed,...
DE
do this instead:
<object class="movie" type="application/x-shockwave-flash" style="width:425px; height:350px;" data="http://www.youtube.com/v/AKabY1iPaBQ"><param name="movie" value="http://www.youtube.com/v/AKabY1iPaBQ" /><param name="wmode" value="transparent" /></object>
then center the movie or whatever using CSS:
.movie {
display:block;
margin:auto;
margin-top:10px;
margin-bottom: 10px;
padding: 4px;
background:white;
border: 1px solid #ff0000;
}
Note that Ive removed the embed tags -- you dont need them. Using the code above will display youtube movies in all browsers that have the latest flash installed.
W3C Validator revealed the mistake I had made.
I had forgot to close a center tag.
Thanks for the help.