drop down menu css - html

I have a menu with html and css horizantal and I want to add a vertical menu only for the last element of the menu "parameters"
here is the html code :
<div id="templatemo_menu">
<ul>
<li><span class="home">Acceuil</span></li>
<li><span class="commandes">Commandes</span></li>
<li><span class="users">Utilisateurs</span></li>
<li><span class="gallery">Message</span></li>
<li><span class="contact">Messages</span></li>
<li>
<span class="contact2">Paramétres</span>
<ul class="sousmenu">
<li>CSS</li>
<li>Graphic design</li>
<li>Development tools</li>
<li>Web design</li>
</ul>
</li>
</ul>
</div>
and here is the css code :
#templatemo_menu {
width: 980px;
height: 110px;
margin: 0 auto;
background: url(images/templatemo_menu.jpg) repeat-x;
}
#templatemo_menu ul {
margin: 0;
padding: 1px 40px 0 40px;
list-style: none;
}
#templatemo_menu ul li {
padding: 0px;
margin: 0px;
display: inline;
}
#templatemo_menu ul li a {
float: left;
display: block;
width: 120px;
height: 95px;
padding: 15px 0 0 0;
margin-right: 5px;
text-align: center;
font-size: 16px;
text-decoration: none;
color: #163142;
font-weight: bold;
outline: none;
background: url(images/templatemo_menu_item.jpg) no-repeat;
}
#templatemo_menu li a:hover, #templatemo_menu li .current {
color: #000000;
background: url(images/templatemo_menu_hover.jpg) no-repeat;
}
#templatemo_menu ul li a .home {
display: block;
height: 20px;
padding: 55px 0 0 0;
background: url(images/home_48.png) no-repeat center top;
}
#templatemo_menu ul li a .aboutus {
display: block;
height: 20px;
padding: 55px 0 0 0;
background: url(images/new_order2.png) no-repeat center top;
}
#templatemo_menu ul li a .commandes {
display: block;
height: 20px;
padding: 55px 0 0 0;
background: url(images/commandes_v1.png) no-repeat center top;
}
#templatemo_menu ul li a .users {
display: block;
height: 20px;
padding: 55px 0 0 0;
background: url(images/user.png) no-repeat center top;
}
#templatemo_menu ul li a .services {
display: block;
height: 20px;
padding: 55px 0 0 0;
background: url(images/historiqueCommandes2.png) no-repeat center top;
}
#templatemo_menu ul li a .news {
display: block;
height: 20px;
padding: 55px 0 0 0;
background: url(images/newspaper_48.png) no-repeat center top;
}
#templatemo_menu ul li a .gallery {
display: block;
height: 20px;
padding: 55px 0 0 0;
background: url(images/newMessage.png) no-repeat center top;
}
#templatemo_menu ul li a .contact {
display: block;
height: 20px;
padding: 55px 0 0 0;
background: url(images/mail_48.png) no-repeat center top;
}
(it seems a bit long because I made ​​a template of the website)
so I tried this code css (a drop-down menu) but it not work, I tried to add and delete attributes but no result:
#templatemo_menu .sousMenu
{
display: none;
list-style-type: none;
margin: 0;
padding: 0;
border: 0;
}
#templatemo_menu .sousMenu li
{
float: none;
margin: 0;
padding: 0;
border: 0;
width: 149px;
border-top: 1px solid transparent;
border-right: 1px solid transparent;
}
#templatemo_menu .sousMenu li a:link, #menuDeroulant .sousMenu li a:visited
{
display: block;
color: #FFF;
margin: 0;
border: 0;
text-decoration: none;
background: transparent url("fondTR.png") repeat;
}
#templatemo_menu .sousMenu li a:hover
{
background-image: none;
background-color: #F2462E;
}
#templatemo_menu li:hover > .sousMenu { display: block; }
do you have any idea,thanks

Either in your HTML replace <ul class="sousmenu"> with <ul class="sousMenu">
OR
In your css change .sousmenu with .sousMenu (Everywhere).
Do what you like, but make them equal in cases. And see the difference it makes.

