Website looks different between Chrome and Safari - html

i am programming an App with Angular. And the problem is, that my button is looking different in Safari on my iPhone then on my Simulated iPhone in Chrome.
in Chrome it looks like this:
And on my iPhone it looks like this:
I know that it could be a problem because i have not implemented anything webkit related, but i couldnt find something with webkit that could help me with this.
The Code is the Following:
#colorPicker button {
border: none;
border-radius: 30px;
width: 100%;
height: 86%;
position: relative;
top: -6%;
overflow: hidden;
}
#colorPicker i {
color: white;
}
#colorPicker #second {
background-color: rgb(48, 209, 88);
}
#colorPicker #third {
background-color: rgb(12, 50, 102);
}
#colorPicker #fourth {
background-color: rgb(0, 0, 0);
}
#content {
overflow: hidden;
}
.resetSettings {
border: none;
padding: none;
margin: none;
border-radius: 25px;
color: white;
}
#activeButton {
color: white;
background-color: rgb(88, 86, 214);
width: 100%;
height: 120%;
border-top-left-radius: 25px;
border-top-right-radius: 25px;
border: none;
padding: none;
margin: none;
}
#settingsDatenschutz {
width: 80%;
border: none;
background-color: transparent;
padding: none;
margin: none;
margin-right: 10%;
margin-left: 10%;
border-radius: 25px;
font-family: Arial, Helvetica, sans-serif;
}
#settingsDatenschutz p {
font-size: 18pt !important;
font-family: Arial, Helvetica, sans-serif !important;
}
#settingsDatenschutz i {
font-size: 18pt !important;
}
#datenschutz {
margin: none;
border: none;
padding: none;
border-top-left-radius: 25px;
border-top-right-radius: 25px;
border-bottom-right-radius: 0px;
border-bottom-left-radius: 0px;
top: 0;
bottom: 0;
right: 0;
left: 0;
width: 100%;
height: 100%;
position: fixed;
z-index: 102;
background-color: rgb(44, 44, 46);
overflow-y: scroll;
}
#datenschutz button {
width: 100%;
bottom: 0;
position: fixed;
font-size: 20pt;
border-top-left-radius: 25px;
border-top-right-radius: 25px;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet"/>
<style>
#content {
background-color: white;
color: black;
border: none;
border-bottom-left-radius: 20px;
border-bottom-right-radius: 20px;
margin: 5%;
margin-top: 2%;
width: 90%;
position: relative;
top: 12%;
left: 0;
right: 0;
overflow: scroll;
padding: 15px;
font-size: 20pt;
}
#content i {
font-size: 28pt;
padding-top: 5px;
}
#content p {
display: inline;
}
#view {
z-index: 2;
position: relative;
top: 0;
margin: none;
width: 100%;
height: 100%;
}
#colorPicker {
width: 90%;
height: 90%;
margin: 5%;
margin-top: 20%;
}
/* #colorPicker button {
border: none;
border-radius: 30px;
width: 100%;
position: relative;
top: -6%;
}
#colorPicker i {
color: white;
}
#colorPicker #default {
background-color: rgb(10, 132, 255);
}
#colorPicker #second {
background-color: rgb(48, 209, 88);
}
#colorPicker #third {
background-color: rgb(12, 50, 102);
}
#colorPicker #fourth {
background-color: rgb(0, 0, 0);
} */
</style>
<div id="view">
<div id="content">
<br>
<div id="colorPickerButtonView">
<div class="row">
<div id="firstMain" class="col-6">
<div class="activeColorFromColorPicker" id="colorPicker">
<button class="primaryColorDefault" alt="Hellblauer Hintergrund, weiße Schrift" onclick="colorPicker(0)" id="default">
<br>
<i class="fab fa-accessible-icon"></i>
<br>
<div id="activeButton">
<p>Active!</p>
</div>
</button>
</div>
</div>
<div id="secondMain" class="col-6">
<div id="colorPicker">
<button alt="Helglgrüner Hintergrund, weiße Schrift" onclick="colorPicker(1)" id="second">
<br>
<i class="fab fa-accessible-icon"></i>
<br>
<div id="activeButton">
<p>Active!</p>
</div>
</button>
</div>
</div>
<div id="thirdMain" class="col-6">
<div id="colorPicker">
<button alt="Dunkelblauer Hintergrund, weiße Schrift" onclick="colorPicker(2)" id="third">
<br>
<i class="fab fa-accessible-icon"></i>
<br>
<div id="activeButton">
<p>Active!</p>
</div>
</button>
</div>
</div>
<div id="fourthMain" class="col-6">
<div id="colorPicker">
<button alt="Schwarzer Hintergrund, weiße Schrift" onclick="colorPicker(3)" id="fourth">
<br>
<i class="fab fa-accessible-icon"></i>
<br>
<div id="activeButton">
<p>Active!</p>
</div>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
<router-outlet></router-outlet>

The given code has several errors in the HTML such as multiple instances of the same id.
The error that is most likely to be confusing browsers as they won't necessarily know how you want the code parsed is having a div (and also a p) element within a button element. This is not allowed in the spec. See for example div not allowed as child element of button
Run your code through the W3C validator to get the full details.
Then the best thing to do next is probably to change the button elements for div elements with class="button", change the CSS which refers to button to .button
And check and correct any other validation errors.
Then if the problem is not cured we are at least on solid ground for having a further look - particularly at the implementations of class="row" when an inner div has a height larger than the container such as you have in this example

Related

White area at the bottom of my webpage when i try to create a responsive design

