Hi have tested this with FF / Opera / Chrome / IE8
Was wondering if anyone could test in IE 6 to make sure that it works ? what it is is that I am trying to not use any javascript and only CSS to make a hidden area come to shown once the user hovers over the link.. I am using ul and li and div to achieve this.
Here is the code.
if I am doing this wrong any advice would be great.. else if someone could check in IE 6 that would be greatCode:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>CSS - show/hide on hover</title> <style type="text/css"> /* the main ul block, there is no list style at all e.g. all together */ #showhideblock { list-style:none; margin:0; padding:0; } /* the main ul block elements push to the left and make there display inline e.g. no breaks */ #showhideblock li { float:left; width:200px; height:55px; display:inline; border:1px solid black; } /* the basic showing element of the list */ #showhideblock li .show{ display:block; width:200px; height:55px; } /* hide the hiding element of the list with the height of 0 and overflow set to hidden */ /* but once shown display in black */ #showhideblock li .hide { color : black; height: 0; /* hide the .hide element */ overflow: hidden; background:black; } /* when you hover over the shown element, set the hidden element sizes */ #showhideblock li:hover .hide, #showhideblock li.over .hide { height: 55px; width: 200px; } /* when you hover over the shown element set the shown element height and overflow values */ #showhideblock li:hover .show, #showhideblock li.over .show { height: 0; overflow: hidden; } /* set the show a href links to colour of black (on the white background of the shown element */ /* and the textual size to be bigger than normal */ #showhideblock li a { color:black; font-size:1.5em; } /* since changing the background colour of the hidden element to black, change the on hover */ /* to have a textual colour of white */ #showhideblock li a:hover { color:white; } </style> </head> <body> <ul id="showhideblock"> <li> <a class="show" href="#" title="The image to show">Hover over me, what has been hidden ?</a> <div class="hide"> <a href="#" title="the hidden link">Codingfriends - I was hidden here all along</a> </div> </li> </ul> </body> </html>.
CodingfriendsCode:int coffeePerDay = 10; // need to cut down!!!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks