Hello everyone,
I'm looking for a way to implement the following requirement: Upon viewing a web page, which will host a very large background image (1900 by 1200 pixels wide), I want the visitor to be centered in the page. Which means, I want my webpage content to be placed at the center of the page in an imaginary (or, perhaps, not so imaginary) box and the browser's scrollbars to be adjusted relevantly.
Any way that I can achieve this?
Thank you.
Center browser upon viewing page
Moderator: General Moderators
- akuji36
- Forum Contributor
- Posts: 190
- Joined: Tue Oct 14, 2008 9:53 am
- Location: Hartford, Connecticut
Re: Center browser upon viewing page
Css can handle this for you. Create a class
for your image : decide on height and width and
centering:
in html
It may be easier if you set up a div and place pic inside div.
Then style div and style pic.
Take a look here:
http://www.w3.org/Style/Examples/007/center
thanks
Rod
for your image : decide on height and width and
centering:
in html
Code: Select all
<html>
<head>
<style>
centerme {
height:1900
width:1700
margin-left: auto;
margin-right: auto;
}
</style>
</head>
<body>
<img src="sunset.gif" class="centerme">
</body>
</html>
Then style div and style pic.
Take a look here:
http://www.w3.org/Style/Examples/007/center
thanks
Rod