I'm trying to make my webpage responsive to fit on an ipad and mobile, as i adjust my media query, i noticed this white area at the bottom, the body element when highlighted, it doesnt reach that area, so i dont know where it came from, anyhelp would be appreaciated. thanksenter image description here
enter image description here
body{
font-family: Verdana, Geneva, Tahoma, sans-serif;
max-width: 100%;
}
.content {
max-width: 100%;
margin-left: 0px;
margin-right: 0px;
margin-top: 0px;
}
div.logo {
width: 100%;
height: 200px;
background-color: rgb(147, 235, 238);
}
div.navi {
background-color: rgb(228, 226, 217);
width: 100%;
height: 50px;
margin-top: 15px;
text-align: center;
font-size: 19px;
font-family: Verdana, Geneva, Tahoma, sans-serif;
padding-top: 1px;
margin-bottom: 1px;
}
p {
color: rgb(97, 87, 226);
}
.para2{
color: black;
}
p.nav {
position: relative;
bottom: 5px;
border-style: solid;
}
a:link {
text-decoration: none;
color: rgb(97, 87, 226);
}
img {
margin-left: 20px;
width: 400px;
}
/* inner body styling */
div.inner-body {
background-image: url(image/book2.png);
margin-bottom: 20px;
margin-right: 0px;
max-width: 100%;
border-style: solid;
margin-top: 20px;
height: 1200px;
position: relative;
}
.header {
width: 700px;
position: relative;
left:1000px;
left: 338px;
font-size: 30px;
}
.para {
width: 800px;
position: relative;
left:345px;
top:74px;
background-color: rgb(206, 200, 180);
font-size: 25px;
font-family: Verdana, Geneva, Tahoma, sans-serif;
border-radius: 20px;
padding: 5px;
}
form {
padding: 20px;
border-radius: 20px;
width: fit-content;
font-family: Verdana, Geneva, Tahoma, sans-serif;
position: relative;
left:350px;
top:100px;
background-color: rgb(240, 239, 228);
}
.error {
color: red;
font-size: 15px;
font-family: Verdana, Geneva, Tahoma, sans-serif;
}
.error1 {
color: red;
font-size: 15px;
font-family:Verdana, Geneva, Tahoma, sans-serif;
}
.navi2 {
width: fit-content;
width: 300px;
height: 600px;
position:absolute;
bottom: 600px;
background-color: cadetblue;
font-size: 20px;
border-radius: 20px;
top:300px;
}
.user-links {
position: relative;
left:20px;
bottom:30px;
}
.user-links:link{
color: brown;
}
.userlogo {
width: 200px;
border-radius: 100px;
position: relative;
left: 30px;
bottom: 100px;
}
.btn {
width: 100px;
border-radius: 5px;
margin-top: 10px;
}
/* footer styling */
.emaillogo, .telelogo {
width: 20px;
}
div.foot {
background-color: brown;
}
footer{
background-color: rgb(126, 226, 230);
height: 200px;
}
.footimage {
width: 400px;
height: fit-content;
margin: 0;
}
div.contact{
width: fit-content;
height: 200px;
height: fit-content;
position: relative;
left: 400px;
bottom: 185px;
font-size: 12px;
}
.usefullinks {
width: fit-content;
font-size: 12px;
position: relative;
left:750px;
bottom:280px;
height: fit-content;
}
.connect {
width: fit-content;
position: relative;
left: 1000px ;
bottom: 400px;
font-size: 12px;
height: fit-content;
}
.fb, .tw, .yt, .ln {
width: 50px;
border-radius: 10px;
}
/* Media Queries */
#media screen and (max-width:915px) {
div.logo {
width: 100%;
height: 200px;
background-color: rgb(147, 235, 238);
}
.content{
width: 100%;
margin: 10px;
padding: 0;
}
div.inner-body {
background-image: url(image/book2.png);
border-style: solid;
margin-top: 15px;
margin-bottom: 15px;
width: 100%;
position: relative;
}
div.navi {
width: 980px;
font-size: 30px;
padding-bottom: 90px;
}
.inner-body {
width: 100%;
}
.header{
left:50px;
}
.para{
width: 700px;
display: block;
left: 25px;
font-size: 35px;
padding:30px;
top:20px;
}
form {
width: 600px;
left: 60px;
font-size: 20px;
}
.navi2 {
display: none;
}
.usefullinks{
display: inline-block;
}
.connect{
display: none;
}
.contact {
display: block;
}
}
#media screen and (max-width:415px) {
.content{
width: 100%;
margin: 0;
padding: 0;
}
body {
margin: 0;
}
.inner-body {
width: 100%;
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="log-it-reports.css">
<script src="log-it-reports.js"></script>
<title>Document</title>
</head>
<body>
<div class= "content">
<div class="logo">
<img src="image/logo1.png" alt="Academy Logo" >
</div>
<div class="navi">
<p id="nav">
Home |
Academics |
Services |
Covid-19 |
Students & Parents |
Transcripts |
Staff |
Career |
Events |
Student Account |
</p>
</div>
<div class="inner-body">
<div class = "header" >
<h1>Steps For IT-Issues Logging:</h1>
</div>
<div class="para">
<p class="para2">Please read the following instructions before submitting a report:</p>
<ol>
<li>Fill out all of the fields.</li>
<li>Use a valid email.</li>
<li>Select a problem type.</li>
<li>Be as detailed as possible so that the IT staff could address the issue properly (100 characters minumum).</li>
<li>Normally most issues get addressed within 2 hours, please be patient.</li>
</ol>
</div>
<div class="form1">
<form method="GET" onsubmit=" return formValidations() " action="log-it-reports.html"><br>
<div class="error1" id= "errorMsg"></div>
<div>
<label for="subject"><b>Subject:</label>
<input id="subject" type="text" placeholder="Subject Title" >
</div><br>
<div class="error" id= "errorMsg2"></div>
<div>
<label for="email"><b>Email:</label>
<input id="email" type="email" placeholder="staff#wearview.com">
</div><br>
<div class="error" id= "errorMsg3"></div>
<div>
<select name="techtype" id="problemtypes">
<option value="">Problem Type</option>
<option value="Hardware">Hardware</option>
<option value="Software">Software</option>
<option value="Other">Other</option>
</select>
</div><br>
<div class="error" id= "errorMsg4"></div>
<div>
<textarea id="description" placeholder="Description goes here" name="descript" rows="15" cols="50"></textarea>
</div>
<div>
<button type="submit" class="btn">Submit</button>
<input type="checkbox" id="notify" name="notify" value="">
<label for="notify">Inform me by email when issue is resolved.</label>
</div>
</form>
</div>
<div class="navi2">
<div class="userimage">
<img class="userlogo" src="image/userlogo.png" alt="User Image">
</div>
<div class="user-links">
<navi>
<a class="staffname" href="staffname.html" title=" Staff Name">Staff Name</a> <br><br>
Inbox <br><br>
Notifications <br><br>
Files <br><br>
Settings <br><br>
Help <br><br>
QR For Mobile <br><br>
Log Out
</navi>
</div>
</div>
</div>
<div class="foot">
<footer id = "footy">
<div>
<img class="footimage" src="image/logo1.png" alt="Academy Logo" width="400px">
</div>
<div class="contact">
<h3>Contact Us</h3>
<p><img class="emaillogo" src="image/email (2).png" alt="emaillogo"> :wearview_academy#wearview.com</p>
<p><img class="telelogo" src="image/tele.png" alt="telelogo"> :+2499100000000</p>
</div>
<div class="usefullinks">
<h3>Useful Links</h3>
<ul>
<li>Career</li>
<li>Report A Website Issue</li>
<li>About Us</li>
<li>Covid-19</li>
<li>Events</li>
</ul>
</div>
<div class="connect">
<h3>Connect With Us </h3><br>
<img class="fb" src="image/fb.png" alt = "Facebook" />
<img class="tw" src="image/tw.jpg" alt = "Twitter" />
<img class="yt" src="image/you.png" alt = "Youtube" />
<img class="ln" src="image/linkd.png" alt = "LinkedIn" />
</div>
</footer>
</div>
</div>
</body>
</html>
Because of the default browser stylesheet, the body has a margin set. You can remove it with the following CSS reset:
body {
margin: 0;
}
Also, your .content has a margin set to 10px, which adds space to the bottom, remove it when you don't want it or only apply it to the top, right and left using:
margin: 10px 10px 0 10px
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="log-it-reports.css">
<script src="log-it-reports.js"></script>
<title>Document</title>
<style>
body {
font-family: Verdana, Geneva, Tahoma, sans-serif;
max-width: 100%;
margin: 0
}
.content {
max-width: 100%;
margin-left: 0px;
margin-right: 0px;
margin-top: 0px;
}
div.logo {
width: 100%;
height: 200px;
background-color: rgb(147, 235, 238);
}
div.navi {
background-color: rgb(228, 226, 217);
width: 100%;
height: 50px;
margin-top: 15px;
text-align: center;
font-size: 19px;
font-family: Verdana, Geneva, Tahoma, sans-serif;
padding-top: 1px;
margin-bottom: 1px;
}
p {
color: rgb(97, 87, 226);
}
.para2 {
color: black;
}
p.nav {
position: relative;
bottom: 5px;
border-style: solid;
}
a:link {
text-decoration: none;
color: rgb(97, 87, 226);
}
img {
margin-left: 20px;
width: 400px;
}
/* inner body styling */
div.inner-body {
background-image: url(image/book2.png);
margin-bottom: 20px;
margin-right: 0px;
max-width: 100%;
border-style: solid;
margin-top: 20px;
height: 1200px;
position: relative;
}
.header {
width: 700px;
position: relative;
left: 1000px;
left: 338px;
font-size: 30px;
}
.para {
width: 800px;
position: relative;
left: 345px;
top: 74px;
background-color: rgb(206, 200, 180);
font-size: 25px;
font-family: Verdana, Geneva, Tahoma, sans-serif;
border-radius: 20px;
padding: 5px;
}
form {
padding: 20px;
border-radius: 20px;
width: fit-content;
font-family: Verdana, Geneva, Tahoma, sans-serif;
position: relative;
left: 350px;
top: 100px;
background-color: rgb(240, 239, 228);
}
.error {
color: red;
font-size: 15px;
font-family: Verdana, Geneva, Tahoma, sans-serif;
}
.error1 {
color: red;
font-size: 15px;
font-family: Verdana, Geneva, Tahoma, sans-serif;
}
.navi2 {
width: fit-content;
width: 300px;
height: 600px;
position: absolute;
bottom: 600px;
background-color: cadetblue;
font-size: 20px;
border-radius: 20px;
top: 300px;
}
.user-links {
position: relative;
left: 20px;
bottom: 30px;
}
.user-links:link {
color: brown;
}
.userlogo {
width: 200px;
border-radius: 100px;
position: relative;
left: 30px;
bottom: 100px;
}
.btn {
width: 100px;
border-radius: 5px;
margin-top: 10px;
}
/* footer styling */
.emaillogo,
.telelogo {
width: 20px;
}
div.foot {
background-color: brown;
}
footer {
background-color: rgb(126, 226, 230);
/* height: 200px; */
}
.footimage {
width: 400px;
height: fit-content;
margin: 0;
}
div.contact {
width: fit-content;
height: 200px;
height: fit-content;
position: relative;
left: 400px;
bottom: 185px;
font-size: 12px;
}
.usefullinks {
width: fit-content;
font-size: 12px;
position: relative;
left: 750px;
bottom: 280px;
height: fit-content;
}
.connect {
width: fit-content;
position: relative;
left: 1000px;
bottom: 400px;
font-size: 12px;
height: fit-content;
}
.fb,
.tw,
.yt,
.ln {
width: 50px;
border-radius: 10px;
}
/* Media Queries */
#media screen and (max-width:915px) {
div.logo {
width: 100%;
height: 200px;
background-color: rgb(147, 235, 238);
}
.content {
width: 100%;
/* margin: 10px; */
padding: 0;
}
div.inner-body {
background-image: url(image/book2.png);
border-style: solid;
margin-top: 15px;
margin-bottom: 15px;
width: 100%;
position: relative;
}
div.navi {
width: 980px;
font-size: 30px;
padding-bottom: 90px;
}
.inner-body {
width: 100%;
}
.header {
left: 50px;
}
.para {
width: 700px;
display: block;
left: 25px;
font-size: 35px;
padding: 30px;
top: 20px;
}
form {
width: 600px;
left: 60px;
font-size: 20px;
}
.navi2 {
display: none;
}
.usefullinks {
display: inline-block;
}
.connect {
display: none;
}
.contact {
display: block;
}
}
#media screen and (max-width:415px) {
.content {
width: 100%;
margin: 0;
padding: 0;
}
body {
margin: 0;
}
.inner-body {
width: 100%;
}
}
</style>
</head>
<body>
<div class="content">
<div class="logo">
<img src="image/logo1.png" alt="Academy Logo">
</div>
<div class="navi">
<p id="nav">
Home |
Academics |
Services |
Covid-19 |
Students & Parents |
Transcripts |
Staff |
Career |
Events |
Student Account |
</p>
</div>
<div class="inner-body">
<div class="header">
<h1>Steps For IT-Issues Logging:</h1>
</div>
<div class="para">
<p class="para2">Please read the following instructions before submitting a report:</p>
<ol>
<li>Fill out all of the fields.</li>
<li>Use a valid email.</li>
<li>Select a problem type.</li>
<li>Be as detailed as possible so that the IT staff could address the issue properly (100 characters
minumum).</li>
<li>Normally most issues get addressed within 2 hours, please be patient.</li>
</ol>
</div>
<div class="form1">
<form method="GET" onsubmit=" return formValidations() " action="log-it-reports.html"><br>
<div class="error1" id="errorMsg"></div>
<div>
<label for="subject"><b>Subject:</label>
<input id="subject" type="text" placeholder="Subject Title">
</div><br>
<div class="error" id="errorMsg2"></div>
<div>
<label for="email"><b>Email:</label>
<input id="email" type="email" placeholder="staff#wearview.com">
</div><br>
<div class="error" id="errorMsg3"></div>
<div>
<select name="techtype" id="problemtypes">
<option value="">Problem Type</option>
<option value="Hardware">Hardware</option>
<option value="Software">Software</option>
<option value="Other">Other</option>
</select>
</div><br>
<div class="error" id="errorMsg4"></div>
<div>
<textarea id="description" placeholder="Description goes here" name="descript" rows="15"
cols="50"></textarea>
</div>
<div>
<button type="submit" class="btn">Submit</button>
<input type="checkbox" id="notify" name="notify" value="">
<label for="notify">Inform me by email when issue is resolved.</label>
</div>
</form>
</div>
<div class="navi2">
<div class="userimage">
<img class="userlogo" src="image/userlogo.png" alt="User Image">
</div>
<div class="user-links">
<navi>
<a class="staffname" href="staffname.html" title=" Staff Name">Staff Name</a> <br><br>
Inbox <br><br>
Notifications <br><br>
Files <br><br>
Settings <br><br>
Help <br><br>
QR For Mobile <br><br>
Log Out
</navi>
</div>
</div>
</div>
<div class="foot">
<footer id="footy">
<div>
<img class="footimage" src="image/logo1.png" alt="Academy Logo" width="400px">
</div>
<div class="contact">
<h3>Contact Us</h3>
<p><img class="emaillogo" src="image/email (2).png" alt="emaillogo"> :wearview_academy#wearview.com
</p>
<p><img class="telelogo" src="image/tele.png" alt="telelogo"> :+2499100000000</p>
</div>
<div class="usefullinks">
<h3>Useful Links</h3>
<ul>
<li>Career</li>
<li>Report A Website Issue</li>
<li>About Us</li>
<li>Covid-19</li>
<li>Events</li>
</ul>
</div>
<div class="connect">
<h3>Connect With Us </h3><br>
<a href="https://www.facebook.com" title="facebook"><img class="fb" src="image/fb.png"
alt="Facebook" /></a>
<a href="https://www.twitter.com" title="twitter"><img class="tw" src="image/tw.jpg"
alt="Twitter" /></a>
<a href="https://www.youtube.com" title="youtube"><img class="yt" src="image/you.png"
alt="Youtube" /></a>
<a href="https://www.linkedin.com" title="linkedin"><img class="ln" src="image/linkd.png"
alt="LinkedIn" /></a>
</div>
</footer>
</div>
</div>
</body>
</html>
Note that I also removed the height of the footer in the example above, since it causes some spacing as well.

