Thread: Cynthia
View Single Post
  #16 (permalink)  
Old Sep 27th, 2007, 14:38
MikeHopley MikeHopley is offline
SuperMember

SuperMember
Join Date: May 2007
Location: UK
Age: 27
Posts: 1,111
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Cynthia

Quote:
Originally Posted by welshstew View Post
But without the display: none; won't the browser assign some "space" to the div, even though the text is off screen?
You can use absolute positioning instead. This removes the element completely from the visual formatting "flow"; it is positioned independently (in its own "layer"):

Code: Select all
ul#skipLinks {
position:absolute;
top: -100em;
z-index: 2;
}
...and then override this by moving the links back into view when they receive focus. This way, people using a visual browser can still use them as keyboard navigation (although most won't realise they exist, of course). You need to make sure they stand out against the background after positioning. Here's my code:

Code: Select all
ul.skipLinks a:focus {
    position: absolute;
    top: 5.5em;
    color: black;
    background: yellow;
    border: 2px solid red;
    font-size: 200%;
    padding: 0.5em;
}
Who knows? It might help some users of visual browsers, especially if you explain this feature somewhere on your site.

Last edited by MikeHopley; Sep 27th, 2007 at 14:42.
Reply With Quote