HighDots Forums  

Holy Grail 3-column layout and internal anchors

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Holy Grail 3-column layout and internal anchors in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Harlan Messinger
 
Posts: n/a

Default Holy Grail 3-column layout and internal anchors - 01-13-2009 , 07:11 AM






I used the methods described in the A List Apart article "In Search of
the Holy Grail" (http://www.alistapart.com/articles/holygrail/) on a
website, duplicating its few IE6 hacks to cover IE7, and have been
pleased with the result until making one odd discovery.

A sample page is at http://www.gavelcade.com/grail-example.html. The
information on the page is preceded by a set of internal links to each
of the informational sections. In Firefox 3 on Windows, clicking one of
these links shifts the page down so that the link's destination as at
the top of the viewport. Click "Employee Rewards", for example. All well
and good. But from there, scroll up just a couple of ticks (click the
arrow at the top of the scroll bar a couple of times or hit the Up key
twice). You can see that the page's banner and navigation didn't scroll
up as far as the content of the middle column--it's located right above
the top of the viewport. The content above the Employee Rewards section
has slid up underneath the banner! If you jump to the bottom of the
page, you can see that there is a lot of blank space at the bottom of
the middle column, where there hadn't been originally. So what's really
happening is that the *text* is sliding up correctly when the link is
clicked, but all the divs that divide up the page slide up only far
enough to put the banner and navigation out of view.

Another oddity is that if, after clicking one of the links, you click
the Back button, the same thing happens--even that doesn't restore the
original state.

If you shift-Tab, *then* the hidden content begins to scroll into view,
as you navigate backward through the list of links.

IE7 also gets this wrong, but in a different way. After you click one of
the links, the scrollbar continues to appear scrolled all the way to the
top. Hitting the Back button does nothing. If you scroll down, you can
see a large chunk of white space that hadn't been there when the page
was originally displayed. However, if you hold the mouse button down
somewhere in the main text and drag the cursor upward, *then* the page
will scroll upward and the content will come into view.

Any comments on why this happens and whether there is any way to fix it?

Reply With Quote
  #2  
Old   
Bergamot
 
Posts: n/a

Default Re: Holy Grail 3-column layout and internal anchors - 01-13-2009 , 09:52 AM







Harlan Messinger wrote:
Quote:
I used the methods described in the A List Apart article "In Search of
the Holy Grail" (http://www.alistapart.com/articles/holygrail/)
FWIW, I don't believe there is a 'holy grail' of columned layouts. I
take most things at ALA with a large grain of salt, anyway.

Quote:
A sample page is at http://www.gavelcade.com/grail-example.html.
Click "Employee Rewards", for example. All well
and good. But from there, scroll up just a couple of ticks (click the
arrow at the top of the scroll bar a couple of times or hit the Up key
twice). You can see that the page's banner and navigation didn't scroll
up as far as the content of the middle column--it's located right above
the top of the viewport. The content above the Employee Rewards section
has slid up underneath the banner!
The first thing I'd look for is overflow:hidden. Get Firebug if you
don't already have it. It might not explain why the phenomenon happens,
but should at least point to the relevant rules.

Quote:
If you jump to the bottom of the
page, you can see that there is a lot of blank space at the bottom of
the middle column, where there hadn't been originally.
This looks suspicious:
padding-bottom: 1000em;
margin-bottom: -1000em;

Is 1000em magic in some way?

Quote:
Any comments on why this happens and whether there is any way to fix it?
I'd fix it by using a different method for 3 equal columns. I'm partial
to the Ruthsarian layouts myself, but much simplified. Example:
http://www.bergamotus.ws/samples/3column-stretch-with-borders.html

BTW, I am not opposed to hacks, but use them as sparingly as possible.

--
Berg


Reply With Quote
  #3  
Old   
Harlan Messinger
 
Posts: n/a

Default Re: Holy Grail 3-column layout and internal anchors - 01-13-2009 , 11:51 AM



Bergamot wrote:
Quote:
Harlan Messinger wrote:
I used the methods described in the A List Apart article "In Search of
the Holy Grail" (http://www.alistapart.com/articles/holygrail/)

FWIW, I don't believe there is a 'holy grail' of columned layouts. I
take most things at ALA with a large grain of salt, anyway.

A sample page is at http://www.gavelcade.com/grail-example.html.
Click "Employee Rewards", for example. All well
and good. But from there, scroll up just a couple of ticks (click the
arrow at the top of the scroll bar a couple of times or hit the Up key
twice). You can see that the page's banner and navigation didn't
scroll up as far as the content of the middle column--it's located
right above the top of the viewport. The content above the Employee
Rewards section has slid up underneath the banner!