Is there a way to make the text works normally?

So I'm trying to make an easy website for a server user ordering stuffs. But now I have a problem that will affect about the Navigator text.
Now it's looks like this:
As you can see in the code below, there should be a navigator text above the Back button and also the Categories button below should be shows like the back and prices button above too since they're the same code.
I tried for some other way but it's kinda out my coding range so I decide to find on Google but I don't find any helpful solve.
Is that actually can be fix?
Conclusion: problem
"Navigator" text disappear at 100% zoom view
Category buttons can't shows like buttons above (same codes as buttons above but different ID)
.title {
color: #66d4ff;
background-color: #444444;
font-size: 62px;
text-align: center;
border: solid 10px #66d4ff;
padding: 50px;
margin-left: 302px;
}
body {
background: #444444;
}
button {
color: #66d4ff;
background: #444444;
font-size: 30px;
font-family: 'Times New Roman', Times, serif;
}
a {
color: #66d4ff
}
nav {
position: fixed;
top: 0;
left: 0;
width: 300px;
height: 100%;
background: #4a4a4a;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
border-right: solid 2px #ffffff;
overflow-y: scroll;
}
.nav::-webkit-scrollbar {
display: hidden;
}
main {
color: #66d4ff;
background-color: #444444;
font-size: 20px;
}
.navigator {
display: block;
margin-bottom: 50px;
color: #66d4ff;
font-size: 35px;
text-align: center;
}
.store {
padding: 0 99.5px 0 99.5px;
display: block;
margin-top: 25px;
margin-bottom: 25px;
}
.prices {
padding: 0 93.5px 0 93.5px;
display: block;
margin-top: 25px;
margin-bottom: 25px;
}
.Woods {
padding: 0 80px 0 80px;
display: block;
margin-top: 25px;
margin-bottom: 25px;
}
.Stones {
padding: 0 80px 0 80px;
display: block;
margin-top: 25px;
margin-bottom: 25px;
}
.Brewing {
padding: 0 80px 0 80px;
display: block;
margin-top: 25px;
margin-bottom: 25px;
}
.Enchanting {
padding: 0 80px 0 80px;
display: block;
margin-top: 25px;
margin-bottom: 25px;
}
.Color {
padding: 0 80px 0 80px;
display: block;
margin-top: 25px;
margin-bottom: 25px;
}
.Nether {
padding: 0 80px 0 80px;
display: block;
margin-top: 25px;
margin-bottom: 25px;
}
.Redstone {
padding: 0 80px 0 80px;
display: block;
margin-top: 25px;
margin-bottom: 25px;
}
<main>
<div class="title">
<t1>MineGlobe | IchorDragon's Store</t1>
</div>
</main>
<nav>
<div id="navigator">
<p class="navigator">Navigator</p>
<div>
<button class="store">Back</button>
<button class="prices">Prices</button>
</div>
</div>
<div id="category">
<p class="navigator">Select Category</p>
<div>
<button class="Woods" onclick="document.getElementById('Woods').scrollIntoView();"><a style="text-decoration: none;">Woods</a></button>
<button class="Stones" onclick="document.getElementById('Stones').scrollIntoView();"><a style="text-decoration: none;">Stones</a></button>
<button class="ArmorsWeapon" onclick="document.getElementById('ArmorsWeapon').scrollIntoView();"><a style="text-decoration: none;">Armors & Weapons</a></button>
<button class="Brewing" onclick="document.getElementById('Brewing').scrollIntoView();"><a style="text-decoration: none;">Brewing</a></button>
<button class="Enchanting" onclick="document.getElementById('Enchanting').scrollIntoView();"><a style="text-decoration: none;">Enchanting</a></button>
<button class="Color" onclick="document.getElementById('Color').scrollIntoView();"><a style="text-decoration: none;">Color</a></button>
<button class="Redstone" onclick="document.getElementById('Redstone').scrollIntoView();"><a style="text-decoration: none;">Redstone</a></button>
<button class="Nether" onclick="document.getElementById('Nether').scrollIntoView();"><a style="text-decoration: none;">Nether</a></button>
</div>
</div>
</nav>
I honestly can't explain all the changes made, there are too many. My attempt was to clean up your code and give you a working layout (hopefully that's what you were looking for).
In 2021 there are better layouts compared to fixed menu (with grids for example), which work better in responsive and are more clean. But it would require an in-depth study that's up to you.
body {
background-color: #444444;
}
main {
width: 100%;
padding-left: 302px;
box-sizing: border-box;
overflow:hidden;
color: #66d4ff;
background-color: #444444;
font-size: 20px;
}
.title {
padding: 50px;
border: solid 10px #66d4ff;
font-size: 62px;
text-align: center;
}
nav {
position: fixed;
top: 0;
left: 0;
width: 300px;
height: 100%;
background-color: #4a4a4a;
border-right: solid 2px #ffffff;
overflow-y: scroll;
color: #66d4ff;
}
.navigator {
display: block;
margin-bottom: 50px;
font-size: 35px;
text-align: center;
}
button {
width:96%;
margin: 10px auto;
background: #444444;
color: #66d4ff;
font-size: 30px;
font-family: 'Times New Roman', Times, serif;
cursor:pointer;
}
<body>
<main>
<div class="title">
<t1>MineGlobe | IchorDragon's Store</t1>
</div>
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/> This is a long page content...
<br/>
</main>
<nav>
<div id="navigator">
<p class="navigator">Navigator</p>
<div>
<button>Back</button>
<button>Prices</button>
</div>
</div>
<div id="category">
<p class="navigator">Select Category</p>
<div>
<button class="Woods items" onclick="document.getElementById('Woods').scrollIntoView();">Woods</button>
<button class="Stones items" onclick="document.getElementById('Stones').scrollIntoView();">Stones</button>
<button class="ArmorsWeapon items" onclick="document.getElementById('ArmorsWeapon').scrollIntoView();">Armors & Weapons</button>
<button class="Brewing items" onclick="document.getElementById('Brewing').scrollIntoView();">Brewing</button>
<button class="Enchanting items" onclick="document.getElementById('Enchanting').scrollIntoView();">Enchanting</button>
<button class="Color items" onclick="document.getElementById('Color').scrollIntoView();">Color</button>
<button class="Redstone items" onclick="document.getElementById('Redstone').scrollIntoView();">Redstone</button>
<button class="Nether items" onclick="document.getElementById('Nether').scrollIntoView();">Nether</button>
</div>
</div>
</nav>
</body>
"Navigator" text disappear: This is because justify-content: center; on the nav
Buttons will not take a width of 100% even with display: block (more information), so it needs to be added. Note that since all cathegories have the same code a single class is enough.
.title {
color: #66d4ff;
background-color: #444444;
font-size: 62px;
text-align: center;
border: solid 10px #66d4ff;
padding: 50px;
margin-left: 302px;
}
body {
background: #444444;
}
button {
color: #66d4ff;
background: #444444;
font-size: 30px;
font-family: 'Times New Roman', Times, serif;
}
a {
color: #66d4ff
}
nav {
position: fixed;
top: 0;
left: 0;
width: 300px;
height: 100%;
background: #4a4a4a;
display: flex;
flex-direction: column;
align-items: center;
/* justify-content: center; */
border-right: solid 2px #ffffff;
overflow-y: scroll;
}
.nav::-webkit-scrollbar {
display: hidden;
}
main {
color: #66d4ff;
background-color: #444444;
font-size: 20px;
}
.navigator {
display: block;
margin-bottom: 50px;
color: #66d4ff;
font-size: 35px;
text-align: center;
}
.store {
padding: 0 99.5px 0 99.5px;
display: block;
margin-top: 25px;
margin-bottom: 25px;
}
.prices {
padding: 0 93.5px 0 93.5px;
display: block;
margin-top: 25px;
margin-bottom: 25px;
}
.category {
padding: 0 80px 0 80px;
display: block;
margin-top: 25px;
margin-bottom: 25px;
width: 100%;
}
<main>
<div class="title">
<t1>MineGlobe | IchorDragon's Store</t1>
</div>
</main>
<nav>
<div id="navigator">
<p class="navigator">Navigator</p>
<div>
<button class="store">Back</button>
<button class="prices">Prices</button>
</div>
</div>
<div id="category">
<p class="navigator">Select Category</p>
<div>
<button class="category Woods" onclick="document.getElementById('Woods').scrollIntoView();"><a style="text-decoration: none;">Woods</a></button>
<button class="category Stones" onclick="document.getElementById('Stones').scrollIntoView();"><a style="text-decoration: none;">Stones</a></button>
<button class="category ArmorsWeapon" onclick="document.getElementById('ArmorsWeapon').scrollIntoView();"><a style="text-decoration: none;">Armors & Weapons</a></button>
<button class="category Brewing" onclick="document.getElementById('Brewing').scrollIntoView();"><a style="text-decoration: none;">Brewing</a></button>
<button class="category Enchanting" onclick="document.getElementById('Enchanting').scrollIntoView();"><a style="text-decoration: none;">Enchanting</a></button>
<button class="category Color" onclick="document.getElementById('Color').scrollIntoView();"><a style="text-decoration: none;">Color</a></button>
<button class="category Redstone" onclick="document.getElementById('Redstone').scrollIntoView();"><a style="text-decoration: none;">Redstone</a></button>
<button class="category Nether" onclick="document.getElementById('Nether').scrollIntoView();"><a style="text-decoration: none;">Nether</a></button>
</div>
</div>
</nav>

