Tag Archives: xhtml

align center not working on ie

Last time I was having problem aligning my website at the center when viewing on ie browser ONLY. I’ve used margin-left:auto and margi-right:auto but it didn’t work but how come on my other websites it worked!

I found the culprit it’s my doctype coz on that website which I cannot center I’m using html 4 whereas on my other websites i’m using  xhtml1.  Actually that’s not the only issue coz on my previous post I also have problem on css hover on non-anchor tag, like applying hover on a <tr> and likewise this doctype saves the day.  There are still other issues like opacity…

Anyway, these issues only happened on ie browser but not on firefox and safari.

Check the sample below:

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd“>





DOCTYPE html PUBLIC





I haven’t fully researched on this type but using the 2nd type of my code, some css doesn’t work but trying the 1st one works perfectly. Yeah XHTML 1.0 Transitional, has something to do with that but haven’t fully read on it. Will research more of this :)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">