Rigas
05-22-2012, 05:15 PM
I'm just starting out playing with css, making a wordpress theme.
I've set up my nav bar, and I want it to change colour when I hover the mouse over it. When It does, but it isn't aligned correctly. I'm sure i'm just missing something pretty simple.
this is the css I have
#nav {
border-bottom:1px solid #eee;
margin:0;
border-top:1px solid #eee;
height:45px;
padding: 20px 5px 0px 5px ;
background: #333333; /* old browsers */
background: -moz-linear-gradient(top, #A8A8A8 0%, #4F4F4F 50%, #232323 51%, #A8A8A8 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#A8A8A8), color-stop(50%,#4F4F4F), color-stop(51%,#232323), color-stop(100%,#A8A8A8));
// filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#A8A8A8', endColorstr='#4f4f4f',GradientType=0 );
background: -o-linear-gradient(top, #A8A8A8 0%,#4F4F4F 50%,#232323 51%,#A8A8A8 100%); /* Opera11.10+ */
background: -ms-linear-gradient(top, #A8A8A8 0%,#4F4F4F 50%,#232323 51%,#A8A8A8 100%); /* IE10+ */
background: linear-gradient(top, #A8A8A8 0%,#4F4F4F 50%,#232323 51%,#A8A8A8 100%); /* W3C */
text-align: left;
}
#nav li {
float:left;
list-style:none;
}
#nav li a {
color:#999;
padding:0px 5px 0px 5px;
font:1.6em Trebuchet MS;
text-decoration:none;
display:block;
}
#nav li a:hover {
/*
*/
color:#999;
padding: 20px 5px 0px 5px ;
font:1.6em Trebuchet MS;
text-decoration:none;
display:block;
height:45px;
background: #333333; /* old browsers */
background: -moz-linear-gradient(top, #C9DBFF 0%, #99BAFF 50%, #5E91FC 51%, #C9DBFF 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#C9DBFF), color-stop(50%,#99BAFF), color-stop(51%,#5E91FC), color-stop(100%,#C9DBFF));
// filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#C9DBFF', endColorstr='#99BAFF',GradientType=0 );
background: -o-linear-gradient(top, #C9DBFF 0%,#99BAFF 50%,#5E91FC 51%,#C9DBFF 100%); /* Opera11.10+ */
background: -ms-linear-gradient(top, #C9DBFF 0%,#99BAFF 50%,#5E91FC 51%,#C9DBFF 100%); /* IE10+ */
background: linear-gradient(top, #C9DBFF 0%,#99BAFF 50%,#5E91FC 51%,#C9DBFF 100%); /* W3C */
text-align: left;
}
which results in this
http://i.imgur.com/TulOL.png
if anyone can point me the right direction I would be most appreciative.
I've set up my nav bar, and I want it to change colour when I hover the mouse over it. When It does, but it isn't aligned correctly. I'm sure i'm just missing something pretty simple.
this is the css I have
#nav {
border-bottom:1px solid #eee;
margin:0;
border-top:1px solid #eee;
height:45px;
padding: 20px 5px 0px 5px ;
background: #333333; /* old browsers */
background: -moz-linear-gradient(top, #A8A8A8 0%, #4F4F4F 50%, #232323 51%, #A8A8A8 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#A8A8A8), color-stop(50%,#4F4F4F), color-stop(51%,#232323), color-stop(100%,#A8A8A8));
// filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#A8A8A8', endColorstr='#4f4f4f',GradientType=0 );
background: -o-linear-gradient(top, #A8A8A8 0%,#4F4F4F 50%,#232323 51%,#A8A8A8 100%); /* Opera11.10+ */
background: -ms-linear-gradient(top, #A8A8A8 0%,#4F4F4F 50%,#232323 51%,#A8A8A8 100%); /* IE10+ */
background: linear-gradient(top, #A8A8A8 0%,#4F4F4F 50%,#232323 51%,#A8A8A8 100%); /* W3C */
text-align: left;
}
#nav li {
float:left;
list-style:none;
}
#nav li a {
color:#999;
padding:0px 5px 0px 5px;
font:1.6em Trebuchet MS;
text-decoration:none;
display:block;
}
#nav li a:hover {
/*
*/
color:#999;
padding: 20px 5px 0px 5px ;
font:1.6em Trebuchet MS;
text-decoration:none;
display:block;
height:45px;
background: #333333; /* old browsers */
background: -moz-linear-gradient(top, #C9DBFF 0%, #99BAFF 50%, #5E91FC 51%, #C9DBFF 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#C9DBFF), color-stop(50%,#99BAFF), color-stop(51%,#5E91FC), color-stop(100%,#C9DBFF));
// filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#C9DBFF', endColorstr='#99BAFF',GradientType=0 );
background: -o-linear-gradient(top, #C9DBFF 0%,#99BAFF 50%,#5E91FC 51%,#C9DBFF 100%); /* Opera11.10+ */
background: -ms-linear-gradient(top, #C9DBFF 0%,#99BAFF 50%,#5E91FC 51%,#C9DBFF 100%); /* IE10+ */
background: linear-gradient(top, #C9DBFF 0%,#99BAFF 50%,#5E91FC 51%,#C9DBFF 100%); /* W3C */
text-align: left;
}
which results in this
http://i.imgur.com/TulOL.png
if anyone can point me the right direction I would be most appreciative.