[Web4lib] HTML question

Rick Mason rcmason at rsproductions.net
Tue Apr 18 19:34:55 EDT 2006


Nope, it is not basic; don't feel dumb.  Figuring that out was a bit of 
a headache for me when I first encountered it.

The following, although based on CSS, passes the HTML 4.04 strict and 
transitional validation at http://validator.w3.org/ :

<div style="text-align: center;">
<img alt="alt text" src="imagefile.png">
</div>

Hope this helps!

Rick

Lynne Puckett wrote:
> Howdy, folks,
> This is so basic I feel quite dumb for even asking, but anyway:
> I have been reading the HTML 4.0.1 specs in an effort to get my pages 
> to validate. One of the things it says is that IMG ALIGN attributes 
> are bottom, middle, top, left, right. Middle is a vertical attribute. 
> So how does one center an image on a webpage horizontally? I have been 
> blithely using "align=center" for years, which has always worked fine, 
> but it's not valid. I don't want to center every image on all my 
> webpages - do I have to add yet another class to my already 
> innumerable CSS classes?
> Lynne


More information about the Web4lib mailing list