The first thing I'd look for is overflow:hidden. Get Firebug if you
don't already have it. It might not explain why the phenomenon happens,
but should at least point to the relevant rules.

If you jump to the bottom of the page, you can see that there is a lot
of blank space at the bottom of the middle column, where there hadn't
been originally.

This looks suspicious:
padding-bottom: 1000em;
margin-bottom: -1000em;

Is 1000em magic in some way?
The purpose of that is to get each column's background color to continue
all the way down to the bottom of the div that contains all three
columns, without continuing below that div. You can see the additional
hack needed to get this to work in IE.

Quote:
Any comments on why this happens and whether there is any way to fix it?

I'd fix it by using a different method for 3 equal columns. I'm partial
to the Ruthsarian layouts myself, but much simplified. Example:
http://www.bergamotus.ws/samples/3column-stretch-with-borders.html

BTW, I am not opposed to hacks, but use them as sparingly as possible.
Agreed.



Reply With Quote
  #4  
Old   
Eric Lindsay
 
Posts: n/a

Default Re: Holy Grail 3-column layout and internal anchors - 01-13-2009 , 01:52 PM



In article <6t3eo5F8vu9dU1 (AT) mid (DOT) individual.net>,
Harlan Messinger <hmessinger.removethis (AT) comcast (DOT) net> wrote:

Quote:
I used the methods described in the A List Apart article "In Search of
the Holy Grail" (http://www.alistapart.com/articles/holygrail/) on a
website, duplicating its few IE6 hacks to cover IE7, and have been
pleased with the result until making one odd discovery.

A sample page is at http://www.gavelcade.com/grail-example.html. The
information on the page is preceded by a set of internal links to each
of the informational sections. In Firefox 3 on Windows, clicking one of
these links shifts the page down so that the link's destination as at
the top of the viewport. Click "Employee Rewards", for example. All well
and good. But from there, scroll up just a couple of ticks (click the
arrow at the top of the scroll bar a couple of times or hit the Up key
twice). You can see that the page's banner and navigation didn't scroll
up as far as the content of the middle column--it's located right above
the top of the viewport. The content above the Employee Rewards section
has slid up underneath the banner! If you jump to the bottom of the
page, you can see that there is a lot of blank space at the bottom of
the middle column, where there hadn't been originally. So what's really
happening is that the *text* is sliding up correctly when the link is
clicked, but all the divs that divide up the page slide up only far
enough to put the banner and navigation out of view.
Similar result in Safari 3.2.1 on Macintosh.

Quote:
Another oddity is that if, after clicking one of the links, you click
the Back button, the same thing happens--even that doesn't restore the
original state.
Back button does not restore (refreshing page does). No obvious visual
way to get back to original internal menu at that point.

Quote:
If you shift-Tab, *then* the hidden content begins to scroll into view,
as you navigate backward through the list of links.
Option Tab allows navigation through the internal links, and viewing
hidden content.

I remain suspicious of some of those negative margin bottoms. However I
forget why I never found the HolyGrail layout suitable. I am sure I
tried it, way back.

--
http://www.ericlindsay.com


Reply With Quote
  #5  
Old   
Bergamot
 
Posts: n/a

Default Re: Holy Grail 3-column layout and internal anchors - 01-13-2009 , 03:07 PM




Harlan Messinger wrote:
Quote:
Bergamot wrote:
Harlan Messinger wrote:

http://www.gavelcade.com/grail-example.html.

This looks suspicious:
padding-bottom: 1000em;
margin-bottom: -1000em;

Is 1000em magic in some way?

The purpose of that is to get each column's background color to continue
all the way down to the bottom of the div that contains all three
columns, without continuing below that div.
I read the "logic" behind this over at
http://www.positioniseverything.net/articles/onetruelayout/equalheight

Sounds like voodoo to me. I'll pass.

--
Berg


Reply With Quote
  #6  
Old   
Norman Peelman
 
Posts: n/a

Default Re: Holy Grail 3-column layout and internal anchors - 01-13-2009 , 07:18 PM



Harlan Messinger wrote:
Quote:
I used the methods described in the A List Apart article "In Search of
the Holy Grail" (http://www.alistapart.com/articles/holygrail/) on a
website, duplicating its few IE6 hacks to cover IE7, and have been
pleased with the result until making one odd discovery.

