473,545 Members | 2,627 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Centered layout shifts

I have constructed a css stylesheet which has a centered layout. The
wrapper div is defined as 1000px. It contains a header div for the
entire wrapper width, and a left sidebar div and a content div on the
right. Everything appears as I would expect.

I have made a homepage with nothing in the content area, and another
page with the content filled so that the vertical scroll bar is
present.

When I'm in IE6 and go between the two pages, there is no apparent
shift of the wrapper and its contents. However, in Firefox and Opera,
the page with content shifts the entire wrapper over to the left of the
position it occupies when on the home page. It shifts by the width of
the vertical scroll bar. This doesn't look as "stable" as it does in
IE.

Is there any way to prevent this "shift" from occurring in FF and
Opera?
TIA Larzeb

CSS Stylesheet fragment:
#wrapper {
width: 1000px;
margin: 0 auto;
text-align: left;
position: relative;
}

#header {
width: 100%;
margin: 20px 0;
}
#sidebar {
width: 30%;
float: left;
}
#content {
width: 70%;
float: left;
}

Jun 13 '06 #1
3 2032
la********@yaho o.com wrote:
I have constructed a css stylesheet which has a centered layout. The
wrapper div is defined as 1000px. It contains a header div for the
entire wrapper width, and a left sidebar div and a content div on the
right. Everything appears as I would expect.
1000px? That won't fit in my browser window. Please see:
http://allmyfaqs.net/faq.pl?AnySizeDesign
I have made a homepage with nothing in the content area, and another
page with the content filled so that the vertical scroll bar is
present.

When I'm in IE6 and go between the two pages, there is no apparent
shift of the wrapper and its contents. However, in Firefox and Opera,
the page with content shifts the entire wrapper over to the left of
the position it occupies when on the home page. It shifts by the
width of the vertical scroll bar. This doesn't look as "stable" as it
does in IE.


Without the URL to your page, anything is a guess. Best guess, from your
CSS, is that the 70% plus the 30% plus margins and padding, and any
borders, adds up to more than 100%, and the real browsers adjust for
that. IE not included.

--
-bts
-Warning: I brake for lawn deer
Jun 13 '06 #2
la********@yaho o.com wrote:

When I'm in IE6 and go between the two pages, there is no apparent
shift of the wrapper and its contents. However, in Firefox and Opera,
the page with content shifts the entire wrapper over to the left of the
position it occupies when on the home page. It shifts by the width of
the vertical scroll bar. This doesn't look as "stable" as it does in
IE.

Is there any way to prevent this "shift" from occurring in FF and
Opera?

No.

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Jun 13 '06 #3
To further the education of mankind, la********@yaho o.com vouchsafed:
I have constructed a css stylesheet which has a centered layout. The
wrapper div is defined as 1000px. It contains a header div for the
entire wrapper width, and a left sidebar div and a content div on the
right. Everything appears as I would expect.

I have made a homepage with nothing in the content area, and another
page with the content filled so that the vertical scroll bar is
present.

When I'm in IE6 and go between the two pages, there is no apparent
shift of the wrapper and its contents. However, in Firefox and Opera,
the page with content shifts the entire wrapper over to the left of the
position it occupies when on the home page. It shifts by the width of
the vertical scroll bar. This doesn't look as "stable" as it does in
IE.
There's irony for ya...
Is there any way to prevent this "shift" from occurring in FF and
Opera?


It sounds like the browsers are just readjusting center for the scrollbar.
That's a gooooooood thing. If you want to eliminate this, you can do
something like setting the body-height to 110% (-with other relevant
styling) but, of course, you'll always have a scollbar.

--
Neredbojias
Infinity has its limits.
Jun 14 '06 #4

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

Similar topics

4
7941
by: metalseb | last post by:
Hi folks I built up a small website which is designed for 800x600 display. Runs just fine in this resolution but if you have a system in 1024 or 1280 pixels wide, the site just "sticks" in the upper-left corner of the browser window. So I'm trying to keep it horizontally centered whatever screen resolution you are set in. I do not want to...
7
10107
by: DaWoE | last post by:
Hi, I want to place a div centered of another div in IE. I get this to work in Mozilla, but not in IE. The code i use for mozilla is the following : <html> <head> <style type="text/css">
8
5102
by: Terry | last post by:
Trying my hand at table-less design. Looking for an XHTML 1.0 strict, CSS2 compliant solution. Here's the result I'm looking for: Div I: Some header text DIV II: Some text and a form which should be vertically centered Div III: Rest of content DIV II is the one I cannot resolve. It should span the whole page width, no matter the size of...
4
9722
by: Mimo Zus | last post by:
I'm hoping that someone can explain what's going on; better yet provide a workaround. I'm designing a centered CSS site based on a 550 pixel wide vertical background image. Onto this background I built a two column layout with nested navigation and content divs. The background image is centered via "background: ... center;", the divs are...
5
1852
by: Wilhelm Kutting | last post by:
Hi i want to use the following layout: ----------------- | | | | Text line 1 | | | Text line 2 | image.jpg | | ... | | | | | |
3
1458
by: Ernst | last post by:
I have a script for a menu. However, this menu uses absolute coordinates. This menu had to be placed on a website. This website is position (centered) using a table. How can I determine/calculate where to fix my menuregardless the browser, slidebar width, tool etc. Thanks Ernst
7
3246
by: Eric Lindsay | last post by:
I would like to do a photo gallery with a liquid layout. I wanted to center a caption below each photo (or above each photo). I can do that easily with tables, but then I don't have a liquid layout. Besides, I wanted to try to do it with CSS. I can do centered captions with text-align. This works provided the element containing each...
1
1475
by: hjc | last post by:
I have a repeating 1 pixel repeating image centered with css, then I have a column table with a top banner and a bottom banner giving the page a box effect. It is all centered and when I minimize the browser window the table shifts 1 or 2 pixels to the right giving the box effect not lined up.
9
2049
by: Chris Saunders | last post by:
This is not actually a C# question but I'm not sure which newsgroup is appropriate for this question. My apologies if I'm being "off-topic". I'm writing and application that has a group box that contains a bunch of radio buttons and wish to keep this group box and its buttons centered when the width of the window is changed. I do know...
0
7428
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7685
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, 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. ...
0
7784
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6014
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5354
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5071
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...
0
3485
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...
0
3467
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1039
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.