Related

Submenu, set position more left

i've a small problem with my slide menu. The slide is fadin in from down to up. This also is working fine.
But now I want to set the position a bit more to the left side, so that i get a line with the main menu.
Maybe someone can help me. This is my sample...
This is my code... [Menu][1] https://jsfiddle.net/Tabes/eb52suo1/15/
Here is your solution
.flex-box {
width: 100%;
min-height: 0;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
flex-wrap: wrap;
flex-direction: row;
justify-content: space-between;
align-items: flex-start;
align-content: flex-start;
}
.navigation {
background-image: linear-gradient(#444, #111);
background-color: #111;
width: 100%;
}
/* ******************************************************************************************* */
/* ***** Main Navigation - Main Level ******************************************************* */
/* ******************************************************************************************* */
.nav_main {
background: transparent;
list-style: none;
}
.nav_main ul:before,
.nav_main ul:after {
content: "";
display: table;
}
.nav_main ul {
list-style: none outside none;
position: relative;
flex-wrap: nowrap;
justify-content: center;
align-items: center;
align-content: center;
margin: 0px;
padding: 0px;
min-width: auto;
min-height: auto;
zoom: 1;
}
.nav_main ul li:before,
.nav_main ul li:after {
content: "";
display: inline;
}
.nav_main ul li.icon:before,
.nav_main ul li.icon:after {
display: inline-block;
margin: 2px 15px 0px 0px;
width: 15px;
height: 15px;
}
.nav_main ul li.icon:before {
background: url("../pic/icons/glyphicons-387-log-in.png") no-repeat top right;
background-size: 15px;
float: left;
margin: 2px 15px 0px 0px;
}
.nav_main ul li.icon:after {
background: url("../pic/icons/glyphicons-415-disk-save.png") no-repeat top left;
background-size: 15px;
float: right;
margin: 2px 0px 0px 15px;
}
.nav_main ul li>img.before,
.nav_main ul li>img.after {
display: inline-block;
margin: 2px 15px 0px 0px;
width: 15px;
height: auto;
}
.nav_main ul li>img.before {
float: left;
margin: 2px 15px 0px 0px;
}
.nav_main ul li>img.after {
float: right;
margin: 2px 0px 0px 15px;
}
.nav_main ul li:last-child {
border-right: none;
box-shadow: none;
}
.nav_main ul li:hover {
background: #444;
display: inline-block;
margin: 0px;
padding: 10px 35px;
min-width: auto;
min-height: auto;
}
.nav_main ul li {
border-right: 1px solid #222;
box-shadow: 1px 0 0 #444;
cursor: pointer;
text-align: center;
display: inline-block;
flex: 0 0 auto;
position: relative;
margin: 0px;
padding: 10px 35px;
min-width: auto;
min-height: auto;
}
.nav_main ul li>a:hover {
color: #fafafa;
}
.nav_main ul li>a {
font: bold 12px Arial, Helvetica;
text-transform: uppercase;
text-decoration: none;
text-shadow: 0 1px 0 #000;
color: #999;
}
.nav_main ul li:hover>ul {
visibility: visible;
opacity: 1;
margin: 0;
}
/* ******************************************************************************************* */
/* ***** Main Navigation - Level #1 ******************************************************** */
/* ******************************************************************************************* */
.nav_main ul ul {
list-style: none outside none;
position: absolute;
background: #444;
box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.3);
border-radius: 3px;
flex-direction: column;
align-items: flex-start;
visibility: hidden;
opacity: 0;
top: 40px;
left: 0;
z-index: 5;
transition: all 0.2s ease-in-out;
margin: 10px 0px 0px 0px;
padding: 0px;
min-width: 185px;
min-height: 35px;
width: auto;
}
.nav_main ul ul li:before,
.nav_main ul ul li:after {
content: "";
display: inline;
}
.nav_main ul ul li.icon:before,
.nav_main ul ul li.icon:after {
display: inline-block;
margin: 4px 35px 0px 0px;
width: 15px;
height: 15px;
}
.nav_main ul ul li.icon:before {
background: url("../pic/icons/glyphicons-387-log-in.png") no-repeat top right;
background-size: 15px;
float: left;
margin: 4px 35px 0px 0px;
}
.nav_main ul ul li.icon:after {
background: url("../pic/icons/glyphicons-415-disk-save.png") no-repeat top left;
background-size: 15px;
float: right;
margin: 4px 0px 0px 35px;
}
.nav_main ul ul li>img.before,
.nav_main ul ul li>img.after {
display: inline-block;
margin: 4px 35px 0px 0px;
width: 15px;
height: auto;
}
.nav_main ul ul li>img.before {
float: left;
margin: 4px 35px 0px 0px;
}
.nav_main ul ul li>img.after {
float: right;
margin: 4px 0px 0px 35px;
}
.nav_main ul ul li:hover {
background: #444;
background-image: linear-gradient(#04acec, #0186ba);
background-color: #0186ba;
display: inline-block;
margin: 0px;
padding: 5px 15px;
min-width: 185px;
min-height: 35px;
}
.nav_main ul ul li:first-child:hover {
border-radius: 3px 3px 0px 0px;
}
.nav_main ul ul li:last-child:hover {
border-radius: 0px 0px 3px 3px;
}
.nav_main ul ul li {
border: none;
box-shadow: none;
text-align: left;
display: inline-block;
flex: 0 0 auto;
margin: 0px;
padding: 5px 15px;
min-width: 185px;
min-height: 35px;
}
.nav_main ul ul li>a:hover {
color: #fafafa;
}
.nav_main ul ul li>a {
font: bold 12px Arial, Helvetica;
text-transform: uppercase;
text-decoration: none;
text-shadow: 0 1px 0 #000;
color: #999;
}
.nav_main ul ul li:hover>ul {
visibility: visible;
opacity: 1;
margin: 0;
}
<!-- Main Navigation (Container for JavaScript Function)-->
<div id="Navigation" class="navigation">
<!-- ### Main Navigation Link Liste ### -->
<nav id="Nav_Main" class="nav_main">
<ul class="flex-box">
<li>
Home
<ul class="flex-box">
<li>
Referenzen
</li>
<li>
Downloads
</li>
<li>
Partner Programm
</li>
<li>
Existenzgründer
</li>
<li>
<!-- Philosophie -->
Philosophie
</li>
</ul>
</li>
<li>
Hosting
<ul class="flex-box">
<li>
Web Hosting
</li>
<li>
TYPO3
</li>
<li>
WordPress
</li>
<li>
Magento
</li>
<li>
PrestaShop
</li>
</ul>
</li>
<li>
<a class="ajaxy" href="webdesign.html">WebDesign</a>
</li>
</ul>
</nav>
<!-- ### Main Navigation Link Liste End ### -->
</div>
<!-- Main Navigation Container End -->
Inside your flex-box class you can add a margin-left: -35px; and it will fix the position of the sub menu according to the snippet. You should mention though, that this might cause problems for the responsive part of your site.

How to set height of <nav> in html or css

How can I decrease the size of a <nav> tag in CSS? I cannot seem to figure it out. I have provided all of the code from my project below. My code did have PHP, but I have removed it due to it being unnecessary. Here is a JSFiddle, if you wish to preview the code there.
HTML and CSS:
#top-menu {
top: 0;
position: fixed;
}
nav {
position: relative;
/*float: left;*/
width: 100%;
background: #1E1E1E;
/* display: table; */
margin: 0;
text-align: center;
height: 25px;
border: none;
border-width: 0;
margin: 0;
padding: 10px 10px;
}
nav ul ul {
display: none;
}
nav ul li:hover > ul {
display: block;
border: none;
border-width: 0;
}
nav ul {
background: #1E1E1E;
color: white;
padding: 10px 10px;
border-radius: 0;
list-style: none;
position: relative;
display: inline-table;
border-width: 0;
border: none;
}
nav ul:after {
content: "";
clear: both;
display: block;
}
nav ul li {
float: left;
border: none;
border-width: 0;
}
nav ul li:hover {
background: #1E1E1E;
background-color: orange;
color: white;
}
nav ul li:hover a {
color: #fff;
}
nav ul li a {
display: block;
height: 25px;
padding: 10px 10px;
color: #757575;
text-decoration: none;
border: none;
border-width: 0;
}
nav ul ul {
background: #1E1E1E;
color: white;
border-radius: 0px;
padding: 10px 10px;
position: absolute;
top: 50px;
border-width: 0;
margin-bottom: 0;
}
nav ul ul li {
float: none;
border-top: 1px solid #6b727c;
border-bottom: 1px solid #575f6a;
position: relative;
}
nav ul ul li a {
padding: 10px 10px;
color: #fff;
height: auto;
}
nav ul ul li a:hover {
background: #4b545f;
background-color: orange;
}
nav ul ul ul {
position: absolute;
left: 100%;
top: 0;
}
nav li#english a {
background: url(images/english.jpg) no-repeat;
background-position: center center;
}
nav li#english a:hover {
background: url(images/english.jpg) no-repeat;
background-position: center center;
background-color: orange;
}
nav li#english a.current {
background: url(images/english.jpg) no-repeat;
background-position: center center;
cursor: default;
}
/*--------------------------------------------*/
#menu {
background-color: #1E1E1E;
text-align: center;
padding-bottom: 0px;
}
body {
margin: 0px;
}
.clearfloat {
clear: both;
margin: 0;
padding: 0;
}
/*--------------------------------------------*/
#bottom {
float: left;
width: 100%;
background: #1E1E1E;
/*display: table; */
margin: 0;
text-align: center;
min-height: 25px;
height: 25px;
border-width: 0px;
margin-top: 0px;
padding-top: 0px;
bottom: 0px;
position: fixed;
}
#bottom ul ul {
display: none;
}
#bottom ul li:hover > ul {
display: block;
}
#bottom ul {
background: #1E1E1E;
color: white;
padding: 0 0;
border-radius: 0;
list-style: none;
position: relative;
display: inline-table;
}
#bottom ul:after {
content: "";
clear: both;
display: block;
}
#bottom ul li {
float: left;
}
#bottom ul li:hover:nth-child(1) {
background: #1E1E1E;
color: #757575;
text-decoration: none;
}
#bottom ul li:hover:nth-child(2) {
background: #1E1E1E;
color: #757575;
text-decoration: none;
}
#bottom ul li:hover {
background: #1E1E1E;
color: white;
text-decoration: underline;
}
#bottom ul li:hover a {
color: #fff;
}
#bottom ul li a {
display: block;
padding: 25px 40px;
color: #757575;
text-decoration: none;
}
#bottom ul ul {
background: #1E1E1E;
color: white;
border-radius: 0px;
padding: 0;
position: absolute;
top: 100%;
width: auto;
}
#bottom ul ul li {
float: none;
border-top: 1px solid #6b727c;
border-bottom: 1px solid #575f6a;
position: relative;
}
#bottom ul ul li a {
padding: 15px 40px;
color: #fff;
}
#bottom ul ul li a:hover {
background: #4b545f;
}
#bottom ul ul ul {
position: absolute;
left: 100%;
top: 0;
}
/*--------------------------------------------*/
.bottommenuitem {
vertical-align: middle;
padding: 25px 40px;
color: #757575;
}
<!DOCTYPE html5>
<html>
<head>
<title>Firma A/S</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="cssMenu.css">
</head>
<body>
<nav id="top-menu">
<p id="menu" style="margin-bottom: -25">
<a href="Index.html">
<img src="Tilbage.jpg" alt="Tilbage" width="243" height="243" />
</a>
<img src="Top_10.jpg" alt="" width="739" height="243" />
</p>
<nav id="top">
<ul>
<li>Velkommen
</li>
<li>Firma A/S
<ul>
<li>Koncern oversigt
<ul>
<li>Ejendomsselskaber
</li>
<li>Investeringsselskaber
</li>
<li>Øvrige selskaber
</li>
<li>Lukkede eller solgte selskaber
</li>
</ul>
</li>
<li>Jubilæum
</li>
<li>Årsrapport
</li>
<li>Galleri
</li>
<li>Kontaktoplysninger
</li>
</ul>
</li>
<li>Privat
</li>
<li>Køb og salg
</li>
<li><a id="english" href="index.php">In English</a>
</li>
</ul>
<!-- PHP was here -->
</nav>
</nav>
<div style="margin-top: 410; margin-bottom: 115">
<!-- More PHP was here -->
</div>
<nav id="bottom">
<ul>
<li class="bottommenuitem">Firma A/S</li>
<li class="bottommenuitem">phone No</li>
<li>xxx#xxx.xx
</li>
</ul>
</nav>
</body>
</html>
Any help is appreciated, thank you.
Please try this:
nav ul {
background: #1e1e1e none repeat scroll 0 0;
border: medium none;
border-radius: 0;
color: white;
display: inline-table;
list-style: outside none none;
margin: 0;
padding: 10px;
position: relative;
}
nav {
float: left;
width: 100%;
background: #1E1E1E;
display: table;
margin: 0;
text-align: center;
height: 25px;
border: none;
border-width: 0;
margin: 0;
padding: 10px 10px;
}
nav ul ul {
display: none;
}
nav ul li:hover > ul {
display: block;
border: none;
border-width: 0;
}
nav ul {
background: #1E1E1E;
color: white;
padding: 10px 10px;
border-radius: 0;
list-style: none;
position: relative;
display: inline-table;
border-width: 0;
border: none;
}
nav ul:after {
content: "";
clear: both;
display: block;
}
nav ul li {
float: left;
border: none;
border-width: 0;
}
nav ul li:hover {
background: #1E1E1E;
background-color: orange;
color: white;
}
nav ul li:hover a {
color: #fff;
}
nav ul li a {
display: block;
height: 25px;
padding: 10px 10px;
color: #757575;
text-decoration: none;
border: none;
border-width: 0;
}
nav ul ul {
background: #1E1E1E;
color: white;
border-radius: 0px;
padding: 10px 10px;
position: absolute;
top: 50px;
border-width: 0;
margin-bottom: 0;
}
nav ul ul li {
float: none;
border-top: 1px solid #6b727c;
border-bottom: 1px solid #575f6a;
position: relative;
}
nav ul ul li a {
padding: 10px 10px;
color: #fff;
height: auto;
}
nav ul ul li a:hover {
background: #4b545f;
background-color: orange;
}
nav ul ul ul {
position: absolute;
left: 100%;
top: 0;
}
nav li#english a {
background: url(images/english.jpg) no-repeat;
background-position: center center;
}
nav li#english a:hover {
background: url(images/english.jpg) no-repeat;
background-position: center center;
background-color: orange;
}
nav li#english a.current {
background: url(images/english.jpg) no-repeat;
background-position: center center;
cursor: default;
}
<nav id="top-menu">
<p id="menu" style="margin-bottom: -25">
<a href="Index.html">
<img src="Tilbage.jpg" alt="Tilbage" width="243" height="243" />
</a>
<img src="Top_10.jpg" alt="" width="739" height="243" />
</p>
<nav id="top">
<ul>
<li>Velkommen
</li>
<li>Firma A/S
<ul>
<li>Koncern oversigt
<ul>
<li>Ejendomsselskaber
</li>
<li>Investeringsselskaber
</li>
<li>Øvrige selskaber
</li>
<li>Lukkede eller solgte selskaber
</li>
</ul>
</li>
<li>Jubilæum
</li>
<li>Årsrapport
</li>
<li>Galleri
</li>
<li>Kontaktoplysninger
</li>
</ul>
</li>
<li>Privat
</li>
<li>Køb og salg
</li>
<li><a id="english" href="index.php">In English</a>
</li>
</ul>
</nav>
</nav>
If you are talking about the fixed nav id=top-menu, just add a height to the CSS for the id selector. It works for me. If you have problems with it being overridden, make sure that it is placed lower in the CSS file or add !important
after the rule.
#top-menu {
height: 6px;
}
#top-menu {
height: 6px !important;
}

