How to make navigation hover as background - css

I am UI UX Designer and big learner of CSS and HTML5, I am doing some practice but stuck in one thing:
Here is the screenshot I wish to build:
http://goo.gl/RK5i0y
(the mouse over effect)
HTML
<nav>
<ul>
<li>Home</li>
<li>Our Company</li>
<li>Services</li>
<li>Contact Us</li>
</ul>
</nav>
CSS
nav ul {
margin-top: 60px;
padding: 0;
float: right;
text-transform: uppercase;
}
nav ul li {
list-style: none;
float: left;
font-size:15px;
padding-right:57px;
}
header nav ul li a {
display: block;
color: #fff;
text-decoration: none;
/*font-weight: bold;*/
/*padding-right: 57px;*/
}
header nav ul li a:hover {
background: #00335a;
}
header nav ul li a:active {
-webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.8) inset;
-moz-box-shadow: 0 0 5px rgba(0, 0, 0, 0.8) inset;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.8) inset;
}

How about this?
nav {
height: 160px;
background: linear-gradient(to bottom, #015190 0%,#014073 100%);
}
nav ul {
margin-top: 60px;
padding: 0;
float: right;
text-transform: uppercase;
}
nav ul li {
list-style: none;
float: left;
font-size:15px;
padding-right:30px;
}
nav ul li a {
display: block;
color: #fff;
text-decoration: none;
line-height: 40px;
padding: 0 20px;
font-weight: bold;
}
nav ul li a:hover {
background: linear-gradient(to bottom, #003e6d 0%,#003257 100%);
border-radius: 3px;
}

Please check this Fiddle: Demo
nav ul {
margin-top: 60px;
padding: 0;
float: right;
text-transform: uppercase;
}
nav ul li {
list-style: none;
float: left;
font-size:15px;
padding-right:57px;
}
nav ul li a {
display: block;
color: #000;
text-decoration: none;
padding: 10px;
/*font-weight: bold;*/
/*padding-right: 57px;*/
}
nav ul li a:hover {
background: #00335a;
color: #fff;
}
header nav ul li a:active {
-webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.8) inset;
-moz-box-shadow: 0 0 5px rgba(0, 0, 0, 0.8) inset;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.8) inset;
}

Tinkerd with the previous one from ajc, jsfiddle.net/UypRf/16/ hope this give some better insight