Why is my div moving to right whenever I add "overflow-y: scroll"?

Why is my div moving to right whenever I specify overflow-y: scroll on the .messages element?
Even when I use margin-left: -10px;, it doesn't move to the left!
#import url(http://fonts.googleapis.com/css?family=Roboto:300,400,900);
#import url(http://weloveiconfonts.com/api/?family=entypo);
[class*="entypo-"]:before {
font-family: 'entypo', sans-serif;
}
* {
box-sizing: border-box;
margin: 0;
}
body {
background: #BDC1C6;
font-family: 'Roboto';
}
p {
font-weight: 300;
}
.chat {
width: 300px;
background: #fff;
margin: 0 auto;
}
header {
background: #35323C;
height: 50px;
padding: 5px 10px;
}
.menu-icon {
background: #2F2E33;
padding: 5px 10px;
float: left;
font-size: 3em;
line-height: 0.5em;
color: #fff;
border-radius: 3px;
}
.menu-icon:hover {
background: #39caad;
cursor: pointer;
}
h1 {
float: right;
color: #fff;
margin: 5px;
font-weight: 300;
font-size: 1.3em;
}
.menulist {
background: #39caad;
color: #fff;
text-align: center;
padding: 10px;
}
.menulist:hover {
cursor: pointer;
background: rgb(255, 0, 0);
text-align: center;
padding: 20px;
}
.openchat {
background: #39caad;
color: #fff;
text-align: center;
padding: 5px;
}
.new {
background: rgb(57, 202, 173);
color: #fff;
text-align: center;
padding: 20px;
}
.new:hover {
cursor: pointer;
background: rgba(57, 202, 173, 0.9);
}
.messages {
padding: 10px;
overflow-y: scroll;
height: 300px;
}
.message {
float: left;
width: 100%;
margin: 10px 0;
border-bottom: 1px solid #ccc;
}
.message p {
font-size: 0.8em;
width: 90%;
margin: 5px 0;
}
.message:hover {
background: #39caad;
cursor: pointer;
}
.messageSender {
text-align: right;
float: right;
width: 100%;
margin: 10px 0;
border-bottom: 1px solid #ccc;
}
.messageSender p {
font-size: 0.8em;
width: 90%;
margin: 5px 0;
}
.messageReceiver {
float: left;
width: 100%;
margin: 10px 0;
border-bottom: 1px solid #ccc;
}
.messageReceiver p {
font-size: 0.8em;
width: 90%;
margin: 5px 0;
}
img {
border-radius: 100%;
float: left;
margin: 0 10px 15px 0;
}
img.sender {
border-radius: 100%;
float: right !important;
margin: 0 10px 15px 0;
width: 35px;
height: 35px;
}
img.receiver {
border-radius: 100%;
float: left;
margin: 0 10px 15px 0;
width: 35px;
height: 35px;
}
p.time {
color: rgba(0, 0, 0, 0.5);
font-weight: 400;
}
p.chattime {
color: rgba(0, 0, 0, 0.5);
font-weight: 400;
font-size: 10px;
}
h2 {
font-size: 1em;
font-weight: 400;
}
h2:after {
content: '';
display: inline-block;
height: 10px;
width: 10px;
background: #39caad;
border-radius: 100%;
margin-left: 5px;
}
h2.send:before {
content: '';
display: inline-block;
height: 10px;
width: 10px;
background: #39caad;
border-radius: 100%;
margin-left: 5px;
}
h2.send:after {
content: '';
height: 0px;
width: 0px;
border-radius: 00%;
margin-right: 5px;
}
footer {
width: 100%;
background: #fff;
padding: 10px;
text-align: center;
font-size: 0.8em;
}
footer p:before,
footer p:after {
content: ' - ';
}
<div class="chat">
<header>
<div class="menu-icon" id="menubutton"><span class="entypo-menu"></span>
</div>
<h1>Chats</h1>
</header>
<?php include( "menu.php"); ?>
<div class="openchat" id="openchat">
<img style="width:35px; height: 35px;" src="http://dtechnomist.com/clients/chat/assets/users/2.jpg" />
<h2>XYZ</h2>
<p class="time">Online</p>
</div>
<section class="messages" id="chatBox">
<div class="messageReceiver">
<img class="receiver" src="assets/users/1.jpg">
<h2 class="receive">Admin 1</h2>
<p class="chattime">12:00:00 AM, 3rd Jan16</p>
<p>There ?</p>
</div>
<br>
<br>
<div class="messageSender">
<img class="sender" src="assets/users/2.jpg">
<h2 class="send"> You</h2>
<p class="chattime">12:00:00 AM, 4th Jan16</p>
<p>Yes</p>
</div>
<br>
<br>
<div class="messageReceiver">
<img class="receiver" src="http://dtechnomist.com/clients/chat/assets/users/1.jpg">
<h2 class="receive">Admin 1</h2>
<p class="chattime">08:59:33 PM, 4th Jan16</p>
<p></p>
</div>
<div class="messageReceiver">
<img class="receiver" src="assets/users/1.jpg">
<h2 class="receive">Admin 1</h2>
<p class="chattime">09:05:55 PM, 4th Jan16</p>
<p>hi</p>
</div>
<br>
<br>
<div class="messageReceiver">
<img class="receiver" src="http://dtechnomist.com/clients/chat/assets/users/1.jpg">
<h2 class="receive">Admin 1</h2>
<p class="chattime">09:06:02 PM, 4th Jan16</p>
<p>ok</p>
</div>
<br>
<br>
<div class="messageSender">
<img class="sender" src="http://dtechnomist.com/clients/chat/assets/users/2.jpg">
<h2 class="send"> You</h2>
<p class="chattime">09:06:58 PM, 4th Jan16</p>
<p>hello</p>
</div>
<br>
<br>
<div class="messageSender">
<img class="sender" src="http://dtechnomist.com/clients/chat/assets/users/2.jpg">
<h2 class="send"> You</h2>
<p class="chattime">09:07:08 PM, 4th Jan16</p>
<p>hi</p>
</div>
<br>
<br>
<div class="messageSender">
<img class="sender" src="http://dtechnomist.com/clients/chat/assets/users/2.jpg">
<h2 class="send"> You</h2>
<p class="chattime">09:07:31 PM, 4th Jan16</p>
<p>asd</p>
</div>
</section>
<section class="write">
<textarea type="text" name="msg" id="msg" style="width:85%; height: 30px; margin: 0px 0px 0px 2%; resize: none" placeholder="Type your message here..."></textarea>
<button name="send" id="sendMsg" style="width: 9%;"><span class="entypo-plus"></span>Send</button>
</section>
<footer>
<p>Designed by Kashan Shah
</p>
</footer>
</div>
You're seeing this behavior due to collapsing margins.
When you add overflow-y: scroll to the element, a new block formatting context is established, which means that the .openchat element's vertical margin no longer collapses with the .messages element. Since the margins no longer collapse, the element is shifted to the right.
Margins of elements that establish new block formatting contexts (such as floats and elements with overflow other than visible) do not collapse with their in-flow children.
To resolve this issue, you could either add overflow: hidden to the .openchat element in order hide the overflowing margin (which essentially prevents the margin from adjoining):
Updated Example
.openchat {
background: #39caad;
color: #fff;
text-align: center;
padding: 5px;
overflow: hidden;
}
Alternatively, you could also just remove the margin-bottom from the child img element:
Updated Example
.openchat img {
margin-bottom: 0;
}

