Having difficulty setting the hover height of my <li>
tag. Below you can find a link to my jsfiddle with the HTML and CSS code. Any assistance would be greatly appreciated!
Here is the HTML code snippet:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Home</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="logo">
</div>
<div id="navigation">
<ul>
<li id="left"><a href="#home">Home</a></li>
<li id="left"><a href="#home">About Us</a></li>
<li id="left"><a href="#home">Events</a></li>
<li id="left"><a href="#home">Contact Us</a></li>
<li id="right"><a href="#home">Login</a></li>
</ul>
</div>
<div id="imgbanner">
</div>
</body>
</html>
This is the CSS code snippet:
#logo {
border-bottom: 2px solid black;
width: 100%;
height: 100px;
}
#navigation {
background-color: #fff;
border: 1px solid #dedede;
border-radius: 4px;
box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.055);
color: #888;
display: block;
margin: 0;
overflow: hidden;
width: 100%;
}
#navigation ul {
list-style-type: none;
margin: 0;
padding: 0;
}
#navigation li {
display: inline;
/*padding: 20px;*/
-webkit-transition: all 0.2s;
-moz-transition: all 0.2s;
-ms-transition: all 0.2s;
-o-transition: all 0.2s;
transition: all 0.2s;
}
#navigation li:hover {
background-color: rgb( 251,184,41);
/* padding: 20px;
*/
}
#navigation a {
color: #026475;
display: inline-block;
line-height: 56px;
padding: 0 24px;
text-decoration: none;
}
/*#imgbanner {
position: absolute;
border: 2px solid black;
}
*/
ul #right {
float: right;
}
li #right{
float: left;
}
After running this code, I am able to hover over both <li>
tags but notice that the height differs for the last one.