I changed the code a little, but this script generates a navbar very much like your example picture:
HTML
<div class="header">
<img src="http://us.123rf.com/400wm/400/400/antoshkaforever/antoshkaforever1105/antoshkaforever110500039/9458039-template-to-mark-the-company-put-your-company-name-rather-than-text.jpg">
<div class="nav">
<ul>
<li>Home</li>
<li>Our Company</li>
<li>Services</li>
<li>Contact Us</li>
</ul>
</div>
</div>
CSS
body{
margin:0px;padding:0px;
}
div.header{
width:100%;
height:200px;
background-color: #444444;
background-image: -webkit-gradient(linear, left top, left bottom, from(#000099), to(#0000AA)); /* Chrome, Safari 4+ */
background-image: -webkit-linear-gradient(top, #444444, #999999); /* Chrome 10-25, iOS 5+, Safari 5.1+ */
background-image: -moz-linear-gradient(top, #444444, #999999); /* Firefox 3.6-15 */
background-image: -o-linear-gradient(top, #444444, #999999); /* Opera 11.10-12.00*/
background-image: linear-gradient(to bottom, #335599, #224477); /* Chrome 26, Firefox 16+, IE 10+, Opera 12.10+ */
}
div.header img{
margin:25px 5px;
max-height:150px;
}
div.header div.nav{
float:right;
margin-top:60px;
}
ul{
list-style-type:none;
margin:0;
padding:0;
overflow:hidden;
}
li
{
float:left;
}
a:link,a:visited{
font-family:Helvetica;
display:block;
color:#FFFFFF;
text-align:center;
padding:10px 20px;
text-decoration:none;
text-transform:uppercase;
}
a:hover,a:active
{
background-color:#223366;
}

Related

Menu with buttons on left and right

I know this is a pretty stupid question, but I'm struggling to get this working and no success so far. I made a CSS menu using one online website that generate it for free. So the first challenge was to put some icons before each option, this one I got success. But now, I want to put some buttons on the right side. Let-me show you the css code for the menu:
#charset 'UTF-8';
/* Starter CSS for Flyout Menu */
#cssmenu,
#cssmenu ul,
#cssmenu li #cssmenu a {
list-style: none;
margin: 0;
padding: 0;
border: 0;
font-size: 14px;
font-family: Helvetica;
line-height: 1;
}
#cssmenu {
width: auto;
}
#cssmenu ul {
zoom: 1;
background: #547a65 url(/img/pattern.png) top left repeat;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
border: 1px solid #354d3f;
-moz-box-shadow: 0 3px 3px rgba(0, 0, 0, 0.3);
-webkit-box-shadow: 0 3px 3px rgba(0, 0, 0, 0.3);
box-shadow: 0 3px 3px rgba(0, 0, 0, 0.3);
}
#cssmenu ul:before {
content: '';
display: block;
}
#cssmenu ul:after {
content: '';
display: table;
clear: both;
}
#cssmenu a,
#cssmenu a:link,
#cssmenu a:visited {
padding: 15px 20px;
display: block;
text-decoration: none;
color: #ffffff;
text-shadow: 0 -1px 1px #161f1a;
border-right: 1px solid #354d3f;
}
#cssmenu a:hover {
color: #161f1a;
text-shadow: 0 1px 1px #69987e;
}
#cssmenu li {
float: left;
border-right: 1px solid #5e8972;
}
#cssmenu li:hover {
background: #4a6b58 url(/img/pattern.png) top left repeat;
}
#cssmenu li:first-child {
border-left: none;
-webkit-border-radius: 4px 0 0 4px;
-moz-border-radius: 4px 0 0 4px;
border-radius: 4px 0 0 4px;
}
#cssmenu li#homeicon a{
background: url(/img/home.png) no-repeat;
background-position: left;
}
#cssmenu li#cardicon a{
background: url(/img/card.png) no-repeat;
background-position: left;
}
#cssmenu li#billingicon a{
background: url(/img/billing.png) no-repeat;
background-position: left;
}
#cssmenu li#ticketicon a{
background: url(/img/tickets.png) no-repeat;
background-position: left;
}
Ok, as you can see, the last 4 ID selectors is to put an icon before the button's text. But all the buttons are on left side. I want to make some buttons like: LogOut, User Settings
on the right corner. The HTML to make the menu is:
<html>
<head>
<link rel="stylesheet" href="./css/style.css">
</head>
<body id="home">
<div id='cssmenu'>
<ul>
<li id="homeicon" class='active'><a href='index.html'><span>Home</span></a></li>
<li id="cardicon"><a href='#'><span>Information</span></a></li>
<li id="billingicon"><a href='#'><span>Billing</span></a></li>
<li id="ticketicon" class='last'><a href='#'><span>Tickets</span></a></li>
</ul>
</div>
</body>
</html>
I'm pretty beginner in this language, so I'm sorry for the silly question.
Thank you!
If you want to avoid classes you can use the nth-last-child selector: http://css-tricks.com/almanac/selectors/n/nth-last-child/ and float right
#cssmenu ul :nth-last-child(-n+2) {float:right;}
Demo
Better Demo With Border Fixes
If you're using ID's you could also use those to float right.
Give the right items a class and float them right. For example see this fiddle: http://jsfiddle.net/8Ena2/
#cssmenu ul li.right {float:right;}

Menu and submenus not showing on Internet Explorer

