473,553 Members | 2,899 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

having something in the middle of the screen.....


I would like to position a site in the "middle" of the screen, both
horizontally and vertically.

I would do this by having a "wrapper" div with

left: 50%;
top: 50%;
margin-top: - [half the height];
margin-left: - [half the width];

This works fine, EXCEPT when the browser viewable area is smaller than
the width or the height of the wrapper. In this case, what I would
like to happen is that the wrappers sits against the top or the left
of the viewable area and that a scrollbar helps the user to see the
parts of the screen that are cut off.....

In the old days, with tables, you could achieve just this by having a
table as wrapper. The code goes something like this:

<table width="100%" height="100%">
<tr valign="middle" >
<td align="center">
inner div with your actual website.....

How can I achieve the ideas above without using a table???? or should
I just use a table.

Thank you

Jul 21 '07 #1
2 3196
Ben C wrote:
position: absolute;
left: 0; right: 0; top: 0; bottom: 0;
Note that IE doesn't grok this. IE6 doesn't for sure. I don't know if it
was fixed in IE7, but I suspect not.

Jul 21 '07 #2
On Jul 21, 11:31 pm, Bergamot <berga...@visi. comwrote:
Ben C wrote:
position: absolute;
left: 0; right: 0; top: 0; bottom: 0;

Note that IE doesn't grok this. IE6 doesn't for sure. I don't know if it
was fixed in IE7, but I suspect not.


Thanks for all your replies. I get the feeling that basically, the
best solution is to keep using the old table system, because if IE6
does not support it then you can't really use it yet - right?

Thank again for all your replies.


Jul 21 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Tim Streater | last post by:
I want to generate a web page using PHP, and in the middle generate a graphic I read from another server. So the graphic is in $picture. So I can either write $picture to a temp file and then use an ordinary <img src=filename> to get the browser to display it, or output it by itself in a new page, because then I have a chance to output the...
by: luke | last post by:
I need to have two different backgrounds, one on the left and one on the right of the screen, with the main content centered in the browser. This is the code I have come up with <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td width="49%" background="left.gif"><img src="shim.gif" alt="" height="1" width="1"></td>...
by: xtra | last post by:
Hi Folk I am wondering if it is possible to put a form in the middle of the screen. That is, my form is about 20cms wide by 11 cms high, but my screen is much wider and higher, so I was wondering if it possible to put it in the middle of my screen. Any ideas?
by: JasonP | last post by:
Hi, I am trying to decide the best middle tier method for the system I am currently building. There are no issues of supporting previous software versions, etc as this is a completely new company. The company in question currently has 10 client pcs (which is likely to grow rapidly), each of which will need to get some data from a...
by: Vmz | last post by:
HI, I got two queues, I need to write void function that would check both queues and remove from first queue all nodes that matches second queue. Each node has two pointers that shows to previous and next nodes. Here is what i got so far: void check(queue que1, queue que2) { node *temp temp->next = Galimos.Pirmas; for(;que1.First !=...
by: Jordi Rico | last post by:
Hi, I'm creating an UserControl, a kind of a datagrid. By now, i've been able to implement mousewheel events, so I can move the scrollbars when the app detects this event. Now i want to add some other functionality which I don't find anywhere how to do. It's simple, in many programs, you click the mousewheel (middle button) and appears an...
by: den | last post by:
if I want to open a popup at middle of screen in some example I see that is used also Math.round; is obligatory? there are situation where the result of screen/2 if isn¢t an integer can to cause prolems?
by: rsteph | last post by:
I've got a new site I'm working on. I'd like to give it the appearance that the page is centered in the middle of the screen, with white space on either side. Can anyone help me on how to handle this through the .css page? Any help would be greatly appreciated. Here's a link to the site: http://www.atlashvac.com/comfortteam/index.asp here's...
by: CD Tom | last post by:
Why is it that on laptops with wide screens that my application screens show up on the right side of the screen and the user has to drag the screen into the middle. Is there a way to make the screen always show up in the middle of the screen? Thanks for any help.
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.