Different layouts on firefox and chrome

I'm developing a site where the header has cart button and search bar.
fiddle
My question is in chrome and firefox you will see different spaces between cart button and search input. Chrome version should be the right layout. Any suggestions? Help is appreciated.
body {
background: #000000;
}
img[alt="cart-icon"] {
width: 20px;
}
img[alt="telephone-icon"] {
/*width: 18px;*/
margin-top: -4px;
margin-right: 3px;
}
.right {
float: right;
text-align: right;
margin-top: 21px;
}
.tel-no {
color: #fff;
margin-top: -7px;
margin-right: 19px;
font-weight: normal;
text-align: right;
font-size: 15px;
font-family: avenirreg;
}
.tel-no p {
margin-bottom: 0;
display: inline;
}
.cart1 {
float: right;
margin-top: 9px;
margin-right: 7px;
}
.top-cart .truncated {
display: none;
}
.header-search-form {
float: right;
}
.right input[type='text'] {
background-color: rgba(0, 0, 0, 0);
border: 1px solid #7B7672;
border-radius: 0;
width: 125px;
height: 21px;
padding-left: 5px;
margin-right: -19px;
color: #ccc !important;
}
.right input[type='text']:focus {
outline: none;
background-color: #444;
}
.right button[type='submit'] {
position: relative;
border: none;
/* background-size: 19px; */
background-size: 15px;
height: 25px;
width: 25px;
background: rgba(0, 0, 0, 0) url('../images/ico-search.png') no-repeat center center;
left: -11px;
top: 6px;
}
/* firefox*/
#-moz-document url-prefix() {
.header-row-1 button[type='submit'] {
position: relative;
border: none;
/* background-size: 19px; */
background-size: 15px;
height: 24px;
width: 25px;
background: rgba(0, 0, 0, 0) url('../images/ico-search.png') no-repeat center center;
left: 0px;
top: -25px;
}
}
.header-row-1 button[type='submit']:hover {
background-color: #ED1B24 !important;
}
.cart-label {
background-color: red;
color: #fff;
/* border-radius: 11px; */
padding: 2px 4px;
font-size: 9px;
position: relative;
top: -9px;
left: -11px;
}
<div class="right">
<div class="tel-no">
<img src="http://www.encorediamond.co.uk/skin/frontend/ecd/default/images/common/telephone-icon.fw.png" alt="telephone-icon">
<p><span>015395 67957</span>
</p>
</div>
<div class="cart1">
<a href="#header-cart" class="toggle-minicart skip-link skip-cart">
<!--<img src="" alt="cart-icon">
<span class="cart-label">5</span>-->
<img src="http://www.encorediamond.co.uk/skin/frontend/ecd/default/images/common/cart-icon.fw.png" alt="cart-icon">
<span class="cart-label">
0 </span>
</a>
</div>
<div class="col-lg-4 col-md-5 col-sm-5 col-xs-12 top-cart" style="display: none">
<div class="header-minicart">
<a href="#header-cart" class="skip-link skip-cart no-count">
<!--<span class="icon"></span>
<span class="label"> ( </span>
<span class="count"> )</span>-->
</a>
<div id="header-cart" class="block block-cart skip-content">
<div id="minicart-error-message" class="minicart-message"></div>
<div id="minicart-success-message" class="minicart-message"></div>
<div class="minicart-wrapper">
<p class="block-subtitle">Recently added item(s) <a class="close skip-link-close" href="#" title="Close">×</a>
</p>
<p class="empty">You have no items in your shopping cart.</p>
</div>
</div>
</div>
</div>
<form id="search_mini_form" action="http://www.encorediamond.co.uk/catalogsearch/result/" method="get">
<div class="header-search-form">
<input kl_virtual_keyboard_secure_input="on" autocomplete="off" id="search" name="q" value="" class="input-text" maxlength="128" type="text">
<button type="submit" title="Search" class="button"></button>
<div style="display: none;" id="search_autocomplete" class="search-autocomplete"></div>
<script type="text/javascript">
//<![CDATA[
var searchForm = new Varien.searchForm('search_mini_form', 'search', '');
searchForm.initAutocomplete('http://www.encorediamond.co.uk/catalogsearch/ajax/suggest/', 'search_autocomplete');
//]]>
</script>
</div>
</form>
<!-- <div class="navbar-toggle collapsed mobile-expand" data-toggle="collapse" data-target=".navbar-collapse"></div>--></div>
please include following in your CSS this style will apply only for firefox you can give margin bottom only for firefox
#-moz-document url-prefix() {
.cart1 {
margin-bottom: 5px;
}
you should use (Edited)
#search_mini_form {
float: right;
margin-top: 9px;/*Same as .cart1*/
}
instead of
.header-search-form {
float: right;
}
And replace position:relative with float:right; for .right button[type='submit']:
.right button[type='submit'] {
float:right;
border: none;
/* background-size: 19px; */
background-size: 15px;
height: 25px;
width: 25px;
background: rgba(0, 0, 0, 0) url('../images/ico-search.png') no-repeat center center;
left: -11px;
top: 6px;
}
#search_mini_form is the element containing your input, and it is the sibling element of your .cart1 element. So, if you want to set your layout using float, elements you want to position have to be siblings. That's why I set the floatproperty to the parent element of your input that is a sibling of .cart1
Exemple