I am working on a menu that looks like this:
<nav>
<ul>
<li>Home</li>
<li>Expenses
<ul>
<li>View My Expenses</li>
<li>View Expenses</li>
<li> View Deconts
<ul>
<li>Single Deconts</li>
<li>View All Deconts</li>
</ul>
</li>
<li> Add Expenses
<ul>
<li>Soccer/Tennis Expenses</li>
<li>Gym Expenses</li>
<li>Coffee/Tea Expense</li>
</ul>
</li>
</li>
</ul>
It works perfectly on chrome and firefox, it does not work on IE.
The navigation CSS looks something like this:
nav {
text-align: center;
}
nav ul ul {
display: none;
}
nav ul li:hover > ul {
display: block;
}
nav ul {
background: #efefef;
background: linear-gradient(top, #efefef 0%, #bbbbbb 100%);
background: -moz-linear-gradient(top, #efefef 0%, #bbbbbb 100%);
background: -webkit-linear-gradient(top, #efefef 0%,#bbbbbb 100%);
box-shadow: 0px 0px 9px rgba(0,0,0,0.15);
padding: 0 20px;
border-radius: 10px;
list-style: none;
position: relative;
display: inline-table;
z-index: 9999;
}
nav ul:after {
content: ""; clear: both; display: block;
}
nav ul li {
float: left;
}
nav ul li:hover {
background: #4b545f;
background: linear-gradient(top, #4f5964 0%, #5f6975 40%);
background: -moz-linear-gradient(top, #4f5964 0%, #5f6975 40%);
background: -webkit-linear-gradient(top, #4f5964 0%,#5f6975 40%);
}
nav ul li:hover a {
color: #fff;
}
nav ul li a {
display: block; padding: 10px 40px;
color: #757575; text-decoration: none;
}
nav ul ul {
background: #5f6975; border-radius: 0px; padding: 0;
position: absolute; top: 100%;
}
nav ul ul li {
float: none;
border-top: 1px solid #6b727c;
border-bottom: 1px solid #575f6a; position: relative;
}
nav ul ul li a {
padding: 15px 40px;
color: #fff;
}
nav ul ul li a:hover {
background: #4b545f;
}
nav ul ul ul {
position: absolute; left: 100%; top:0;
}
Am I using deprecated functions ? I know the -moz- tag works for Mozilla Firefox and the -webkit- works for Chrome, but it initially worked. I must have updated IE or something. I am using IE 9.
Two things I noticed.
1.) Your code looks fine except for the lack of an ending tag. This could have been a copy paste issue.
2.) IE8 and prior do not work with the nav tag. So have you verified that you are running in IE9 mode? Open developer tools to make sure (F12) in IE. Make sure both document and browser mode are not in compability mode and set to IE9 or whatever your current version is at the moment.

CSS3 submenu's submenu dont work correctly

i have created a css3 style sheet for creating menu, in submenu of main menu is correct but after creating submenu. The child element of the submenu does not work correctly.
i want to move submenu's submenu to bottom of parent and i can move mouse cursor on child
JSFIDDLE
HTML:
<ul id="nav" class="nav" style='margin-right:0px;padding-right:0px;padding-top:0px;height:30px;'>
<li><a>MAIN MENU</a>
<ul>
<li>MENU 1
<ul>
<li><a>SUBMENU</a></li>
</ul>
</li>
<li>MENU 2</li>
<li>MENU 3</li>
</ul>
</li>
</ul>
CSS3:
#nav {
color: #fff;
margin: 0;
line-height: 100%;
padding-top: 4px;
padding-bottom: 4px;
height: 33px;
background: -moz-linear-gradient(center top , #5E9AE2, #3570B8) repeat scroll 0 0 transparent;
z-index: 10000;
}
#nav li {
margin: 0pt 5px;
padding: 2pt 0pt 5px;
float: right;
position: relative;
list-style: none outside none;
z-index: 10000;
cursor: pointer;
}
#nav a {
color: #fff !important;
text-decoration: none;
display: block;
padding: 9px 10px;
margin-right: 0pt;
border-radius: 5px 5px 5px 5px;
font-weight: normal;
z-index: 100000;
cursor: pointer;
}
#nav .current a, #nav li:hover > a {
z-index: 100000;
background: #fff ! important;
color: #000 ! important;
box-shadow: 0pt 1px 1px rgba(0, 0, 0, 0.2);
}
#nav ul li:hover a, #nav li:hover li a {
z-index: 100000;
background: none repeat scroll 0% 0% transparent;
color: #000 ! important;
box-shadow: none;
}
#nav ul a:hover {
background: -moz-linear-gradient(center top , rgb(198, 71, 53), rgb(147, 35, 19)) repeat scroll 0% 0% transparent ! important;
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#c44634), color-stop(100%,#952414)) repeat scroll 0% 0% transparent ! important; /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #c44634 0%,#952414 100%) repeat scroll 0% 0% transparent ! important; /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #c44634 0%,#952414 100%) repeat scroll 0% 0% transparent ! important; /* Opera 11.10+ */
background: -ms-linear-gradient(top, #c44634 0%,#952414 100%) repeat scroll 0% 0% transparent ! important; /* IE10+ */
background: linear-gradient(to bottom, #c44634 0%,#952414 100%) repeat scroll 0% 0% transparent ! important; /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#c44634', endColorstr='#952414',GradientType=0 ) ! important; /* IE6-9 */
color: rgb(255, 255, 255) ! important;
border-radius: 0pt 0pt 0pt 0pt;
text-shadow: 0pt 1px 1px rgba(0, 0, 0, 0.1);
cursor: pointer;
}
#nav ul {
background: #ffffff; /* Old browsers */
background: -moz-linear-gradient(top, #ffffff 0%, #cfcfcf 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#cfcfcf)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #ffffff 0%,#cfcfcf 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #ffffff 0%,#cfcfcf 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #ffffff 0%,#cfcfcf 100%); /* IE10+ */
background: linear-gradient(to bottom, #ffffff 0%,#cfcfcf 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#cfcfcf',GradientType=0 ); /* IE6-9 */
display: none;
margin: 0pt;
padding: 0pt;
text-align: right;
width: 180px;/*طول منو*/
position: absolute;
top: 35px;
right: 0pt;
border-radius: 5px 5px 5px 5px;
direction: rtl;
box-shadow: 0pt 1px 3px rgba(0, 0, 0, 0.3);
}
#nav li:hover > ul {
display: block;
}
#nav ul li {
float: none;
margin: 0pt;
padding: 0pt;
}
#nav ul li ul{
float: none;
margin-top:28px;
margin-right: 180px;
top: 0px;
}
#nav ul li ul li:first-child > a {
border-radius: 5px 5px 5px 5px;
behavior: url('./css/PIE.htc');
}
#nav ul li ul li:last-child > a {
border-radius: 5px 5px 5px 5px;
behavior: url('./css/PIE.htc');
}
#nav ul a {
font-weight: normal;
text-shadow: 0pt 1px 1px rgba(255, 255, 255, 0.898);
}
#nav ul li:first-child > a {
border-top-left-radius: 5px;
border-top-right-radius: 5px;
border-radius: 5px 5px 0px 0px;
behavior: url('./css/PIE.htc');
}
#nav ul li:last-child > a {
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
border-radius: 0px 0px 5px 5px;
behavior: url('./css/PIE.htc');
}
#nav:after {
z-index: 100000;
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0pt;
height: 0pt;
}
this method not problem but i want to have any submenu and cant fix it.please help me,
#nav ul li ul {
float: none;
margin-right: 180px;
margin-top: 28px; /* <-- this is causing issue */
top: 0;
}
i don't know where the problem every thing work just remove margin-top
and add the html
<ul id="nav" class="nav" style='margin-right:0px;padding-right:0px;padding-top:0px;height:30px;'>
<li><a>MAIN MENU</a>
<ul>
<li>MENU 1
<ul>
<li><a>SUBMENU</a>
<ul>
<li><a>asdasd</a></li>
<li><a>asdasd</a></li>
<li><a>asdasd</a></li>
</ul>
</li>
</ul>
</li>
<li>MENU 2</li>
<li>MENU 3</li>
</ul>
</li>
see demo : jsfiddle