I can't center <ul> <li> into div

I can't make ul to be centered in the div element
<div class="top-menu">
<ul class="topnav dropdown" a>
<li>Home</li>
<li>
Tutorials
<ul class="subnav">
<li>
Sub Nav Link
<ul class="subnav">
<li>Sub Nav Link
<ul class="subnav">
<li>Sub Nav Link</li>
<li>Sub Nav Link</li>
</ul>
</li>
<li>Sub Nav Link</li>
</ul>
</li>
<li>Sub Nav Link</li>
</ul>
</li>
<li>
Resources
<ul class="subnav">
<li>Sub Nav Link</li>
<li>Sub Nav Link</li>
</ul>
</li>
<li>About Us</li>
<li>Advertise</li>
<li>Submit</li>
<li>Contact Us</li>
</ul>
</div>
and css style
.top-menu{
width:100%;
text-align:center;
}
ul.topnav {
border:1px solid black;
list-style: none;
padding: 0 20px;
margin: auto;
width: 100%;
background: #222;
background: url(topnav_bg.gif) repeat-x;
}
ul.topnav li {
float: left;
margin: 0;
padding: 0 15px 0 0;
position: relative; /*--Declare X and Y axis base for sub navigation--*/
display: inline;
}
what is wrong?
fiddle is here http://jsfiddle.net/m82LK/2/, Thanks
See this FIDDLE
CSS:
.top-menu {
width:100%;
text-align:center;
}
ul.topnav {
border:1px solid black;
list-style: none;
padding: 0 20px;
margin: auto;
width: 100%;
background: #222;
background: url(topnav_bg.gif) repeat-x;
}
ul.topnav li {
display:inline-block;
margin: 0;
padding: 0 15px 0 0;
position: relative;
/*--Declare X and Y axis base for sub navigation--*/
}
ul.topnav li a {
padding: 10px 5px;
color: #aaaaaa;
display: block;
text-decoration: none;
}
ul.topnav li a:hover {
background: url(topnav_hover.gif) no-repeat center top;
}
ul.topnav li span {
/*--Drop down trigger styles--*/
width: 17px;
height: 35px;
float: left;
background: url(subnav_btn.gif) no-repeat center top;
}
ul.topnav li span.subhover {
background-position: center bottom;
cursor: pointer;
}
/*--Hover effect for trigger--*/
ul.topnav li ul.subnav {
list-style: none;
position: absolute;
/*--Important - Keeps subnav from affecting main navigation flow--*/
left: 0;
top: 35px;
background: #333;
margin: 0;
padding: 0;
display: none;
float: left;
width: 170px;
border: 1px solid #111;
}
ul.topnav li ul.subnav li {
margin: 0;
padding: 0;
border-top: 1px solid #252525;
/*--Create bevel effect--*/
border-bottom: 1px solid #444;
/*--Create bevel effect--*/
clear: both;
width: 170px;
}
html ul.topnav li ul.subnav li a {
float: left;
width: 145px;
background: #333 url(dropdown_linkbg.gif) no-repeat 10px center;
padding-left: 20px;
}
html ul.topnav li ul.subnav li a:hover {
/*--Hover effect for subnav links--*/
background: #222 url(dropdown_linkbg.gif) no-repeat 10px center;
}
replace ul.topnav with this:
ul.topnav {
border:1px solid black;
list-style: none;
padding: 0 20px;
background: url(topnav_bg.gif) repeat-x; // or #222 based on ur requirement
display: inline-block;
}
Remove the float: left on your li and use inline-block. Add text-align: center to your ul
See updated fiddle: http://jsfiddle.net/m82LK/3/
Edit: This works. I also added the box-sizing:border-box so that the padding on the UL doesn't affect it's width (before it was pushed off the right of the screen). Here is an updated fiddle http://jsfiddle.net/m82LK/11/
* {
box-sizing:border-box;
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
}
.top-menu{
width:100%;
text-align:center;
}
ul.topnav {
border:1px solid black;
list-style: none;
padding: 0 20px;
margin: auto;
width: 100%;
background: #222;
background: url(topnav_bg.gif) repeat-x;
}
ul.topnav li {
display:inline-block;
margin: 0;
padding: 0 15px 0 0;
position: relative; /*--Declare X and Y axis base for sub navigation--*/
}
ul.topnav li a{
padding: 10px 5px;
color: #aaaaaa;
display: block;
text-decoration: none;
display:inline-block;
}
ul.topnav li a:hover{
background: url(topnav_hover.gif) no-repeat center top;
}
ul.topnav li span { /*--Drop down trigger styles--*/
width: 17px;
height: 35px;
display:inline-block;
background: url(subnav_btn.gif) no-repeat center top;
}
ul.topnav li span.subhover {background-position: center bottom; cursor: pointer;} /*--Hover effect for trigger--*/
ul.topnav li ul.subnav {
list-style: none;
position: absolute; /*--Important - Keeps subnav from affecting main navigation flow--*/
left: 0; top: 35px;
background: #333;
margin: 0; padding: 0;
display: none;
float:left;
width: 170px;
border: 1px solid #111;
}
ul.topnav li ul.subnav li{
margin: 0; padding: 0;
border-top: 1px solid #252525; /*--Create bevel effect--*/
border-bottom: 1px solid #444; /*--Create bevel effect--*/
clear: both;
width: 170px;
}
html ul.topnav li ul.subnav li a {
display:inline-block;
width: 145px;
background: #333 url(dropdown_linkbg.gif) no-repeat 10px center;
padding-left: 20px;
}
html ul.topnav li ul.subnav li a:hover { /*--Hover effect for subnav links--*/
background: #222 url(dropdown_linkbg.gif) no-repeat 10px center;
}

