Hey there! I'm new to web design/development and I've been working on a simple website to get the hang of things. I managed to make my webpage look good at full screen, but as soon as I resize the window, everything starts shifting around and it turns into a big mess. How can I prevent this from happening?
Just in case, here's the code I have so far. It might not be pretty for the pros out there, but here it is:
THE STYLE.CSS FILE
body{
background-image: url(Images/background.gif);
background-repeat: repeat-x;
background-size: cover;
}
.topBar{
width: 100%;
top: 0;
height: 50px;
position: fixed;
right: 0;
-webkit-box-shadow: 0px 0px 8px 0px #000;
background-image: url(Images/topBar2.gif);
}
#logoImage{
float: left;
width: 180px;
height: 50px;
top: 0;
margin-left: 380px;
background-image: url(Images/images/topBar_02.gif);
}
.topBar h1{
float: left;
margin-left: 400px;
color: white;
top: 0;
font-family: Tahoma, Geneva, sans-serif;
text-align: justify;
text-shadow: -1px -1px 1px #000;
}
.logoImage {
top: 0;
float: left;
margin-left: 100px;
}
#btn{
cursor: pointer;
border-radius: 4px;
border: 1px solid #039;
font: 16px bold Tahoma, Geneva, sans-serif;
color: white;
background-color: #0499ff;
padding: 4px;
}
.searchBox {
float: right;
margin-top: 7px;
padding-right: 500px;
}
.searchBox input{
border-radius: 5px;
padding: 4px;
color: #666;
font: "Times New Roman", Times, serif;
}
.topBar img{
width: 40px;
height: 20px;
margin: 20px;
margin-left: 400px;
}
.mainLogin{
border: 1px solid #999;
border-radius: 6px;
width: 300px;
height: 100px;
margin-top: 300px;
float: right;
margin-right: 500px;
position: fixed;
background-image: url(Images/login_back2.gif);
padding: 20px;
}
.mainLogin input{
border-radius: 5px;
padding: 4px;
}
.username{
width: 300px;
}
#rmbrme{
float: right;
color: #999;
text-shadow: -.3px -.3px .3px #000;
margin-right: 110px;
margin-top: 3px;
font: 10px Georgia, "Times New Roman", Times, serif;
}
#rmbrme a{
text-decoration: none;
color: #999;
text-shadow: -.3px -.3px .3px #000;
}