A sample page is at http://www.gavelcade.com/grail-example.html. The
information on the page is preceded by a set of internal links to each
of the informational sections. In Firefox 3 on Windows, clicking one of
these links shifts the page down so that the link's destination as at
the top of the viewport. Click "Employee Rewards", for example. All well
and good. But from there, scroll up just a couple of ticks (click the
arrow at the top of the scroll bar a couple of times or hit the Up key
twice). You can see that the page's banner and navigation didn't scroll
up as far as the content of the middle column--it's located right above
the top of the viewport. The content above the Employee Rewards section
has slid up underneath the banner! If you jump to the bottom of the
page, you can see that there is a lot of blank space at the bottom of
the middle column, where there hadn't been originally. So what's really
happening is that the *text* is sliding up correctly when the link is
clicked, but all the divs that divide up the page slide up only far
enough to put the banner and navigation out of view.

Another oddity is that if, after clicking one of the links, you click
the Back button, the same thing happens--even that doesn't restore the
original state.

If you shift-Tab, *then* the hidden content begins to scroll into view,
as you navigate backward through the list of links.

IE7 also gets this wrong, but in a different way. After you click one of
the links, the scrollbar continues to appear scrolled all the way to the
top. Hitting the Back button does nothing. If you scroll down, you can
see a large chunk of white space that hadn't been there when the page
was originally displayed. However, if you hold the mouse button down
somewhere in the main text and drag the cursor upward, *then* the page
will scroll upward and the content will come into view.

Any comments on why this happens and whether there is any way to fix it?
Have you looked at:

http://matthewjamestaylor.com/

It's what i'm using now.


--
Norman
Registered Linux user #461062


Reply With Quote
  #7  
Old   
dorayme
 
Posts: n/a

Default Re: Holy Grail 3-column layout and internal anchors - 01-13-2009 , 09:46 PM



In article <6t3eo5F8vu9dU1 (AT) mid (DOT) individual.net>,
Harlan Messinger <hmessinger.removethis (AT) comcast (DOT) net> wrote:

Quote:
I used the methods described in the A List Apart article "In Search of
the Holy Grail" (http://www.alistapart.com/articles/holygrail/) on a
website, duplicating its few IE6 hacks to cover IE7, and have been
pleased with the result until making one odd discovery.

A sample page is at http://www.gavelcade.com/grail-example.html. The
information on the page is preceded by a set of internal links to each
The phenomenon you are seeing does not happen when following the
template more exactly.

If you substitute your middle content for the author's at

<http://www.alistapart.com/d/holygrail/example_1.html>

and get to the subsequent:

<http://www.alistapart.com/d/holygrail/example_1.html#plan529>

[latter is no functioning URL till you put in your content...]

you will see it functions as expected.

(btw, I thought the idea of a holy grail included full length cols (but
the side cols are content dependent in terms of background colour).

I make this reply to you in case it helps stops you throwing away the
whole idea in disgust. You might need to carefully start from it again
and test at each stage of your build for the irregularity you have seen.

(btw, is it the case that your pages on this site invariably have longer
content columns? If so we might be better off forgetting holy grails and
go for numerous practical grails...)

--
dorayme


Reply With Quote
  #8  
Old   
dorayme
 
Posts: n/a

Default Re: Holy Grail 3-column layout and internal anchors - 01-14-2009 , 04:01 AM



In article <doraymeRidThis-C86784.13462014012009 (AT) news (DOT) albasani.net>,
dorayme <doraymeRidThis (AT) optusnet (DOT) com.au> wrote:

Quote:
In article <6t3eo5F8vu9dU1 (AT) mid (DOT) individual.net>,
Harlan Messinger <hmessinger.removethis (AT) comcast (DOT) net> wrote:

I used the methods described in the A List Apart article "In Search of
the Holy Grail" (http://www.alistapart.com/articles/holygrail/) on a
website, duplicating its few IE6 hacks to cover IE7, and have been
pleased with the result until making one odd discovery.

A sample page is at http://www.gavelcade.com/grail-example.html. The
information on the page is preceded by a set of internal links to each

The phenomenon you are seeing does not happen when following the
template more exactly.

If you substitute your middle content for the author's at

http://www.alistapart.com/d/holygrail/example_1.html

and get to the subsequent:

http://www.alistapart.com/d/holygrail/example_1.html#plan529

[latter is no functioning URL till you put in your content...]

you will see it functions as expected.

(btw, I thought the idea of a holy grail included full length cols (but
the side cols are content dependent in terms of background colour).

I make this reply to you in case it helps stops you throwing away the
whole idea in disgust. You might need to carefully start from it again
and test at each stage of your build for the irregularity you have seen.

(btw, is it the case that your pages on this site invariably have longer
content columns? If so we might be better off forgetting holy grails and
go for numerous practical grails...)
I had time to take another quick look tonight and I better say now that
the author of your template, provided - as you would know - for full
length cols.

However, his recommended solution to get these full columns is what
*alone* triggers your problem:

#container {
overflow: hidden;
}
#container .column {
padding-bottom: 20010px; /* X + padding-bottom */
margin-bottom: -20000px; /* X */
}
#footer {
position: relative;
}


