Isabella
Joined: 15 Jun 2006 Posts: 100
|
Posted: Fri Aug 11, 2006 11:46 pm Post subject: Deprecated Alignment Strategies |
|
|
The simplest way to center an image is to place it inside opening and closing CENTER tags:
| Code: | | <center><img src="imgName.gif" alt="image description" height="100" width="100"></center> |
Unfortunately, the CENTER tag is also deprecated and becoming somewhat unreliable in the most recent browser versions.
Another simple solution is to enclose the image inside a page element that CAN be aligned to the center - such as a paragraph or a DIV tag:
| Code: | <p align="center"><img src="imgName.gif" alt="image description" height="100" width="100"></p>
<div align="center"><img src="imgName.gif" alt="image description" height="100" width="100"></div> |
| Quote: | That solution works in all browsers, but you'll have to contend with the extra spaces that browsers automatically place above and below block-level tags. You'll have less control over page layout and display with this method. And remember that both rely on a deprecated HTML tag or attribute.
But a more pressing problem is that once an element or attribute is deprecated there are no firm rules governing how browsers should display it. Most browsers continue to recognize the tag or attribute, but you'll probably encounter display differences between browsers and browser versions.
Cascading Style Sheets (CSS) offer more alternatives, but also have their own set of browser display problems. |
Via Larisa
|
|