Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jethroted

macrumors 6502a
Original poster
Jan 2, 2003
619
0
Cyberspace
First I would like to say I am not a web designer at all. I am just trying to get a small page up for my mom. Anyways I am just trying to get a banner at the top of the page to center itself. This would seem to be a very simple thing to do, however, it has proven to be frustrating. I know this is probably basic html, but if I don't know it, then what can I do, right? :confused:
 
Well, the easiest, though not necessarily the best, way to do it would be to wrap the img tag in a <center></center> tag...
<center><img src="blahblahblah"></center>
jx
 
Originally posted by jMc
Well, the easiest, though not necessarily the best, way to do it would be to wrap the img tag in a <center></center> tag...
<center><img src="blahblahblah"></center>
jx

:( That did not work for me.
 
hmmm, can you post the relevant piece of code you're using here? i can't see why that shouldn't work. are you using tables at all or using 'align' variables in any of your tags?
jx

edit: try <p align=center><img src="blahblahblah"></p>
 
Make sure that the image you are centering is cropped the way you think it is. (i.e. white space for transparent spaces around the pic may make it appear to be off center.)

If you are placing it in a table align the cell.

Also try <img src=blah.gif align="center">. This may be IE only.
 
<center><img src="blahblahblah"></center> will work for you just fine.

I think you should do this first:

Add width and height to your img tag: <img src="blahblahblah" width="200" height="200"> (or what ever your actual picture size is)

second: make sure you have the right path for your image. For example:

<img src="picture.jpg"> or <img src="images/picture.jpg">

Also, where are you testing this out? Locally or are you uploading to the web server? If you coding by hand and testing on the web server, make sure you upload the image to the server. If your testing locally, make sure have the correct path to your image in the img tag.
 
Thanks Guys! The <center> thing did work out in the end. The problem was that originally the image was in a table, and that was causing my problems.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.