我似乎無法讓我的社交媒體圖標正確適合導航欄。我在每件事物周圍都有邊框,所以很容易看到裏面的東西。我不明白爲什麼社交媒體圖標在導航欄下方。我想讓圖標進入導航欄,並讓所有圖標左移< div id =「nav-left」>。任何幫助深表感謝。如何解決我的導航欄
Imgur問題:http://imgur.com/UKojBYx
我的HTML代碼:
<!DOCTYPE html>
<html>
<head>
<link href='http://fonts.googleapis.com/css?family=Crimson+Text' rel='stylesheet' type='text/css'>
<link href="http://s3.amazonaws.com/codecademy-content/courses/ltp/css/shift.css" rel="stylesheet">
<link rel="stylesheet" href="Website(CSS).css" type="text/css" media="screen" title="no title" charset="utf-8">
<title>Website</title>
</head>
<body>
<div class="nav">
<div class="container" id="nav-left">
<ul class="nav-left">
<li id="twitter"><a href="http://twitter.com/#"><img src="Twitter.png" width="40" height="40" alt="Twitter" /></a></li>
<li id="instagram"><a href="http://instagram.com/#"><img src="Instagram.png" width="40" height="40" alt="Instagram"/></a></li>
<li id="quora"><a href="http://quora.com/#"><img src="Quora.jpg" width="80" height="35" alt="Quora" /></a></li>
</ul>
</div>
<div class="container" id="nav-right">
<ul class="nav-right">
<li id="future-plans"><a href="insert link">Future Plans</a></li>
<li id="contact"><a href="inset link">Contact</a></li>
</ul>
</div>
</div>
我的CSS代碼:
/* Get the whole box of social image links to be closer to the left border.
Get the .nav-right to have better font, bigger font, and to pushed a little more to the left of the nav box. */
body {
border: 2px solid green;
}
/* Navigation Bar */
.nav {
height: 7%;
width: 98%;
top: 0;
z-index: 10;
position: fixed;
background-color: white;
border: 2px solid blue;
}
.nav ul {
display: inline-block;
}
/* Left Side Navigation Container */
#nav-left {
height: 100%;
top: 0;
left: 0;
float: left;
border: 2px solid red;
}
.nav-left li {
display: inline-block;
border: 2px solid black;
padding: 5px;
}
/* Right Side Navigation Container */
#nav-right {
height: 100%;
top: 0;
right: 0;
float: right;
border: 2px solid red;
}
.nav-right li {
display: inline-block;
border: 2px solid black;
margin: auto;
padding: 6px;
}