Isabella
Joined: 15 Jun 2006 Posts: 103
|
Posted: Fri Aug 11, 2006 11:43 pm Post subject: Browser Display Issues And ALIGN |
|
|
Of course, if you're moderately familiar with CSS, you may have already asked yourself this question:
"Why not just control the inline element problem by converting the problem image from an inline to a block-level tag?"
Yes, it seems simple. Just add this class:
| Code: | <style type="text/css">
.centeredImage
{
text-align:center;
display:block;
}
</style> |
and apply it to the IMG you want to center:
| Code: | | <img src="imgName.gif" class="centeredImage" alt="image description" height="100" width="100"> |
That eliminates the extra code needed for the container tag.
That is (or seems to be) the easiest and most elegant solution. And it is - for Explorer browsers. Other browsers follow W3C standards more strictly than Explorer (even Explorer 6.x) and don't allow you to convert images from inline to block. Just to make it even more confusing though, some of those browsers do allow you to convert other inline elements to block-level!
Carefully check for display problems if you apply styles to any page element that also uses the ALIGN attribute. Some browsers may ignore the deprecated ALIGN attribute value. This is a particular problem in tables.
Via Larisa
|
|