Glow behind the navigation menu

I am creating a little animation with glow in navigation.
Glow is behind the navigation menu as seen in picture.
I tried but not clear result, I need same result as shown in picture.
http://jsfiddle.net/naresh_kumar/GCpDW/5/
HTML
<div id="topnav" style="float:right;">
<ul class="nav clearfix">
<li id="menu-item-6">
Home
</li>
<li id="menu-item-8">
<a>Tutor Videos</a>
</li>
<li id="menu-item-7">
<a>Download Font</a>
</li>
<li id="menu-item-9">
<a>news</a>
</li>
</ul>
</div>
CSS
body{background:#000000;}
ul { margin-left: 20px; padding: 0; }
#topnav {
font-size: 8pt;
font-weight: bold;
margin-top: 2%;
float: left;
font-size: 8pt;
margin-bottom: 0;
margin-left: 63px;
margin-right: 0;
margin-top: 4% !important;
padding: 0;
width: 60%;
}
#topnav ul {
background: none repeat scroll 0 0 #E2E2DE;
border: 3px solid #FFFFFF;
line-height: 1;
list-style: none outside none;
margin: 0;
padding: 0;
}
#topnav ul li {
float: left;
width: auto;
}
#topnav ul li a {
border-bottom: 15px solid transparent;
border-top: 15px solid transparent;
display: block;
line-height: 30px;
margin: -17px 0;
}
#topnav ul a {
color: #000000 !important;
display: block;
line-height: 24px;
padding: 5px 10px;
position: relative;
text-decoration: none;
z-index: 90;
}
#topnav ul a:hover, #topnav ul ul a:hover {
border-color: white;
color: #0A0A0A;
box-shadow: 0 0 50px gold, 0 0 150px gold;
}
.clearfix:after, blockquote:after {
clear: both;
content: ".";
display: block;
height: 0;
visibility: hidden;
}
.clearfix, blockquote {
display: block;
}
.clearfix, blockquote {
display: inline-block;
}
It's going to be difficult to get the glow 'behind' the menu just using CSS3 but with some minor tweaks (including more subtle use of colour for the glow) you can make the example you have already produced look quite reasonable with the glow on top of the menu
#topnav ul a:hover, #topnav ul ul a:hover {
border-color: white;
color: #0A0A0A;
box-shadow: 0 0 100px #ffffee, 0 0 100px #ffffee;
}

