How do I align an image in HTML to the center of the page if I don't want

  • Thread starter Thread starter Balázs L
  • Start date Start date
B

Balázs L

Guest
the scroll-bar to appear? Here's the situation. I'd like to use an image as my site's menu - I know how to use <map> and <area> tags, that's not the problem -, but the image would be 1920 pixel wide, with the menu part only taking cca. 1000 px in its middle. So in order for it to work for people having lower resolutions, I'd want to align the image in the absolute center of the page, even if it means that the image "hangs out" from the site, without any horizontal scroll-bar appearing.

Is this possible? And if so, how? Even a link to a site explaining this would help, I've looked for this on a couple of more obvious sites, but didn't find anything so far.
 
You can use some CSS for alignment. CSS style margin-left: auto; margin-right: auto for instance. Another way is to wrap the image in a span or div tag (forget which) and use a CSS style, text-align: center

I'm not sure on the scroll bar not appearing. I know that there is a way to do it, but it's been a long time since I've looked it up. I do know it was CSS, HTML, or Javascript that did the trick, though. Try doing a google search on it, and you should find some more info on scroll bars. :)
 
You can use some CSS for alignment. CSS style margin-left: auto; margin-right: auto for instance. Another way is to wrap the image in a span or div tag (forget which) and use a CSS style, text-align: center

I'm not sure on the scroll bar not appearing. I know that there is a way to do it, but it's been a long time since I've looked it up. I do know it was CSS, HTML, or Javascript that did the trick, though. Try doing a google search on it, and you should find some more info on scroll bars. :)
 
Back
Top