Qbasicnews.com

Full Version: html problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
why wont this work?

<img src="trypanosoma.gif" align = center>

I'm trying to make this image center align...but it doesnt align at all.

Thanks for help!
Code:
<center>
<img src="trypanosoma.gif">
</center>

http://www.w3schools.com/tags/tag_img.asp
The align aligns it to text
Among other methods.

It is also good form to leave no space for the equals sign and to keep all values in quotation makrs. So instead of align = center it would be align="center", if align was an img attribute at all.
If you are having compliance problems, then use:

<img src="trypanosoma.gif" align="center" />

Complaince tends towards stuff like positioning to be dictated through CSS.
Smile This always works for me...

Code:
<P ALIGN="CENTER"><IMG SRC="Imagelink" ALT="ImageName"></P>

:wink:
That's not a very good way to do it unless you've CSS'd your site.

I apologize for my code above, it wasn't fully XHTML 1.0 Strict compliant.

It should be:

<img src="trypanosoma.gif" align="center" alt="imagename" />

I think the W3C complaincy checker will bitch about the align, but as I said, that kind of stuff is meant to be done through CSS.
thanks guys