473,406 Members | 2,549 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

centre page in larger browsers....

Hi all I am running internet explorer 7 at a resolution of 1024 768
the problem i am having with my page is that when it is viewed on
resolutions such as 1280 1024 or higher the page appears on the upper
left of the screen and a yukky white border all around.

theres actuall 2 things i need to be able to do and believe both done in css the first is to make the page appear centre in larger browsers so if someone can tell me how to do that it would be much appreciated.

the second is when someone views my page in a browser of 800 600 how do i get the web to determine the resolution and take them automatically to a version of the page I have created in that resolution?

thanks all for your help
Darren
Jul 8 '07 #1
2 1583
I can help you with the first thing, even though I'm basically a newbie at css positioning.

Put the bit you want to centre in a div - call it "pagewrapper" or something.
Expand|Select|Wrap|Line Numbers
  1.  <div id="pagewrapper">
  2.     <!-- your code goes here -->
  3. </div>
Then in your css stylesheet put this:
Expand|Select|Wrap|Line Numbers
  1. body { 
  2.    text-align: center; 
  3.    margin:0;
  4.    background-color:#putyourcolourhere;
  5.    }
  6. #pagewrapper {
  7.   margin-right:auto;
  8.   margin-left:auto;
  9.   text-align: left;
  10.   } 
You can also make the middle content width variable according to the browser window, by using width:90% (for example) in the pagewrapper.

Hope this helps :)
Jul 8 '07 #2
nitinpatel1117
111 100+
Also, the above css:

margin-left:auto;
margin-right:auto;

will not work in Internet Explorer, unless you give your webpage an appropriate doctype
Jul 9 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

22
by: Jonathan Snook | last post by:
I've been contemplating what the recommended usage of a "top of page" link should be? Should there only ever be one at the bottom of the page? Should they be sprinkled at various points on the...
179
by: SoloCDM | last post by:
How do I keep my entire web page at a fixed width? ********************************************************************* Signed, SoloCDM
3
by: CJM | last post by:
I want to create a footer with 3 items, one of which will always stay to the left, one will be in the centre, and the 3rd will be at the right. As you might imagine, I want the Right & Centre items...
10
by: Dave | last post by:
Hi, I have a centred table 700px wide. I'd like to use CSS instead of a table. Is the following the best, relatively standards compliant way for a non-expert to have content centred that will be...
8
by: Andrew Crook | last post by:
I placed the following code in my html file window.resizeTo(1000,700) window.moveTo((screen.availWidth/2)-(1000/2),(availHeight/2)-(700/2)); The resize seems to work fine, however, the move...
6
by: The Bicycling Guitarist | last post by:
When I reduce the width of the window of my home page, Firefox makes the <h1> and other text and buttons go UNDERNEATH the graphic in the middle of the page. However yukky Microsoft Internet...
12
by: ACaunter | last post by:
Hi all, I was wondering how i could write some code which would automatically open the Login Page once the session has expired? -- AdamPC@hotmail.com
57
by: Chris Tomlinson | last post by:
Hi all, Hope someone is able to help. I notice when I design a basic HTML page, it is affected if a WinXP user has Large Fonts set in their Control Panel. However some pages, e.g....
2
by: Ian N | last post by:
Hi, I've been trying to get my CSS menu to float to the middle of the page. As i'm also designing to cater for users with 800 x 600 browsers, i have split the menu into two lists, this way it'll...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.