This is a discussion on "centering pages using position absolute" within the Web Page Design section. This forum, and the thread "centering pages using position absolute are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
centering pages using position absolute
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
centering pages using position absolute
Hi,
I'm implementing a website at the moment and I have incoporated css as documented in the following article... http://scott.sauyet.com/CSS/Demo/FooterDemo2.html This bascially creates a footer that sits on the bottom of the page if there isn't enough content to fill it up, but also allows for expansion in larger pages. It uses some IE hacks and requires a 'containing' div to be positioned absolutely. However, I'm finding it difficult to center my pages in the usual way in both Firefox and IE6. By the usual way I mean something like...
Damian Last edited by karinne; Aug 29th, 2007 at 15:44. Reason: Please use [ code ]...[ /code ] tags when displaying code. |
|
|
|
||||
|
Re: centering pages using position absolute
Are you trying to do vertical or horizontal centering or both?
Vert + Hor centering is actually quite simple. http://www.sabordesign.com/css_layou...al%20Centered/
Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
|
|
|||
|
Re: centering pages using position absolute
I have already tried something similar to this and it doesn't work: as the client width is reduced past 780px the side main content container of the site (the centred div element) moves beyond the edge of the window so I slowly loose my side bar.
I have found a forum post in another forum that has solved my problem for FireFox but it doesn't work for IE. Have a look at this as it sums up my problem probably better than I could... http://forums.sixapart.com/index.php...r&f=14&t=63217 This solution puts everything inside another container, called here div#overall, which then uses position:relative and the margin:auto rules. This works perfectly for FF but I'm thinking there could be some CSS expression that would work with this solution to fix IE. Here is a copy of some of my relevant code... [Note the CSS expression in here is schematic and results in the same problem as when using the solution you quoted in the last post. I was thinking if there is a way of altering this expression so that any negative values px are converted to 0px but I don't know if there is a function to do this or if it can be expressed inline].
Damian Last edited by karinne; Aug 29th, 2007 at 15:44. Reason: Please use [ code ]...[ /code ] tags when displaying code. |
|
||||
|
Re: centering pages using position absolute
Dunno man, the link I gave you works in everything. What exactly are you trying to accomplish? There are methods for sticky footers and such in this forum as well.
Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
|
|
|||
|
Re: centering pages using position absolute
Have a look at the example you quoted above and reduce the browser width to less than 600px (the width of the box). As you reduce the browser, the box will start disappearing into the left. In short, instead of this happening, I want the box to stay at left margin 0px of the window.
The position absolute and sticky footers might be the problem, but I have the solution for FF but not for IE. If there is a sticky footer solution that doesn't require a position absolute in a #container div that would be good. |
|
|||
|
Re: centering pages using position absolute
Well my box is 780px and we have lots of myopic nutters here who love to use low res monitors as if they were PDA's.
Sorry this quite particular! |
![]() |
| Tags |
| positionabsolute css |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ie6 absolute div problem | bilsland | Web Page Design | 1 | Apr 29th, 2008 12:43 |
| When is it ok to use Absolute Positioning ?? | slimboyfatz32 | Web Page Design | 31 | Feb 6th, 2008 17:25 |
| Javascript - Updating web pages with snippets from other pages | Ydot | JavaScript Forum | 3 | Jul 10th, 2007 14:38 |
| position:absolute; qustion | geoffmuskett | Web Page Design | 2 | Dec 1st, 2006 22:02 |
| Scripting Needed(adding pages to pages) | Amari | Classic ASP | 1 | Sep 4th, 2004 18:06 |