Friday, September 14, 2007
Previously, when you need to center "something" (which may be text, pictures, advertisements, banners or search boxes), all you need to do surround that "something" with the <center> and </center> tags, that is, what you have is
<center/>"something"</center>
Where that "something" could be the HTML or Javascript for displaying the picture, advertisement, banner or search box.
The situation is a bit murky now because the <center> tag is depracated in HTML 4.01, but will continue to work for sometime. However, it is not supported in XHTML 1.0 Strict DTD which is going to be more widely used as more and more mobile devices are used and you are encouraged not to use the <center> now. What you should do is to use inline CSS (Cascading Style Sheet). You should now use
<div style="text-align:center;">"something"</div>
Labels: Alignment