Grow your CSS skills. Land your dream job.

CSS Code

Code:
body { font: 14px Georgia, serif; background: #28748c url(../images/bg.jpg) repeat-x; }

#page-wrap { width: 800px; margin: 10px auto; }
#main-content { background: rgba(255,255,255,1.0); padding: 20px; width: 760px; -moz-border-radius: 20px; -webkit-border-radius: 20px; border-radius: 20px; }
#logo { margin: 0 auto; text-align: center; }
a { text-decoration: none; }
ul { list-style: none; }
p { margin: 15px 0; }

/*
LEVEL ONE
*/
ul.dropdown { position: relative; }
ul.dropdown li { font-weight: bold; float: left; zoom: 1; background: #ccc; }
ul.dropdown a:hover { color: #000; }
ul.dropdown a:active { color: #ffa500; }
ul.dropdown li a { display: block; padding: 4px 8px; border-right: 1px solid #333;
color: #222; }
ul.dropdown li:last-child a { border-right: none; } /* Doesn’t work in IE */
ul.dropdown li.hover,
ul.dropdown li:hover { background: #F3D673; color: black; position: relative; }
ul.dropdown li.hover a { color: black; }

/*
LEVEL TWO
*/
ul.dropdown ul { width: 220px; visibility: hidden; position: absolute; top: 100%; left: 0; }
ul.dropdown ul li { font-weight: normal; background: #f6f6f6; color: #000;
border-bottom: 1px solid #ccc; float: none; }

/* IE 6 & 7 Needs Inline Block */
ul.dropdown ul li a { border-right: none; width: 100%; display: inline-block; }

/*
LEVEL THREE
*/
ul.dropdown ul ul { left: 100%; top: 0; }
ul.dropdown li:hover > ul { visibility: visible; }

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".