Need help positioning the menu links in the footer

I am having trouble with my footer menu links and social icon buttons. I created the footer so that it will stretch across the entire browser window. However now when I lay the menu links and social media icons inside the div they are moving whenever the page is re-sized. What do I need to do in order to make the placement of the menu links and social media links stay in the proper place?
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>MECA Basketball Club</title>
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js?ver=3.0.1">
</script>
<script type="text/javascript" src="jQuery/infinite-rotator.js"></script>
<script type="text/javascript" src="jQuery/infinite-rotator-2.js"></script>
<script type="text/javascript" src="jQuery/infinite-rotator-3.js"></script>
<script type="text/javascript" src="jQuery/infinite-rotator-4.js"></script>
<style type="text/css">
body
{
background-image: url(img/backgroundimg.png);
background-repeat: repeat-x;
/*background-color:white;*/
}
#maincontainer
{
width: 1024px;
margin: 0 auto;
}
#header
{
position: absolute;
top: 0;
left: 0;
min-width: 100%;
height: 47px;
background-image: url(img/headerimg.png);
}
#headerlogo
{
position: absolute;
top: 0;
width: 201px;
height: 118px;
background-image: url(img/headerlogo_padding.png);
}
#header-nav-menu
{
position: relative;
left: 580px;
top: 0px;
width: 400px;
list-style-type: none;
}
.nav-button-header-menu-1
{
float: right;
font-family: Calibri;
color: white;
text-decoration: none;
width: 125px;
}
.nav-button-header-menu-2
{
float: right;
font-family: Calibri;
color: white;
text-decoration: none;
width: 104px;
}
.nav-button-header-menu-3
{
float: right;
font-family: Calibri;
color: white;
text-decoration: none;
width: 105px;
}
.nav-button-header-menu-1:hover
{
color: #d4d3d2;
}
.nav-button-header-menu-2:hover
{
color: #d4d3d2;
}
.nav-button-header-menu-3:hover
{
color: #d4d3d2;
}
#main-nav-container
{
width: 197px;
height: 500px;
float: left;
margin-top: 95px;
}
#mainnav
{
position: relative;
top: 0px;
left: 0px;
list-style-type: none;
margin: 0;
padding-left: 8px;
}
.navbutton-red-top
{
/*Button Style*/
display: block;
height: 40px;
width: 193px;
background-color: #c41002;
padding-top: 20px;
border-bottom: 1px solid;
border-color: #a30e03;
/*Text Style*/
font-family: Calibri;
font-weight: 800;
color: white;
text-align: center;
text-decoration: none;
/*Making Button Fancy*/
border-radius: 10px 10px 0px 0px;
box-shadow: 0px 3px 8px #515050;
}
.navbutton-red
{
/*Button Style*/
display: block;
height: 40px;
width: 193px;
background-color: #c41002;
padding-top: 20px;
border-bottom: 1px solid;
border-color: #a30e03;
/*Text Style*/
font-family: Calibri;
font-weight: 800;
color: white;
text-align: center;
text-decoration: none;
/*Making Button Fancy*/
box-shadow: 0px 3px 8px #515050;
}
.navbutton-black
{
/*Button Style*/
display: block;
height: 40px;
width: 193px;
background-color: black;
padding-top: 20px;
border-bottom: 1px solid;
border-color: #515050;
/*Text Style*/
font-family: Calibri;
font-weight: 800;
color: white;
text-align: center;
text-decoration: none;
/*Making Button Fancy*/
box-shadow: 0px 3px 8px #515050;
}
.navbutton-black-bottom
{
/*Button Style*/
display: block;
height: 40px;
width: 193px;
background-color: black;
padding-top: 20px;
border-bottom: 1px solid;
border-color: #515050;
/*Text Style*/
font-family: Calibri;
font-weight: 800;
color: white;
text-align: center;
text-decoration: none;
/*Making Button Fancy*/
border-radius: 0px 0px 10px 10px;
box-shadow: 0px 3px 8px #515050;
}
.navbutton-red-top:hover
{
background: #e91101;
}
.navbutton-red:hover
{
background: #e91101;
}
.navbutton-black:hover
{
background: #2c2b2b;
}
.navbutton-black-bottom:hover
{
background: #2c2b2b;
}
#content
{
background-color: white;
width: 1024px;
float: left;
box-shadow: 0px 3px 20px #515050;
}
#rotating-item-wrapper
{
position: relative;
margin-left: 240px;
margin-top: 20px;
padding: 150px;
}
.rotating-item
{
display: none;
position: absolute;
top: 0;
left: 0px;
}
#placeholderdiv
{
padding-left: 40px;
padding-top: 10px;
}
#slideshow
{
padding-left: 40px;
padding-top: 10px;
}
#video1
{
padding-left: 40px;
padding-top: 10px;
float: left;
}
.stats-offense
{
padding-left: 10px;
padding-top: 10px;
float: left;
}
#events1
{
padding-left: 40px;
padding-top: 10px;
float: left;
}
#rotating-item-wrapper-2
{
position: relative;
left: 455px;
top: 281px;
}
.rotating-item-2
{
display: none;
position: absolute;
top: 0;
left: 0px;
}
#rotating-item-wrapper-3
{
position: relative;
left: 240px;
top: 532px;
padding: 300px;
}
.rotating-item-3
{
display: none;
position: absolute;
top: 0;
left: 0px;
}
.stats-defense
{
position: relative;
left: 766px;
top: -68px;
overflow: auto;
padding-bottom: 206px;
}
#rotating-item-wrapper-4
{
position: relative;
left: 240px;
top: -260px;
padding: 35px;
}
.rotating-item-4
{
display: none;
position: absolute;
top: 0;
left: 0px;
}
#footer-home
{
position: absolute;
bottom: -600px;
left: 0;
min-width: 100%;
height: 200px;
background-image: url(img/footerimg.png);
}
#footer-nav-menu-left
{
position: absolute;
left: 0px;
list-style-type: none;
margin-left: 430px;
}
#footer-nav-menu-right
{
position: absolute;
list-style-type: none;
margin-left: 550px;
}
.nav-button-footer
{
font-family: Calibri;
color: white;
text-decoration: none;
}
.nav-button-footer:hover
{
color: #c5c5c4;
}
#SocialMedia
{
font-family: Calibri;
color: white;
}
#Facebook-icon
{
}
#Twitter-icon
{
}
</style>
</head>
<body>
<div id="maincontainer">
<div id="header"></div>
<div id="headerlogo"></div>
<ul id="header-nav-menu">
<li><a class="nav-button-header-menu-3" href="#RegisterLeague">Login</a></li>
<li><a class="nav-button-header-menu-2" href="#RegisterLeague">Join The
Club</a></li>
<li><a class="nav-button-header-menu-1" href="#RegisterLeague">Register
League</a></li>
</ul>
<div id="content">
<div id="main-nav-container">
<ul id="mainnav">
<li><a class="navbutton-red-top" href="#stats">STATS</a></li>
<li><a class="navbutton-red" href="#stats">EVENTS</a></li>
<li><a class="navbutton-red" href="#stats">FIND A LEAGUE</a></li>
<li><a class="navbutton-red" href="#stats">SCHEDULE</a></li>
<li><a class="navbutton-black" href="#stats">BECOME A REFEREE</a></li>
<li><a class="navbutton-black" href="#stats">REGISTER LEAGUE</a></li>
<li><a class="navbutton-black-bottom" href="#stats">JOIN THE CLUB</a>
</li>
</ul>
</div>
<div id="rotating-item-wrapper">
<img class="rotating-item" src="img/ContentArea1/AdOne/MainAd1.png" />
<img class="rotating-item" src="img/ContentArea1/AdOne/MainAd2.png" />
</div>
<div id="video1">
<img src="img/ContentArea1/Video/video1img.png" />
</div>
<div class="stats-offense">
<img src="img/ContentArea1/Stats/stats1img.png" />
</div>
<div id="events1">
<img src="img/ContentArea1/Events/events1.png" />
</div>
<div id="rotating-item-wrapper-2">
<img class="rotating-item-2" src="img/ContentArea1/AdTwo/Ad2Img.png" />
<img class="rotating-item-2" src="img/ContentArea1/AdTwo/Ad23Img.png" />
</div>
<div id="rotating-item-wrapper-3">
<img class="rotating-item-3" src="img/ContentArea1/AdThree/Ad3Img.png" />
<img class="rotating-item-3" src="img/ContentArea1/AdThree/Ad4Img.png" />
</div>
<div class="stats-defense">
<img src="img/ContentArea1/Events/events1.png" />
</div>
<div id="rotating-item-wrapper-4">
<img class="rotating-item-4" src="img/ContentArea1/VBanner/vbanner1img.png"
/>
<img class="rotating-item-4" src="img/ContentArea1/VBanner/vbanner2img.png"
/>
</div>
</div>
<div id="footer-home">
<ul id="footer-nav-menu-left">
<li><a class="nav-button-footer" href="#RegisterLeague">About</a></li>
<li><a class="nav-button-footer" href="#RegisterLeague">Contact Us</a></li>
<li><a class="nav-button-footer" href="#RegisterLeague">Press Inquiry</a>
</li>
</ul>
<ul id="footer-nav-menu-right">
<li><a class="nav-button-footer" href="#RegisterLeague">Terms of Use</a>
</li>
<li><a class="nav-button-footer" href="#RegisterLeague">Privacy Policy</a>
</li>
</ul>
<div id="SocialMedia">Follow Us</div>
<div id="Facebook-icon">
<img src="img/SocialMediaIcon/FB_icon.png" alt="Facebook" /></div>
<div id="Twitter-icon">
<img src="img/SocialMediaIcon/Twitter_icon.png" alt="Twitter" /></div>
<div id="Instagram-icon">
<img src="img/SocialMediaIcon/IG_icon.png" alt="Instagram" /></div>
<div id="YouTube-icon">
<img src="img/SocialMediaIcon/YouTube_icon.png" alt="YouTube" /></div>
</div>
</div>
</body>
</html>
Click the link below to see how it currently looks:
http://www.micre8tivegroup.com/default.html
As I was writing on the comments section, this is not a single thing issue. This is a problem with many things being done incorrectly. But mainly:
The structure of the page is poorly designed. I understand that this page is more of testing, but creating a web site is not directly getting into coding but analyzing and designing a solution. Coding may be the "fun part", but it's not the most important.
The positioning of the elements is incorrect. As a personal recommendation: avoid using position:absolute for controls. In your page, the logo is a good example of position absolute (although it could be done in other ways), all the rest absolute positioning shouldn't be there and breaks the page.
Here you have a link to a version the solves the position problems that you commented about: http://muzaw.com/test.html. Test it, and let me know if that's what you were aiming for (I know not everything will fit perfectly but that's just a matter of changing some values in the CSS).
The changes that I made:
Removed the position absolute for the header and footer (or changed to position:relative)
Restructured the page to fit a "more convenient" web page design.
Changed the CSS of some of the elements.
I understand you are learning, that I sound patronizing, and that my comments and answer may frustrate you; but if you start learning bad things from the beginning, it will be worse later.
I've found a way to do what you want, but the header and the footer will be the same width as your mainContainer.
Just change your CSS to :
#footer-home
{
position: absolute;
bottom: 0; /* Put it back to 0 */
left: 0;
min-width: 100%;
height: 200px;
background-image: url(img/footerimg.png);
}
#maincontainer
{
width: 1024px;
margin: 0 auto;
/* Add the code below */
left: 0;
right: 0;
position: absolute;
}
That way, the footer will always stay at the bottom.