You get to see your content again by overflow: auto; but no one will
like this!

Suggest you forget all this last trickery (the last few lines of CSS
above) and substitute more transparent trickery, namely just:

Make background to body something like:

background: #66F url("http://netweaver.com.au/alt/pics/orange.png") 100%
0 repeat-y;}

just one 'lil 'ol faux col positioned, the body background taking care
of left col. You have a min width set, it should be fine.

Anyway, that is latest thought. And it does not have the unwanted effect
you are seeing.

It's probably got some other unwanted side effect I am missing? <g>

--
dorayme


Reply With Quote
  #9  
Old   
Harlan Messinger
 
Posts: n/a

Default Re: Holy Grail 3-column layout and internal anchors - 01-15-2009 , 04:21 PM



Norman Peelman wrote:
Quote:
Harlan Messinger wrote:
I used the methods described in the A List Apart article "In Search of
the Holy Grail" (http://www.alistapart.com/articles/holygrail/) on a
website, duplicating its few IE6 hacks to cover IE7, and have been
pleased with the result until making one odd discovery.

A sample page is at http://www.gavelcade.com/grail-example.html. The
information on the page is preceded by a set of internal links to each
of the informational sections. In Firefox 3 on Windows, clicking one
of these links shifts the page down so that the link's destination as
at the top of the viewport. Click "Employee Rewards", for example. All
well and good. But from there, scroll up just a couple of ticks (click
the arrow at the top of the scroll bar a couple of times or hit the Up
key twice). You can see that the page's banner and navigation didn't
scroll up as far as the content of the middle column--it's located
right above the top of the viewport. The content above the Employee
Rewards section has slid up underneath the banner! If you jump to the
bottom of the page, you can see that there is a lot of blank space at
the bottom of the middle column, where there hadn't been originally.
So what's really happening is that the *text* is sliding up correctly
when the link is clicked, but all the divs that divide up the page
slide up only far enough to put the banner and navigation out of view.

Another oddity is that if, after clicking one of the links, you click
the Back button, the same thing happens--even that doesn't restore the
original state.

If you shift-Tab, *then* the hidden content begins to scroll into
view, as you navigate backward through the list of links.

IE7 also gets this wrong, but in a different way. After you click one
of the links, the scrollbar continues to appear scrolled all the way
to the top. Hitting the Back button does nothing. If you scroll down,
you can see a large chunk of white space that hadn't been there when
the page was originally displayed. However, if you hold the mouse
button down somewhere in the main text and drag the cursor upward,
*then* the page will scroll upward and the content will come into view.

Any comments on why this happens and whether there is any way to fix it?

Have you looked at:

http://matthewjamestaylor.com/

It's what i'm using now.
Ah, thanks. Evidently he's been tinkering with it, and he's produced
this updated arrangement with pixel-width left and right columns and
unspecified-width center column:

http://matthewjamestaylor.com/blog/ultimate-3-column-holy-grail-ems.htm

I copied it and stuck my main content, with the links, into the center
column. It works. So let me incorporate this CSS into my page and see
what happens.

Thanks to all who replied.


Reply With Quote
  #10  
Old   
David Stone
 
Posts: n/a

Default Re: Holy Grail 3-column layout and internal anchors - 01-16-2009 , 08:45 AM



In article <6t9nlsF9v8kdU1 (AT) mid (DOT) individual.net>,
Harlan Messinger <hmessinger.removethis (AT) comcast (DOT) net> wrote:
[snip]
Quote:
Ah, thanks. Evidently he's been tinkering with it, and he's produced
this updated arrangement with pixel-width left and right columns and
unspecified-width center column:

http://matthewjamestaylor.com/blog/ultimate-3-column-holy-grail-ems.htm
Now that looks nice! I took a quick look at the code, but don't have
time for detailed study - did anyone notice if there is anything in
there that wouldn't work HTML 4.01 strict (other than obvious changes
to closing tag format)?


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.