Hi Georg,

It took some working out as it does not work with an anchor, you need a div
Then if the height of the header is 50px then the div style should be
margin-top: -50px; height: 50px; width: 1px; it then goes fine for right at
the top. By increasing both values you can bring the anchor point down a bit
which is good.

Thanks for that.

Nic



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Gunlaug Sørtun
Sent: 20 June 2008 18:24
To: [EMAIL PROTECTED]
Cc: [email protected]
Subject: Re: [css-d] Fixed div and Anchors

Nic Pulford wrote:
> Some time ago, about a year I think, there was some discussion about
>  using fixed divs to fix a header at the top of the page and allow
> the main content to scroll under it, this requires a spacer at the
> top of the content to make the viewable start of the page below the
> header. The problem comes when the site uses anchors the browsers of
> course make sure the anchor is at the top of the page, which is under
> the header. Is there a good solution to making the anchor appear so
> you can see it.

I've solved the problem in one particular case [on CSS-D] by styling the
anchor with an invisible top-extension - 1px wide and as tall as the
fixed header + the part you want to see. That'll let the browsers align
the anchor at the top and keep the relevant content down where it's visible.
I can probably dig up my local demo-case again (one day) if necessary,
but it shouldn't be too hard to style an in-page anchor to achieve such
an offset effect.

(I prefer fixed footers and sidebars myself, so I don't run into the
problem.)

regards
        Georg
-- 
http://www.gunlaug.no
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to