Hello Stack Overflow community! I am a complete beginner to programming and am attempting to learn my way around HTML and CSS at the moment. One of the projects I am working on is to re-create the Google homepage without looking at the source code. I am struggling right now with positioning of various elements (logo, search box, footer).
Can someone look at my code and tell me specifically why my positioning will not work on the three elements I mentioned?
Also, is my HTML semantically correct when it comes to "id" and "class"? Here is the code:
<!doctype html>
<html lang="en">
<head>
<link rel="stylesheet" href="main.css"/>
<title>Google</title>
<div class="container">
<nav id="nav">
<ul>
<li><a href="#">+You</a></li>
<li><a href="#">Search</a></li>
<li><a href="#">Images</a></li>
<li><a href="#">Maps</a></li>
<li><a href="#">Play</a></li>
<li><a href="#">YouTube</a></li>
<li><a href="#">News</a></li>
<li><a href="#">Gmail</a></li>
<li><a href="#">Drive</a></li>
<li><a href="#">Calendar</a></li>
<li><a href="#">More</a></li>
</ul>
</nav>
<img src="https://www.google.com/images/srpr/logo4w.png" alt="Google" width=280 height=95/>
<div id="sign">SIGN IN</div>
<form>
<input type="text">
</form>
<div id="footer">
<ul>
<li><a href="#">Advertising Programs</a><li>
<li><a href="#">Business Solutions</a><li>
<li><a href="#">Privacy & Terms</a><li>
<li><a href="#">+Google</a><li>
<li><a href="#">About Google</a><li>
</ul>
</div>
.container {
width: auto;
height: 600px;
position: relative;
}
#nav {
background-color: #333333;
height:30px;
}
li a {
text-decoration: none;
font-family: arial;
color: #ABABAB;
float: left;
padding: 5px;
font-size: 13px;
font-weight: 600;
margin-top: 2px;
margin-right: 13px;
}
img {
margin-left: 130px;
margin-top: 195px;
}
#sign {
border: 2px solid #D94A4A;
background-color: #D94A4A;
height: 16px;
width: 65px;
float: right;
margin-right: 40px;
margin-top: 20px;
border-radius: 3px;
font-size: 11px;
font-family: arial;
text-align: center;
color: white;
font-weight: 600;
padding-top: 7px;
}
input {
width: 550px;
height: 25px;
border: 1px solid #3492F7;
margin-top: 290px;
margin-left: 670px;
}
#footer {
position: relative;
bottom: 0;
font-family: verdana;
display: inline;
}