Full width and height link

This week I read a topic on the swedish webrelated forum Webmaster Network where a memeber asked how to create a link behind his content on the page.


I had some time to spare and made an example, since I haven’t done anything like that before. Although at the moment I’m not sure how to use the code. Maybe if you are going to have a “banner” behind all your content or some kind of stylesheet-switching.

The code is actually really simple, use 100% height and width on the html and body, a div with z-index:1; that’s positioned absolutely containing a link with full height and width and then another div positioned relatively with z-index:2; that is placed over the link.

Here is two examples:
http://magnusforsberg.com/demos/full-height.html
http://magnusforsberg.com/demos/full-height-link.html


About this entry