From d810c37b68693e66a7e2ee3c9377c1906b5a2ae8 Mon Sep 17 00:00:00 2001 From: Joris Guyonvarch Date: Thu, 12 Mar 2015 22:49:06 +0100 Subject: Adding color transition on menu links --- menu.css | 72 ++++++++++++++++++++++++++++++---------------------------------- 1 file changed, 34 insertions(+), 38 deletions(-) (limited to 'menu.css') diff --git a/menu.css b/menu.css index 51d777c..972629d 100644 --- a/menu.css +++ b/menu.css @@ -1,39 +1,18 @@ nav { position: relative; + font-family: NothingYouCouldSay; + font-size: 21px; z-index: 1; } -nav > ul { - width: 900px; - display: table; - table-layout: fixed; -} - -nav ul ul { - display: none; -} - -nav > ul > li > a { - margin-left: 1px; - margin-right: 1px; -} - -nav li:hover > ul { - display: block; -} - nav ul { position: absolute; - font-family: NothingYouCouldSay; - font-size: 21px; -} - -nav li:hover > a { - background-color: #777777; } -nav li:hover ul a { - background-color: #EEEEEE; +nav > ul { + width: 900px; + display: table; + table-layout: fixed; } nav li { @@ -47,33 +26,50 @@ nav li:before { margin-left: 0px !important; } +nav ul ul li { + display: block; + float: none; + min-width: 150px; +} + nav a { - height: 50px; - line-height: 50px; text-align: center; color: white; text-decoration: none; display: block; + margin-left: 1px; + margin-right: 1px; +} + +nav > ul > li > a { + height: 50px; + line-height: 50px; background-color: #333333; } -nav ul ul li { - display: block; - float: none; - min-width: 150px; - margin-left: 1px; - margin-right: 1px; +nav > ul > li:hover > a { + background-color: #777777; } nav ul ul a { + background-color: #EEEEEE; + visibility: hidden; + opacity: 0; + height: 0px; + line-height: 21px; padding: 0 20px; color: black; } -nav a:hover { - color: white; +nav ul li:hover a { + visibility: visible; + opacity: 1; + height: 50px; + line-height: 50px; } -nav ul ul a:hover { +nav a:hover { + transition: all 0.2s ease; background-color: #777777; + color: white; } -- cgit v1.2.3