Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Image Will Not Center on Page 2

Status
Not open for further replies.

JohnBates

MIS
Feb 27, 2000
1,995
0
0
US
hi HTMLers,

First, I'm not a web page developer so I guess I have an excuse to post a question so simple...

I've tried <CENTER> and align="middle" Cant get the image to float to the center of the page.

Thanks. John

<img src="\\GM\C$\Sys\Paragon\GM\Logos\gm_Logo.gif" align="middle" alt="GM logo"/>
 
Both <center> and align="middle" are deprecated and should be avoided. Since images are inline elements, you have to specify text-align on the parent element. Like so:
Code:
<div style="text-align: center;"><img src="\\GM\C$\Sys\Paragon\GM\Logos\gm_Logo.gif" alt="GM logo" /></div>
 
try:

<table height=100% width=100% align=center>
<tr>
<td align=center valign=middle height=100% width=100%><img src=/path/to/your.img></td>
</tr>
<table>

This will center your image on the page but makes it hard to put anything else on there.

Check out to see how to use CSS to center a background image and keep it from repeating.
 
aha! They have been deprecated. I'm always a bit behind the times with this web design stuff.

Thanks to both of you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top