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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Centering an image no matter what size it's viewed at...? 1

Status
Not open for further replies.

betonybee

Technical User
Feb 7, 2008
1
Hello everybody, firstly i have to say I am pretty new to building websites in dreamweaver but i'm doing my best to give it a go...

I am having an issue with something that seems to be so simple. I have built the layout of each page of my site in photoshop, and i'm using hotspots as means of navigation around the site, so essentially each page is just one inserted image.

What i want to do is make sure that whatever size my page is viewed at, that the image is in the absolute centre- even if a client stretches the browser window.

I've tried inserting shims etc. but to no avail...

I would love it if you could help x
 
Making your site just one big image is not that good, but:
Depending on how you've inserted an image, will be how you can center it,


I'm guessing, your image is an image map.
Code:
<img src="myimage" usemap="#mymap">
or something to that effect?

If so then wrap it in a DIV and set the divs text-align attribute to center.

Code:
<div style="text-align:center;">
<img src="myimage.jpg" ... >
</div>

However I strongly suggest you google for CSS tutorials, and how to create a working layout, that is not one big huge image.



----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top