Extending the "trigger area" that activates the dropdown menu.

Currently, only when the mouseover occurs near the phone icon or the little arrow-up area, will the dropdown menu not disappear when you move your cursor down to click on the links in the dropdownmenu.
When someone mouses over from the word 'Contact', the dropdown menu disappears as soon as he moves the cursor. I want the dropdown menu to remain as user moves the cursor down from the word 'Contact' .
HTML:
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" href="style2.css" type="text/css" />
</head>
<body>
<div class="Navigation">
<div id="navbar">
<ul>
<li class="OP" id="OPM1"><img src="images/order.png" />Orders</li>
<li class="OP"><img src="images/contact.png" />Contact
<div class="extended">
<div class="arrow-up"></div>
<ul class="smallNav">
<li>+65-65553333</li>
<li>Facebook</li>
<li>Twitter</li>
<li>enquiry [at] foodstant [dot] com</li>
</ul>
</div>
</li>
</ul>
</div>
</div>
</body>
</html>
CSS:
.Navigation { background:background: rgb(246,248,249); /* Old browsers */
background: -moz-linear-gradient(top, rgba(246,248,249,1) 0%, rgba(229,235,238,1) 46%, rgba(215,222,227,1) 65%, rgba(245,247,249,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(246,248,249,1)), color-stop(46%,rgba(229,235,238,1)), color-stop(65%,rgba(215,222,227,1)), color-stop(100%,rgba(245,247,249,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(246,248,249,1) 0%,rgba(229,235,238,1) 46%,rgba(215,222,227,1) 65%,rgba(245,247,249,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(246,248,249,1) 0%,rgba(229,235,238,1) 46%,rgba(215,222,227,1) 65%,rgba(245,247,249,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(246,248,249,1) 0%,rgba(229,235,238,1) 46%,rgba(215,222,227,1) 65%,rgba(245,247,249,1) 100%); /* IE10+ */
background: linear-gradient(to bottom, rgba(246,248,249,1) 0%,rgba(229,235,238,1) 46%,rgba(215,222,227,1) 65%,rgba(245,247,249,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f6f8f9', endColorstr='#f5f7f9',GradientType=0 ); /* IE6-9 */
border-top-left-radius: 10px;
border-bottom-left-radius:10px;
border-top-right-radius: 10px;
border-bottom-right-radius:10px;
box-shadow: -3px -5px 10px #888888;
font-size: 26px;
font-family: 'Conv_LITHOSPRO-REGULAR';
}
.Navigation ul li { position: relative; list-style: none; padding: 17px 10px; }
.Navigation ul li a { font-size: 26px; font-weight: bold; color: white; text-decoration: none; text-shadow: 0 1px 2px black; }
.Navigation ul li:hover { background: url(images/hover.png) repeat-x; height: 43px; -webkit-box-shadow: 0 0px 2px black inset; padding: 20px 9px; border-left: 1px solid #a4a4a4; border-right: 1px solid #a4a4a4;}
.Navigation ul li:hover { background: none; -webkit-box-shadow: none; -moz-box-shadow: none; height: auto; border: none; }
.arrow-up { width: 0; height: 0; border-left: 10px solid transparent; border-right: 10px solid transparent; border-bottom: 15px solid #6a6a63; position: absolute; left: 20px; top: -15px; }
.Navigation ul li .extended { position: absolute; top: 45px; left: 0; width: 220px; background: url(images/dropdownback.png); z-index: 1000; -moz-box-shadow: 0 0px 8px rgba(0,0,0,0.8); -webkit-box-shadow: 0 0px 8px rgba(0,0,0,0.8); box-shadow: 0 0 8px black; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; border: 1px solid white; display: none; color: white; }
.Navigation ul li .extended img { display: block; margin: 5px auto 15px auto; -webkit-box-reflect:below 0px -webkit-gradient(linear, left top, left bottom, from(transparent), color-stop(0.8, transparent), to(rgba(255,255,255,0.5))); }
.Navigation ul li .extended a { font-size:14px;}
.Navigation ul li .extended h2, .Navigation ul li .ultraNav h2 { padding-top: 10px; padding-left: 10px; font-size: 16px; text-shadow: 0 1px 2px black; color: white; background: url(images/headerback.png) repeat-x; height: 20px; border-radius: 3px; -webkit-border-radius: 3px; -moz-border-radius: 3px; }
.Navigation ul li .extended span { padding-left: 10px; font-size: 11px; }
.Navigation ul li .extended ul.smallNav { border-top: 1px solid rgba(141,141,141,0.50); padding: 10px; height: 100px; }
.Navigation ul li .extended ul.smallNav li { width: 200px; padding: 0; line-height: 22px; font-weight: bold; background: url(images/linkback.png) no-repeat; }
.extended ul li {float:left;}
.Navigation ul li .extended ul.smallNav li:first-child { margin: 0; }
.Navigation ul li .extended ul.smallNav li:last-child { margin-bottom: 10px; }
.Navigation ul li:hover .extended { display: block; }
.Navigation ul li ul li:hover a { color: white; }
#navbar {
}
#navbar ul {
list-style-position:inside;
padding-top: 10px;
padding-bottom: 10px;
}
#navbar ul li {
display: inline;
padding:0 20px 0px 0px;
margin-bottom: 10px;
list-style-type:disc;
}
#navbar ul li.OP {
padding-left: 15px;
}
#navbar ul li.OP img {
vertical-align: middle;
}
#navbar li a:link {
color: #EF174A;
}
#navbar li a:visited {
color: #BF4100;
}
#navbar li a:hover {
color: black;
background-color:#D2D2D2;
border-radius: 10px;
}
#navbar li a:active {
color: #918FBC;
}
li a {
text-decoration:none;
}
#navbar ul li.OP a {
padding-left: 10px;
}
.Navigation ul li .extended ul.smallNav li a { color: #c7c7c7 !important; text-shadow: none !important; }
.Navigation ul li .extended ul.smallNav li a:hover { color: white !important;}
Wrap the arrow-up DIV with another DIV like this:
<div class="arrow-container"><div class="arrow-up"></div></div>
Then add the arrow-container style as:
.arrow-container { margin-top:-16px; height:16px; }

Help with adding image to drop-down menu

I have a CSS based drop-down menu, which I am implementing into wordpress, however I need help in adding a image on the right side of my links when a user hoovers over a link from the menu. Below is my code and here is a similar effect I've seen done and would like to get the same effect on my menu as well.
Something like this: http://www.clydequaywharf.co.nz/
html
<div class="header">
<div class="nav-holder">
<ul id="nav">
<li><?php wp_list_pages('title_li=&depth=0&sort_column=menu_order'); ?></li>
</ul>
</div>
</div>
css
.nav-holder {
height: 32px;
width: 1010px;
float: right;
position: relative;
}
#nav {
font-family: Arial;
font-size: 12px;
float: right;
margin: 0px 30px 0 0px; padding: 0 0px 0 0px;
color: #FFF;
}
#nav li a, #nav li {
float: left;
text-transform: capitalize;
z-index: 9997;
}
#nav li {
list-style: none;
position: relative;
list-style-position: outside;
}
#nav li a:hover { background:white; color: #666; font-weight: normal; }
#nav li:hover > a { background:white; color: #666; font-weight: normal;}
#nav li a {
margin: 0px 0px 0px 15.2px;
padding: 10px 8px 8px 8px;
text-decoration: none;
color: #FFF;
text-transform: uppercase;
font-weight:normal;
letter-spacing: 0.8px;
z-index: 1006;
/* background: -moz-linear-gradient(top, black, #3c3c3c 1px, #292929 25px); */
/* background: -webkit-gradient(linear, left top, left 25, from(black), color-stop(4%, #3c3c3c), to(#292929)); */
}
#nav li li a:link {
background-color: white;
color: #333;
font-size: 12px;
z-index: 9995;
height:22px;
/* background: -moz-linear-gradient(top, #11032e, #2a0d65); */
/* background: -webkit-gradient(linear, left top, left bottom, from(#11032e), to(#2a0d65)); */
}
#nav li li a:hover {
background: white;
color: #8B7500;
z-index: 9996;
/* background: -moz-linear-gradient(top, #11032e, #2a0d65); */
/* background: -webkit-gradient(linear, left top, left bottom, from(#11032e), to(#2a0d65)); */
}
/* Submenu */
#nav li ul {
display: none;
position: absolute;
left: 0;
top: 100%;
padding: 0px 1px 8px 1px; margin: 0px 0px 0px 0px;
}
#nav li:hover ul {
padding: 0px 0px 0px 0px;
margin: 0px 0px 0px 15px;
width: 184px;
display: block;
z-index: 5000;
}
#nav li ul li a {
float: none;
letter-spacing: 0.0em;
background: white;
margin: 0px 0px 0px 0px;
padding: 10px 0px 0px 12px; /* Move text inside menu */
z-index: 1000;
font-size: 12px;
color: #666;
word-spacing: wrap;
text-transform: lowercase;
*margin-left: -9px;
}
#nav li ul li {
_display: inline; /* for ie6 */
background: url(../images/wordpress.png) no-repeat;
}
#nav li ul li a {
width: 158px;
display: block;
}
/* *** */
/* Sub Sub Menu */
#nav li ul li ul {
display: none;
}
#nav li ul li:hover ul {
left: 100%;
top: 0;
z-index: 1000;
}
EDIT:
I see what you're trying to do now. Wrap the contents of the in some sort of container, then you can float elements inside of it. I super-dummed-down your fiddle, but the concept still stands. You should be able to implement it in your markup.
HTML:
<ul id="nav">
<li>
<a>Past Projects</a>
<div class="menu-item-container">
<img src="http://lorempixum.com/100/100/" class="menu-image">
<ul class='children'>
<li>Sub Item 1</li>
<li>Sub Item 2</li>
<li>Sub Item 3</li>
</ul></div>
</li>
</ul>
CSS:
#nav li {
list-style: none;
position: relative;
}
#nav li div.menu-item-container {
position: absolute;
left: 0;
top:100%;
display:none;
}
#nav li:hover div.menu-item-container {
display:block;
}
#nav li img.menu-image {
float:right;
}
#nav li ul.children {
float:left;
}
Here's a fiddle: http://jsfiddle.net/thomas4g/VL3Sz/15/
Hope this helps!
I can't seem to reproduce your menu so I can't give an exact answer
For anyone stopping by, here was my original answer:
you can use the CSS pseudo class :hover (which i'm sure you're aware of) combined with a background-image, like so:
HTML:
<span class="menu-item">My Epic Menu Item</span>
CSS:
.menu-item {
padding:5px;
padding-right:25px;
}
.menu-item:hover {
background-image:url("http://lorempixum.com/20/20/");
background-position:right;
background-repeat:no-repeat;
}
Here's a fiddle if you want to play around with it: http://jsfiddle.net/thomas4g/NQQjX/4/
Please let me know if this isn't want you want, hopefully i can improve the answer.

Resources