Dropdown menu not showing full text and text not aligned

currently, my add subject, drop subject, delete subject, manual crawl in the submenu is not centralised even though i have specified it to be text-align center in #menu li li a. The sub menu's executive summary is also cut off. May I know how can i expand the submenu and centralise all my text?
Thank you!
Here is my code (i am really sorry because i do not have a jsfiddle acct and is on the waiting list):
HTML
<div id="menu">
<ul>
<li><a href="#" >Home</a></li>
<li><a href="#" >Executive Summary</a></li>
<li><a href="#" > Visual Analytics</a></li>
<li><a href="#" >Settings</a>
<ul>
<li>Add Subject</li>
<li>Delete Subject</li>
<li> Edit Subject</li>
<li><a href="#" >Manual Crawl</a></li>
<li><a href="#" >Executive Summary</a></li>
</ul>
</li>
</ul>
CSS
#menu {
position: relative;
float: left;
width: 1200px;
height: 35px;
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
padding: 0;
background: #000;
text-align: center;
}
#menu ul {
position: relative;
list-style: none;
display: inline-block;
margin: 0;
padding: 0;
}
#menu li {
position: relative;
float: left;
height: 100%;
padding: 0;
line-height: 35px;
}
#menu a {
position: relative;
height: 100%;
width: auto;
float: left;
text-decoration: none;
padding: 0 0 0 25px;
margin: 0 3px;
color: #fff;
text-align: center;
}
#menu ul ul {
display: none;
width: 10em; /* Width to help Opera out */
background-color: rgba(0,0,0,0.5);
}
#menu li:hover ul {
display:block;
position: absolute;
top: 35px;
left: 0;
margin: 0;
padding: 0;
z-index: 1;
}
#menu li li a{
height: 35px;
width: 100%;
float: left;
text-decoration: none;
padding: 0 0 0 25px;
margin: 0 3px;
color: #fff;
text-align: center;
}
#menu li li a:hover{
background: rgba(255,255,255,0.5);
}
#menu {
position: relative;
float: left;
width: 1200px;
height: 35px;
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
padding: 0;
background: #000;
text-align: center;
}
#menu ul {
position: relative;
list-style: none;
display: inline-block;
margin: 0;
padding: 0;
}
#menu li {
position: relative;
float: left;
height: 100%;
padding: 0;
line-height: 35px;
}
#menu a {
position: relative;
height: 100%;
width: auto;
float: left;
text-decoration: none;
padding: 0px 10px 0px 10px;
margin: 0 3px;
color: #fff;
text-align: center;
}
#menu ul ul {
display: none;
width: 11em; /* Width to help Opera out */
background-color: rgba(0,0,0,0.5);
}
#menu li:hover ul {
display:block;
position: absolute;
top: 35px;
left: 0;
margin: 0;
padding: 0;
z-index: 1;
}
#menu li li a{
height: 35px;
width: 100%;
float: left;
text-decoration: none;
padding: 0px 10px 0px 10px;
margin: 0 0px;
color: #fff;
text-align: center;
}
#menu li li a:hover{
background: rgba(255,255,255,0.5);
}
add styling
#menu li li a{
height: 35px;
width: 100%;
float: left;
text-decoration: none;
padding: 0 13px;
margin: 0 3px;
display: block;
color: #fff;
text-align: center;
}
Your <a> having only left padding but it has to be from both right-left or you could remove padding