So here is the code for my navbar (i use Django, so the links are dynamic)
Well, my navbar doesn't expand to the end(if you use the hamburger), and i don't want to insert a fixed number because it doesn't work.
Well, i want the expanded navbar to show login.
alternatively i want to keep the login but put it to the other side.
body {
font: 14px -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica Neue, Arial, Helvetica, Geneva, sans-serif;
overflow-x: hidden;
overflow-y: auto;
}
.bild {
max-height: 600;
}
.bild img {
min-width: 20%;
max-width: 90%;
height: auto;
position: relative;
float: left;
background-position: 50% 50%;
background-repeat: no-repeat;
background-size: cover;
}
.navbar-brand {
padding-top: 40px;
}
.username a {
color: #000000;
}
.username a:hover {
text-decoration: none;
color: #6f737a;
}
a.logo {
height: 40px;
width: 60px;
background: url(../img/Weramemesicon2.png) 50% no-repeat;
background-size: 50px 40px;
text-indent: -9999px;
}
.navbar-collapse.in {
overflow: hidden;
max-height: none !important;
height: auto !important;
}
.top-nav {
border-radius: 0px;
background: #000000;
margin: 0;
}
.navbar a {
text-align: center;
font-weight: 700;
}
.navbar a:hover,
navbar a:focus {
color: #fff;
}
.general-function .search {
display: inline-block;
width: 30px;
height: 30px;
text-indent: -999px;
overflow: hidden;
background: url(../img/sprite.png) 0 0 no-repeat;
background-size: 420px 120px;
float: left;
}
.title {
font-size: 36px;
margin: 30px 0px;
}
.general-function {
padding: 10px;
list-style-type: none;
}
.function-wrap {
position: absolute;
right: 0;
top: 0;
}
.search.selected,
.search:hover {
background: url(../img/sprite.png) 0 -30px no-repeat;
background-size: 420px 120px;
}
.visitor-function {
padding: 9px 10px;
float: right;
display: inline-block;
color: #bbb;
line-height: 30px;
height: 30px;
padding: 0 12px;
text-decoration: none;
}
.visitor-function li {
padding: 9px 10px;
float: right;
display: inline-block;
color: #bbb;
line-height: 30px;
height: 30px;
padding: 0 12px;
}
.user-function .btn-mute,
.visitor-function .btn-mute {
display: inline-block;
color: #bbb;
line-height: 30px;
height: 30px;
padding: 0 12px;
text-decoration: none;
margin-top: 0;
}
.user-function .btn-primary,
.visitor-function .btn-primary {
color: #fff;
display: inline-block;
line-height: 30px;
height: 30px;
padding: 0 16px;
border-radius: 2px;
font-size: 14px;
font-weight: 700;
margin-left: 10px;
text-decoration: none;
}
#media ( max-width: 767px) {
.navbar.navbar-custom .navbar-nav {
text-align: center;
}
.navbar.navbar-custom .navbar-nav>li {
font-size: 32px;
}
.navbar .navbar-custom .navbar-nav>li:not (:first-child) {
right: 90 px;
}
.navbar.navbar-custom .navbar-nav>li {
border-bottom: 1px solid #eee;
}
.navbar.navbar-custom a.btn.navbar-btn.btn-sign {
padding: 7.5px 15px;
font-size: 20px;
}
.navbar.navbar-custom .signin {
float: none;
clear: both;
position: relative;
right: 0;
}
}
.twitter {
padding: 4px;
display: inline-block;
width: 30px;
height: 30px;
text-indent: -999px;
background: #3b5998 url(../img/Sprites.png) -1.4px -2px no-repeat;
background-size: 320px 30px;
border-radius: 50%;
}
.twitter:hover {
padding: 4px;
display: inline-block;
width: 30px;
height: 30px;
text-indent: -999px;
background: #3b5998 url(../img/Sprites.png) 1.4px 1.4px no-repeat;
background-size: 320px 30px;
border-radius: 50%;
}
.facebook {
padding: 4px;
display: inline-block;
width: 30px;
height: 30px;
text-indent: -999px;
background: #3b5998 url(../img/Sprites.png) -30.2px -2px no-repeat;
background-size: 320px 30px;
border-radius: 50%;
}
.facebook:hover {
padding: 4px;
display: inline-block;
width: 30px;
height: 30px;
text-indent: -999px;
background: #3b5998 url(../img/Sprites.png) -27.9px 1.4px no-repeat;
background-size: 320px 30px;
border-radius: 50%;
}
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" rel="stylesheet"/>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<!DOCTYPE html>
<title>Testingsite </title>
<body>
<header>
<nav class="navbar top-nav navbar-top navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="logo navbar-brand" href="{% url 'home' %}">Wera</a>
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navi" aria-expanded="false"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span></button>
</div>
<div class="collapse navbar-collapse" id="navi">
<ul class="nav navbar-nav custom-nav">
<li> Hot </li>
<li> Trending </li>
<li> Fresh </li>
<li> Groups </li>
</ul>
<div class="visitor-function row">
<ul class="navbar navbar-nav custom-nav general-function navbar-right">
search
<a class="btn-mute " href=" {% url 'accounts:login' %} ">Login</a>
<a class="btn-primary " href=" {% url 'accounts:signup' %}">Sign up</a>
</ul>
</div>
</div>
</div>
</nav>
</header>
<div class="container">
</div>
</body>
Try this:
#media (max-width: 768px) {
.visitor-function {
height: auto;
}
}
Related
Despite having position fixed and no transform properties, my "hero" div always moves with the page. I want it to stay put
.hero{
position: fixed;
width: 1500px;
margin-left: 0px;
margin-top: 60px;
}
Full css:
*
{
margin: 0;
padding: 0;
}
header
{
background-image: linear-gradient(rgba(0, 0, 0, 0.5),rgba(0, 0, 0, 0.5)), url(img/snow.jpg);
height: 100vh;
background-size: cover;
background-position: center;
}
.main-nav
{
float: right;
list-style: none;
margin-top: 30px;
}
.main-nav li{
display: inline-block;
}
.main-nav li a{
color:white;
text-decoration: none;
padding: 5px 20px;
font-family: "Roboto", "sans-serif";
}
.main-nav li.active a{
border: 1px solid white;
}
.main-nav li a:hover{
border: 1px solid white;
}
.logo img
{
width: 150px;
height: auto;
float: left;
}
body
{
font-family: monospace;
}
.row
{
max-width: 1200px;
margin: auto;
}
.hero{
position: fixed;
width: 1500px;
margin-left: 0px;
margin-top: 60px;
}
h1{
color: white;
text-transform: uppercase;
font-size: 60px;
text-align: center;
/* margin-top: 275px; */
margin-top: 220;
}
.button
{
margin-top: 30px;
margin-left: 440px;
position: sticky;
}
.btn{
border: 1px solid white;
padding: 10px 30px;
color: white;
text-decoration: none;
margin-right: 5px;
font-size: 13px;
text-transform: uppercase;
position: sticky;
}
.btn-one{
background-color: darkorange;
font-family: "Roboto", sans-serif;
position: sticky;
}
.btn-two{
font-family: "Roboto", sans-serif;
position: sticky;
}
.btn-two:hover{
background-color: darkorange;
transition: all 0.5s ease-in;
}
html,body{
width: 100%;
height: 100%;
margin: 0px;
padding: 0px;
overflow-y: auto;
overflow-x: hidden;
}
#page_2{
height: 1000px;
background-color: red;
}
Full HTML:
<html>
<head>
<title>Summer Website</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<header>
<div id="page_1">
<div id="particles-js">
<div class="row">
<!-- <div class ="logo">
<img src="https://i.imgur.com/0PyA8HR.png" alt="">
</div> -->
<ul class="main-nav">
<li class ="active"> HOME </li>
<li> ABOUT </li>
<li> PORTFOLIO </li>
</ul>
</div>
<div class="hero">
<h1>HI I'M KACIE AND I LOVE SOLVING PROBLEMS.</h1>
<div class="button">
LINKEDIN
RESUME
</div>
<div class ="bro">
</div>
</div>
</div>
</header>
<!--particles js file -->
<!-- <h1> TEST </h1> -->
<script type="text/javascript" src="js/particles.min.js"></script>
<script type="text/javascript" src="js/app.js"></script>
</div>
<div id=page_2>
</div>
</body>
</html>
There just seems to be problem with your closing tags incorrectly nested. There needs to another closing div before the closing header tag. The snippet shows the hero in a fixed position:
.hero {
position: fixed;
width: 1500px;
margin-left: 0px;
margin-top: 60px;
}
Full css: * {
margin: 0;
padding: 0;
}
header {
background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url(img/snow.jpg);
height: 100vh;
background-size: cover;
background-position: center;
}
.main-nav {
float: right;
list-style: none;
margin-top: 30px;
}
.main-nav li {
display: inline-block;
}
.main-nav li a {
color: white;
text-decoration: none;
padding: 5px 20px;
font-family: "Roboto", "sans-serif";
}
.main-nav li.active a {
border: 1px solid white;
}
.main-nav li a:hover {
border: 1px solid white;
}
.logo img {
width: 150px;
height: auto;
float: left;
}
body {
font-family: monospace;
}
.row {
max-width: 1200px;
margin: auto;
}
.hero {
position: fixed;
width: 1500px;
margin-left: 0px;
margin-top: 60px;
}
h1 {
color: white;
text-transform: uppercase;
font-size: 60px;
text-align: center;
/* margin-top: 275px; */
margin-top: 220;
}
.button {
margin-top: 30px;
margin-left: 440px;
position: sticky;
}
.btn {
border: 1px solid white;
padding: 10px 30px;
color: white;
text-decoration: none;
margin-right: 5px;
font-size: 13px;
text-transform: uppercase;
position: sticky;
}
.btn-one {
background-color: darkorange;
font-family: "Roboto", sans-serif;
position: sticky;
}
.btn-two {
font-family: "Roboto", sans-serif;
position: sticky;
}
.btn-two:hover {
background-color: darkorange;
transition: all 0.5s ease-in;
}
html,
body {
width: 100%;
height: 100%;
margin: 0px;
padding: 0px;
overflow-y: auto;
overflow-x: hidden;
}
#page_2 {
height: 1000px;
background-color: red;
}
<header>
<div id="page_1">
<div id="particles-js">
<div class="row">
<!-- <div class ="logo">
<img src="https://i.imgur.com/0PyA8HR.png" alt="">
</div> -->
<ul class="main-nav">
<li class="active"> HOME </li>
<li> ABOUT </li>
<li> PORTFOLIO </li>
</ul>
</div>
<div class="hero">
<h1>HI I'M KACIE AND I LOVE SOLVING PROBLEMS.</h1>
<div class="button">
LINKEDIN
RESUME
</div>
<div class="bro">
</div>
</div>
</div>
</div>
</header>
<div id=page_2>
</div>
Use position:inherit
You are using fixed and I think that is causing your issue.
Inherit won’t move, absolute stacks, fixed scrolls with page, static is default.
I looked through similar issues other users have had, but none of the fixes have worked for me. I started on the site about a year ago and haven't touched it since. As the title suggests, there's a bit of white space on the right side of the site that I can't seem to get rid of.
html * {
font-family: 'Open Sans', sans-serif;
margin: 0;
}
body{
}
.header1 {
background: #000;
filter: alpha(opacity=80);
-moz-opacity: 0.8;
-khtml-opacity: 0.8;
opacity: 0.8;
background-size: cover;
height: 100px;
width: 100%;
padding: 0;
position: fixed;
z-index: 1000;
margin-right: -12px;
margin-left: -12px;
margin-top: -6px;
}
.header1 img {
float: left;
width: 258px;
height: 56px;
margin-left: 30px;
margin-top: 44px;
padding: 0;
}
ul#nav {
list-style-type: none;
height: 20px;
margin-top: 73px;
-webkit-padding-start: 40px;
display: block;
}
a:link,
a:visited {
text-decoration: none;
color: #FFFFFF !important;
}
ul#nav li.contact a {
float: right;
width: 100px;
}
ul#nav li.about a {
float: right;
width: 75px;
}
ul#nav li.search a {
float: right;
width: 100px;
}
.header2 {
background: url(rockhdr.png) no-repeat top center fixed;
background-size: cover;
height: 600px;
width: 100%;
margin-right: -18px;
margin-left: -8px;
margin-top: -12px;
padding: 0;
}
.box {
background: no-repeat top center fixed;
margin: auto;
padding-left: -15px;
padding-top: 275px;
width: 400px;
height: 100px;
white-space: nowrap;
position: relative;
}
.container-1 {
width: 600px;
height: 200px;
vertical-align: middle;
white-space: nowrap;
position: relative;
background: #000;
margin-left: -85px;
border-radius: 5px;
}
.container-1 input#search {
width: 300px;
height: 50px;
background: #2b303b;
border: none;
font-size: 10pt;
float: left;
color: #FFFFFF;
margin-left: 150px;
margin-top: 60px;
padding-left: 20px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
.container-1 .icon {
position: absolute;
top: 50%;
margin-left: 17px;
margin-top: 17px;
z-index: 1;
color: #FFFFFF;
}
.button {
position: absolute;
font-size: 12px;
left: 150px;
top: 60%;
width: 148px;
height: 20px;
background: #ffff;
border: none;
border-radius: 5px;
}
.advbutton {
position: absolute;
font-size: 12px;
left: 302px;
top: 60%;
width: 148px;
height: 20px;
background: #ffff;
border: none;
border-radius: 5px;
}
.container-1 input#search::-webkit-input-placeholder {
color: #65737e;
}
.container-1 input#search:-moz-placeholder {
/* Firefox 18- */
color: #65737e;
}
.container-1 input#search::-moz-placeholder {
/* Firefox 19+ */
color: #65737e;
}
.container-1 input#search:-ms-input-placeholder {
color: #65737e;
}
h1 {
text-align: center;
font-size: 50px;
}
#bottom-wrap {
background: #000;
}
#bottom {
width: 100%;
height: 0;
padding: 0 0 20%;
background-size: 100%;
background-repeat: no-repeat;
background-size: cover;
margin-left: auto;
margin-right: auto;
}
.contact {
color: #FFFFFF;
text-align: center;
}
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
<link rel="stylesheet" href="fossils.css" type="text/css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="fossils.js"></script>
<div class='header_top'>
<div class='header1'>
<img src="GFS/images/eslogo.png" alt="logo" />
<ul id="nav">
<li class="contact"><a name="contact" href="#bottom" title="Contact">Contact</a></li>
<li class="about">About</li>
<li class="search">Search</li>
</div>
</div>
<div class='header_box'>
<div class='header2'>
<div class="box">
<div class="container-1">
<span class="icon"><i class="fa fa-search"></i></span>
<input type="search" id="search" placeholder="Search..." />
<form action="advancedsearch.html">
<input type="submit" class="advbutton" type="button" value="Advanced Search">
</form>
<input class="button" type="button" value="Search">
</div>
</div>
</div>
</div>
<iframe src="https://truview.ortery.com/HTMLJavaScript/MotorBike/HTML5Viewer.html"></iframe>
<h1>Catalogued Rocks</h1>
<div id="bottom-wrap">
<div id="bottom">
<br>
<br>
<br>
</div>
</div>
Help would be much appreciated!
Simply remove this from header1:
margin-right: -12px;
margin-left: -12px;
margin-top: -6px;
The white margin you are referring to is just on your header container and nowhere else and the negative margin above was the cause of it.
html * {
font-family: 'Open Sans', sans-serif;
margin: 0;
}
body{
}
.header1 {
background: #000;
filter: alpha(opacity=80);
-moz-opacity: 0.8;
-khtml-opacity: 0.8;
opacity: 0.8;
background-size: cover;
height: 100px;
width: 100%;
padding: 0;
position: fixed;
z-index: 1000;
}
.header1 img {
float: left;
width: 258px;
height: 56px;
margin-left: 30px;
margin-top: 44px;
padding: 0;
}
ul#nav {
list-style-type: none;
height: 20px;
margin-top: 73px;
-webkit-padding-start: 40px;
display: block;
}
a:link,
a:visited {
text-decoration: none;
color: #FFFFFF !important;
}
ul#nav li.contact a {
float: right;
width: 100px;
}
ul#nav li.about a {
float: right;
width: 75px;
}
ul#nav li.search a {
float: right;
width: 100px;
}
.header2 {
background: url(rockhdr.png) no-repeat top center fixed;
background-size: cover;
height: 600px;
width: 100%;
margin-right: -18px;
margin-left: -8px;
margin-top: -12px;
padding: 0;
}
.box {
background: no-repeat top center fixed;
margin: auto;
padding-left: -15px;
padding-top: 275px;
width: 400px;
height: 100px;
white-space: nowrap;
position: relative;
}
.container-1 {
width: 600px;
height: 200px;
vertical-align: middle;
white-space: nowrap;
position: relative;
background: #000;
margin-left: -85px;
border-radius: 5px;
}
.container-1 input#search {
width: 300px;
height: 50px;
background: #2b303b;
border: none;
font-size: 10pt;
float: left;
color: #FFFFFF;
margin-left: 150px;
margin-top: 60px;
padding-left: 20px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
.container-1 .icon {
position: absolute;
top: 50%;
margin-left: 17px;
margin-top: 17px;
z-index: 1;
color: #FFFFFF;
}
.button {
position: absolute;
font-size: 12px;
left: 150px;
top: 60%;
width: 148px;
height: 20px;
background: #ffff;
border: none;
border-radius: 5px;
}
.advbutton {
position: absolute;
font-size: 12px;
left: 302px;
top: 60%;
width: 148px;
height: 20px;
background: #ffff;
border: none;
border-radius: 5px;
}
.container-1 input#search::-webkit-input-placeholder {
color: #65737e;
}
.container-1 input#search:-moz-placeholder {
/* Firefox 18- */
color: #65737e;
}
.container-1 input#search::-moz-placeholder {
/* Firefox 19+ */
color: #65737e;
}
.container-1 input#search:-ms-input-placeholder {
color: #65737e;
}
h1 {
text-align: center;
font-size: 50px;
}
#bottom-wrap {
background: #000;
}
#bottom {
width: 100%;
height: 0;
padding: 0 0 20%;
background-size: 100%;
background-repeat: no-repeat;
background-size: cover;
margin-left: auto;
margin-right: auto;
}
.contact {
color: #FFFFFF;
text-align: center;
}
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
<link rel="stylesheet" href="fossils.css" type="text/css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="fossils.js"></script>
<div class='header_top'>
<div class='header1'>
<img src="GFS/images/eslogo.png" alt="logo" />
<ul id="nav">
<li class="contact"><a name="contact" href="#bottom" title="Contact">Contact</a></li>
<li class="about">About</li>
<li class="search">Search</li>
</div>
</div>
<div class='header_box'>
<div class='header2'>
<div class="box">
<div class="container-1">
<span class="icon"><i class="fa fa-search"></i></span>
<input type="search" id="search" placeholder="Search..." />
<form action="advancedsearch.html">
<input type="submit" class="advbutton" type="button" value="Advanced Search">
</form>
<input class="button" type="button" value="Search">
</div>
</div>
</div>
</div>
<iframe src="https://truview.ortery.com/HTMLJavaScript/MotorBike/HTML5Viewer.html"></iframe>
<h1>Catalogued Rocks</h1>
<div id="bottom-wrap">
<div id="bottom">
<br>
<br>
<br>
</div>
</div>
Q1
How can I remove the white line under the navigation bar on section 1/2? I have tried changing the html layout incase I a line gap was the issue which caused this to occur. However, I have had no luck trying to resolve this problem.
Q2
How can I remove the white above the footer on section2?
body {
margin: 0;
padding: 0;
}
.navbar.navbar-default {
background-color: #4D5061;
height: 10vh;
z-index: 100;
}
.navbar.navbar-default ul {
list-style-type: none;
text-align: right;
}
.navbar.navbar-default ul li {
display: inline-block;
}
.dropdown-menu li {
text-align: center
}
.dropdown .dropdown-menu {
background-color: #4D5061;
}
.dropdown .dropdown-menu a {
color: white;
}
.navbar.navbar-default ul li a {
display: inline-block;
padding: 3.5vh 8px 4px;
color: white;
text-decoration: none;
font-size: 14pt;
font-family: 'Roboto', sans-serif;
}
.navbar.navbar-default ul li:after {
content: '';
position: absolute;
right: 50%;
bottom: 0;
left: 50%;
height: 3px;
background-color: #FFFFFF;
border-radius: 9px;
transition: all .2s;
}
.navbar.navbar-default ul li a:hover {
color: white;
background-color: rgba(20, 50, 40, 0.5)
}
.nav.navbar-nav,
.nav.navbar-nav>li {
float: none;
}
.navbar.navbar-default ul li:hover:after {
right: 0;
left: 0;
}
.navbar.navbar-default ul.dropdown-menu li,
.navbar.navbar-default ul.dropdown-menu li a {
position: relative;
display: block;
}
#logo {
padding-top: 2vh;
padding-left: 20px;
float: left;
}
.hero {
background: url("https://static.pexels.com/photos/7064/man-notes-macbook-computer.jpg") center center no-repeat;
;
background-attachment: fixed;
position: relative;
background-size: cover;
width: 100%;
max-width: 100%;
width: 100vw;
height: 100%;
}
section {
position: relative;
padding: 10vh 0 0;
min-height: 100vh;
}
.section1 {
height: 100vh;
text-align: center;
color: white;
}
.section2 {
background-color: dimgrey;
text-align: center;
color: white;
min-height: 90vh;
}
.fa-angle-down {
color: #4D5061;
position: absolute;
bottom: 0px;
}
.fa-angle-up {
color: #4D5061;
position: absolute;
bottom: 0px;
}
.footer {
height: 3vh;
background-color: #4D5061;
padding: 0;
right: 0;
bottom: 0;
left: 0;
}
.nav-title {
font-size: 14pt;
margin: 0;
top: 35px;
left: 8px;
width: 100%;
position: absolute;
text-align: center;
color: white;
font-family: 'Roboto', sans-serif;
}
.s1-welcome {
font-family: 'Roboto', sans-serif;
color: white;
font-size: 45pt;
font-size: 2.5em;
text-align: center;
margin: 0;
}
.footertext {
font-size: 14pt;
color: white;
font-family: 'Roboto', sans-serif;
text-align: center;
}
.contact-text {
font-size: 35pt;
font-weight: bold;
color: white;
font-family: 'Roboto', sans-serif;
text-align: center;
}
p {
font-size: 20pt;
color: white;
font-family: 'Roboto', sans-serif;
text-align: center;
}
.profile.box {
bottom: 0;
height: 50%;
left: 0;
margin: auto;
position: absolute;
right: 0;
top: 0;
width: 50%;
}
.shape {
border-radius: 25px;
display: inline-block;
background: #4D5061;
content: url(http://i1126.photobucket.com/albums/l611/ldocherty1/IMG_0730_zpsiz4dqc47.jpg);
color: white;
height: 250px;
margin: auto;
padding: 3px;
width: 250px;
}
.fa {
padding: 20px;
font-size: 20px;
text-align: center;
text-decoration: none;
margin: 7px 6px;
border-radius: 50%;
}
.fa:hover {
opacity: 0.7;
}
.fa-twitter {
background: #55ACEE;
color: white;
}
.fa-linkedin {
background: #007bb5;
color: white;
}
.icon-style {
position: relative;
top: 10px;
}
.arrow1 {
color: white;
position: relative;
}
#import url(http://fonts.googleapis.com/css?family=Montserrat:400,700);
#feedback-page {
text-align: center;
}
#form-main {
width: 100%;
float: left;
padding-top: 0px;
}
#form-div {
background-color: rgba(72, 72, 72, 0.4);
padding-left: 35px;
padding-right: 35px;
padding-top: 35px;
padding-bottom: 50px;
width: 850px;
height: 500px;
float: left;
left: 50%;
position: absolute;
margin-top: 30px;
margin-left: -260px;
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
}
.feedback-input {
color: #3c3c3c;
font-family: Helvetica, Arial, sans-serif;
font-weight: 500;
font-size: 18px;
border-radius: 0;
line-height: 22px;
background-color: #fbfbfb;
padding: 13px 13px 13px 54px;
margin-bottom: 10px;
width: 100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
border: 3px solid rgba(0, 0, 0, 0);
}
.feedback-input:focus {
background: #fff;
box-shadow: 0;
border: 3px solid #3498db;
color: #3498db;
outline: none;
padding: 13px 13px 13px 54px;
}
.focused {
color: #30aed6;
border: #30aed6 solid 3px;
}
#name {
background-image: url(http://rexkirby.com/kirbyandson/images/name.svg);
background-size: 30px 30px;
background-position: 11px 8px;
background-repeat: no-repeat;
}
#name:focus {
background-image: url(http://rexkirby.com/kirbyandson/images/name.svg);
background-size: 30px 30px;
background-position: 8px 5px;
background-position: 11px 8px;
background-repeat: no-repeat;
}
#email {
background-image: url(http://rexkirby.com/kirbyandson/images/email.svg);
background-size: 30px 30px;
background-position: 11px 8px;
background-repeat: no-repeat;
}
#email:focus {
background-image: url(http://rexkirby.com/kirbyandson/images/email.svg);
background-size: 30px 30px;
background-position: 11px 8px;
background-repeat: no-repeat;
}
#comment {
background-image: url(http://rexkirby.com/kirbyandson/images/comment.svg);
background-size: 30px 30px;
background-position: 11px 8px;
background-repeat: no-repeat;
}
textarea {
width: 100%;
height: 150px;
line-height: 150%;
resize: vertical;
}
input:hover,
textarea:hover,
input:focus,
textarea:focus {
background-color: white;
}
#button-blue {
font-family: 'Montserrat', Arial, Helvetica, sans-serif;
float: left;
width: 100%;
border: #fbfbfb solid 4px;
cursor: pointer;
background-color: #3498db;
color: white;
font-size: 24px;
padding-top: 22px;
padding-bottom: 22px;
-webkit-transition: all 0.3s;
-moz-transition: all 0.3s;
transition: all 0.3s;
margin-top: -4px;
font-weight: 700;
}
#button-blue:hover {
background-color: rgba(0, 0, 0, 0);
color: #0493bd;
}
.submit:hover {
color: #3498db;
}
.ease {
width: 0px;
height: 74px;
background-color: #fbfbfb;
-webkit-transition: .3s ease;
-moz-transition: .3s ease;
-o-transition: .3s ease;
-ms-transition: .3s ease;
transition: .3s ease;
}
.submit:hover .ease {
width: 100%;
background-color: white;
}
#media only screen and (max-width: 580px) {
#form-div {
left: 3%;
margin-right: 3%;
width: 88%;
margin-left: 0;
padding-left: 3%;
padding-right: 3%;
}
}
<body>
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<h1 class="nav-title">Liam Docherty's Digital Portfolio</h1>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li>Home
</li>
<li class="dropdown">
About Me <span class="caret"></span>
<ul class="dropdown-menu">
<li>Action
</li>
<li>Contact
</li>
<li>Something else here
</li>
<li>Separated link
</li>
<li>One more separated link
</li>
</ul>
</li>
<li class="dropdown">
Units <span class="caret"></span>
<ul class="dropdown-menu">
<li>Action
</li>
<li>Another action
</li>
<li>Something else here
</li>
<li>Separated link
</li>
<li>One more separated link
</li>
</ul>
</li>
<li>Clients
</li>
<li>Contact Me
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container-fluid -->
</nav>
<section id="section1" class="section1">
<div class="hero">
<div class="profile box">
<div class="shape"></div>
</div>
</div>
<h2 class="s1-welcome">WELCOME TO MY PORTFOLIO</h2>
<div class="arrow1">
<i class="fa fa-angle-down" style="font-size:100px;"></i>
</div>
</section>
<section id="contact-me" class="contact_section section2">
<h2 class="contact-text">Get in touch</h2>
<p>Wanna get in touch or talk to me about a project?</p>
<p>Fill the form below or send an email to liam_docherty#outlook.com</p>
<div id="form-main">
<div id="form-div">
<form class="form" id="form1">
<p class="name">
<input name="name" type="text" class="validate[required,custom[onlyLetter],length[0,100]] feedback-input" placeholder="Name" id="name" />
</p>
<p class="email">
<input name="email" type="text" class="validate[required,custom[email]] feedback-input" id="email" placeholder="Email" />
</p>
<p class="text">
<textarea name="text" class="validate[required,length[6,300]] feedback-input" id="comment" placeholder="Comment"></textarea>
</p>
<div class="submit">
<input type="submit" value="SEND" id="button-blue" />
<div class="ease"></div>
</div>
</form>
</div>
<div class="arrow2">
<i class="fa fa-angle-up" style="font-size:100px;"></i>
</div>
</section>
<script src="https://code.jquery.com/jquery-3.1.1.js" integrity="sha256-16cdPddA6VdVInumRGo6IbivbERE8p7CQR3HzTBuELA=" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<footer>
<div class="footer">
<h2 class="footertext">Copyright © 2017 Liam Docherty's Site. All rights reserved.</h2>
</div>
</footer>
</body>
</html>
These are your problem:
<h2 class="contact-text">Get in touch</h2>
<p>Wanna get in touch or talk to me about a project?</p>
<p>Fill the form below or send an email to liam_docherty#outlook.com</p>
Remove those and then bam it works. You are also missing a closing div in that section.
Although not a complete answer, I would recommend looking at these three lines and the CSS related. Also, you are using bootstrap so you should look at any styles that bootstrap might be applying.
if you remove space in section remove h2 margin you have space use padding is batter. please check i thing it's batter .
<body>
<style>
body {
margin: 0;
padding: 0;
}
.navbar.navbar-default {
background-color: #4D5061;
height: auto;
z-index: 100;
}
.navbar.navbar-default ul {
list-style-type: none;
text-align: right;
}
.navbar.navbar-default ul li {
display: inline-block;
}
.dropdown-menu li {
text-align: center
}
.dropdown .dropdown-menu {
background-color: #4D5061;
}
.navbar.navbar-default ul li ul {
display: none;
left: 0;
position: absolute;
top: 60px;
min-width: 240px;
z-index: 200;
}
.dropdown .dropdown-menu a {
color: white;
}
.navbar.navbar-default ul li a {
display: inline-block;
padding: 3.5vh 8px 4px;
color: white;
text-decoration: none;
font-size: 14pt;
font-family: 'Roboto', sans-serif;
}
.navbar.navbar-default ul li:after {
content: '';
position: absolute;
right: 50%;
bottom: 0;
left: 50%;
height: 3px;
background-color: #FFFFFF;
border-radius: 9px;
transition: all .2s;
}
.navbar.navbar-default ul li a:hover {
color: white;
background-color: rgba(20, 50, 40, 0.5)
}
.nav.navbar-nav,
.nav.navbar-nav>li {
float: none;
}
.navbar.navbar-default ul li:hover:after {
right: 0;
left: 0;
}
.navbar.navbar-default ul.dropdown-menu li,
.navbar.navbar-default ul.dropdown-menu li a {
position: relative;
display: block;
}
#logo {
padding-top: 2vh;
padding-left: 20px;
float: left;
}
.hero {
background: url("https://static.pexels.com/photos/7064/man-notes-macbook-computer.jpg") center center no-repeat;
;
background-attachment: fixed;
position: relative;
background-size: cover;
width: 100%;
max-width: 100%;
width: 100vw;
height: 100%;
}
.nav.navbar-nav {
margin: 10px 0 0;
}
section {
position: relative;
padding: 0vh 0 0;
min-height: 100vh;
}
.section1 {
height: 100vh;
text-align: center;
color: white;
}
.navbar.navbar-default ul li { position:relative;}
.navbar.navbar-default ul li:hover ul { display:block;}
.section2 {
background-color: dimgrey;
text-align: center;
color: white;
min-height: 90vh;
}
.fa-angle-down {
color: #4D5061;
position: absolute;
bottom: 0px;
}
.fa-angle-up {
color: #4D5061;
position: absolute;
bottom: 0px;
}
.footer {
height: 3vh;
background-color: #4D5061;
padding: 0;
right: 0;
bottom: 0;
left: 0;
}
.nav-title {
font-size: 14pt;
margin: 0;
top: 35px;
left: 8px;
width: 100%;
position: absolute;
text-align: center;
color: white;
font-family: 'Roboto', sans-serif;
}
.s1-welcome {
font-family: 'Roboto', sans-serif;
color: white;
font-size: 45pt;
font-size: 2.5em;
text-align: center;
margin: 0;
}
.footertext {
color: white;
font-family: "Roboto",sans-serif;
font-size: 14pt;
margin: 0;
padding: 20px 0;
text-align: center;
}
.contact-text {
color: white;
font-family: "Roboto",sans-serif;
font-size: 35pt;
font-weight: bold;
margin: 0;
padding: 30px 0 20px;
text-align: center;
}
p {
font-size: 20pt;
color: white;
font-family: 'Roboto', sans-serif;
text-align: center;
}
.profile.box {
bottom: 0;
height: 50%;
left: 0;
margin: auto;
position: absolute;
right: 0;
top: 0;
width: 50%;
}
.shape {
border-radius: 25px;
display: inline-block;
background: #4D5061;
content: url(http://i1126.photobucket.com/albums/l611/ldocherty1/IMG_0730_zpsiz4dqc47.jpg);
color: white;
height: 250px;
margin: auto;
padding: 3px;
width: 250px;
}
.fa {
padding: 20px;
font-size: 20px;
text-align: center;
text-decoration: none;
margin: 7px 6px;
border-radius: 50%;
}
.fa:hover {
opacity: 0.7;
}
.fa-twitter {
background: #55ACEE;
color: white;
}
.fa-linkedin {
background: #007bb5;
color: white;
}
.icon-style {
position: relative;
top: 10px;
}
.arrow1 {
color: white;
position: relative;
}
#import url(http://fonts.googleapis.com/css?family=Montserrat:400,700);
#feedback-page {
text-align: center;
}
#form-main {
width: 100%;
float: left;
padding-top: 0px;
}
#form-div {
background-color: rgba(72, 72, 72, 0.4);
padding-left: 35px;
padding-right: 35px;
padding-top: 35px;
padding-bottom: 50px;
width: 850px;
height: 500px;
float: left;
left: 50%;
position: absolute;
margin-top: 30px;
margin-left: -260px;
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
}
.feedback-input {
color: #3c3c3c;
font-family: Helvetica, Arial, sans-serif;
font-weight: 500;
font-size: 18px;
border-radius: 0;
line-height: 22px;
background-color: #fbfbfb;
padding: 13px 13px 13px 54px;
margin-bottom: 10px;
width: 100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
border: 3px solid rgba(0, 0, 0, 0);
}
.feedback-input:focus {
background: #fff;
box-shadow: 0;
border: 3px solid #3498db;
color: #3498db;
outline: none;
padding: 13px 13px 13px 54px;
}
.focused {
color: #30aed6;
border: #30aed6 solid 3px;
}
#name {
background-image: url(http://rexkirby.com/kirbyandson/images/name.svg);
background-size: 30px 30px;
background-position: 11px 8px;
background-repeat: no-repeat;
}
#name:focus {
background-image: url(http://rexkirby.com/kirbyandson/images/name.svg);
background-size: 30px 30px;
background-position: 8px 5px;
background-position: 11px 8px;
background-repeat: no-repeat;
}
#email {
background-image: url(http://rexkirby.com/kirbyandson/images/email.svg);
background-size: 30px 30px;
background-position: 11px 8px;
background-repeat: no-repeat;
}
#email:focus {
background-image: url(http://rexkirby.com/kirbyandson/images/email.svg);
background-size: 30px 30px;
background-position: 11px 8px;
background-repeat: no-repeat;
}
#comment {
background-image: url(http://rexkirby.com/kirbyandson/images/comment.svg);
background-size: 30px 30px;
background-position: 11px 8px;
background-repeat: no-repeat;
}
textarea {
width: 100%;
height: 150px;
line-height: 150%;
resize: vertical;
}
input:hover,
textarea:hover,
input:focus,
textarea:focus {
background-color: white;
}
#button-blue {
font-family: 'Montserrat', Arial, Helvetica, sans-serif;
float: left;
width: 100%;
border: #fbfbfb solid 4px;
cursor: pointer;
background-color: #3498db;
color: white;
font-size: 24px;
padding-top: 22px;
padding-bottom: 22px;
-webkit-transition: all 0.3s;
-moz-transition: all 0.3s;
transition: all 0.3s;
margin-top: -4px;
font-weight: 700;
}
#button-blue:hover {
background-color: rgba(0, 0, 0, 0);
color: #0493bd;
}
.submit:hover {
color: #3498db;
}
.ease {
width: 0px;
height: 74px;
background-color: #fbfbfb;
-webkit-transition: .3s ease;
-moz-transition: .3s ease;
-o-transition: .3s ease;
-ms-transition: .3s ease;
transition: .3s ease;
}
.submit:hover .ease {
width: 100%;
background-color: white;
}
#media only screen and (max-width: 580px) {
#form-div {
left: 3%;
margin-right: 3%;
width: 88%;
margin-left: 0;
padding-left: 3%;
padding-right: 3%;
}
}
</style>
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<h1 class="nav-title">Liam Docherty's Digital Portfolio</h1>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li>Home
</li>
<li class="dropdown">
About Me <span class="caret"></span>
<ul class="dropdown-menu">
<li>Action
</li>
<li>Contact
</li>
<li>Something else here
</li>
<li>Separated link
</li>
<li>One more separated link
</li>
</ul>
</li>
<li class="dropdown">
Units <span class="caret"></span>
<ul class="dropdown-menu">
<li>Action
</li>
<li>Another action
</li>
<li>Something else here
</li>
<li>Separated link
</li>
<li>One more separated link
</li>
</ul>
</li>
<li>Clients
</li>
<li>Contact Me
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container-fluid -->
</nav>
<section id="section1" class="section1">
<div class="hero">
<div class="profile box">
<div class="shape"></div>
</div>
</div>
<h2 class="s1-welcome">WELCOME TO MY PORTFOLIO</h2>
<div class="arrow1">
<i class="fa fa-angle-down" style="font-size:100px;"></i>
</div>
</section>
<section id="contact-me" class="contact_section section2">
<h2 class="contact-text">Get in touch</h2>
<p>Wanna get in touch or talk to me about a project?</p>
<p>Fill the form below or send an email to liam_docherty#outlook.com</p>
<div id="form-main">
<div id="form-div">
<form class="form" id="form1">
<p class="name">
<input name="name" type="text" class="validate[required,custom[onlyLetter],length[0,100]] feedback-input" placeholder="Name" id="name" />
</p>
<p class="email">
<input name="email" type="text" class="validate[required,custom[email]] feedback-input" id="email" placeholder="Email" />
</p>
<p class="text">
<textarea name="text" class="validate[required,length[6,300]] feedback-input" id="comment" placeholder="Comment"></textarea>
</p>
<div class="submit">
<input type="submit" value="SEND" id="button-blue" />
<div class="ease"></div>
</div>
</form>
</div>
<div class="arrow2">
<i class="fa fa-angle-up" style="font-size:100px;"></i>
</div>
</section>
<script src="https://code.jquery.com/jquery-3.1.1.js" integrity="sha256-16cdPddA6VdVInumRGo6IbivbERE8p7CQR3HzTBuELA=" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<footer>
<div class="footer">
<h2 class="footertext">Copyright © 2017 Liam Docherty's Site. All rights reserved.</h2>
</div>
</footer>
</body>
For the section 1:
#section1{padding-top:0;}
For your second question
first: remove this from the #form-div:
float: left;
position: absolute;
margin-top:30px;
margin-left:-260px;
Add this to #form-div:
margin-left: auto;
margin-right:auto;
remove this from #form-main:
float:left;
move your <footer> in the section(id=contact-me) before the </section> and after the </div>
I tried researching this question on this site, but everything wasn't related to my particular site. Pretty much I have a background image on my home page, and the background is "fixed" and "covered". I am not sure if that's the reason why it is not working. I want the "View Works" button in the center of the computer. Please help!
HTML:
<html>
<head>
<meta charset="UTF-8">
<title>Kasia's Website </title>
<link href="styles.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="wrapper">
<a href="works.html">
<input class="butt" type="button" value="VIEW WORKS" />
</a>
</div>
<div id="page">
<div id="sidebar">
<div>
<a href="index.html"><img id="logo"
src="http://i66.tinypic.com/xnf4us.png" /></a>
</div>
<div>
<ul class="sb">
<li> Home </li>
<li> About </li>
<li> Works </li>
<li> Contact </li>
</ul>
</div>
<div id="sidebar-btn">
<span></span>
<span></span>
<span></span>
</div>
</div>
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$('#sidebar-btn').click(function(){
$('#sidebar').toggleClass('visible');
});
});
</script>
</div>
</body>
</html>
CSS
#charset "UTF-8";
body {
background-image: url(http://i66.tinypic.com/ww1d7n.png);
background-attachment: fixed;
background-size: cover;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
font-family: "Helvetica Neue";
}
#sidebar {
background: #05E2D4;
background-color: rgba(5, 226, 212, 0.7);
width: 220px;
height: 100%;
display: block;
position: absolute;
left: -200px;
top: 0px;
transition: left 0.3s linear;
}
#sidebar.visible {
left: 0px;
transition: left 0.3s linear;
}
ul.sb {
margin: 0px;
padding: 0px;
}
ul li {
list-style: none;
}
ul li a {
text-decoration: none;
color: #FFFFFF;
padding: 200px;
display: block;
width: 180px;
padding: 30px;
text-transform: uppercase;
font-weight: 105;
letter-spacing: 2.5px;
line-height: 30%;
margin-left: 20px;
}
#sidebar-btn {
display: inline-block;
vertical-align: middle;
width: 20px;
height: 15px;
position: absolute;
margin: 20px;
top: 0px;
right: -60px;
cursor: pointer;
}
#sidebar-btn span {
height: 2px;
background: #000000;
margin-bottom: 5px;
display: block;
}
a {
text-decoration: none;
}
a:link {
color: #FFFFFF;
}
a:visited {
color: none;
}
a:hover {
color: #ffcd03;
}
a:active {
color: #ffcd03;
}
#logo {
margin: 20px 50px 20px 50px;
}
#page {
max-width: 800px;
min-width: 600px;
}
#Kasiaport {
width: 500px;
margin: 50px 200px 50px 200px;
}
aside {
width: 30%;
background-color: white;
padding: 40px 40px 20px 40px;
margin: auto;
}
p.work {
color: white;
font-size: 9px;
text-transform: uppercase;
border-style: solid;
border-color: white;
margin-left: auto;
margin-right: auto;
width: 70px;
padding: 15px 30px 15px 30px;
display: block;
}
.butt {
-webkit-border-radius: 0;
-moz-border-radius: 0;
background-color: transparent;
border-radius: 2px;
color: #ffffff;
font-size: 15px;
padding: 10px 20px 10px 20px;
border: solid #FFFFFF 2px;
text-decoration: none;
font-weight: 200;
letter-spacing: 1.5px;
font-family: "Helvetica Neue";
text-align: center;
margin-left: 45%;
margin-top: 32%;
position: absolute;
}
.butt:hover {
border-color: #ffcd03;
background-color: none;
color: #ffcd03;
text-decoration: none;
}
http://codepen.io/kasiariele/pen/MaLdWv/
In order to see the error visually, you may need to go in full screen mode (http://codepen.io/kasiariele/full/MaLdWv/) or make the screen smaller so you can see it scroll.
Thank you.
Don't use margin to "center" your elements as you did.
You can add this code and the button will be centered both horizontally and vertically without having to adjust your old code:
.butt {
margin: 0; /* reset your old margin */
left: 50%;
top: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
Check browser support for transforms and any extra prefixes needed (-ms for ie9).
I can't figure out why my elements (logo, menu, info box) are outside the light grey container. Could you help me? Many thanks
See: http://jsfiddle.net/vqoudo6d/3/
HTML:
<header class="header">
<div class="header-wrapper">
<img class="header-logo" src="http://lorempixel.com/output/fashion-q-g-284-119-5.jpg">
<nav class="header_nav">
<ul class="header_nav-wrapper">
<li class="header_nav-item"> <a id="aboutOpen" class="header_nav-item-a" href="jkk">l'Atelier</a>
</li>
<li class="header_nav-item"> <a class="header_nav-item-a header_nav-item-a--btn" href="jkjks" target="_blank">La Carte des soins</a>
</li>
<li class="header_nav-item"> <a class="header_nav-item-a header_nav-item-a--btn" href="jkjks" target="_blank">Contact</a>
</li>
</ul>
</nav>
</div>
<div class="infos-pratiques clearfix">
<p class="info-pratiques-tag">Informations pratiques</p>
<div class="info-pratiques-content">
<p>3 rue dfdsf
<br>sdsqdssdd</p>
<p>Lundi:
<br>Mardi:
<br>Mercredi:
<br>Jeudi</p>
</div>
</div>
</header>
<div class="slider">
<ul class="slider__wrapper">
<li class="slider__item">
<div class="box" style="background-image:url(images/test.jpg);background-size: cover;
background-repeat: no-repeat; background-position: 50% 50%;"></div>
</li>
<li class="slider__item">
<div class="box" style="background-image:url(images/test2.jpg);background-size: cover;
background-repeat: no-repeat; background-position: 50% 50%;"></div>
</li>
</ul>
</div>
CSS:
.slider {
position: relative;
margin-left: auto;
margin-right: auto;
width: 90%;
height: 550px;
background: #eee;
overflow: hidden;
box-shadow: 0 2px 5px rgba(0, 0, 0, .5);
max-width: 1200px;
}
.slider__wrapper {
height: 100%;
list-style: none;
overflow: hidden;
*zoom: 1;
-webkit-backface-visibility: hidden;
-webkit-transform-style: preserve-3d;
}
.slider__item {
height: 100%;
float: left;
clear: none;
}
.slider__arrows-item {
position: absolute;
display: block;
margin-bottom: -20px;
padding: 20px;
}
.slider__arrows-item--right {
bottom: 50%;
right: 30px;
}
.slider__arrows-item--left {
bottom: 50%;
left: 30px;
}
.slider__nav {
position: absolute;
bottom: 30px;
}
.slider__nav-item {
width: 12px;
height: 12px;
float: left;
clear: none;
display: block;
margin: 0 5px;
background: #fff;
}
.slider__nav-item--current {
background: #ccc;
}
.slider__nav-item:hover {
background: #ccc;
}
.box {
width: 100%;
height: 100%;
}
.header {
z-index: 999;
width: 100%;
margin-left: auto;
margin-right: auto;
position: absolute;
}
.header-wrapper {
padding: 54px 60px;
}
.header-logo {
float: left;
clear: none;
}
.header_nav {
float: right;
clear: none;
font-family:'Maven Pro', sans-serif;
font-weight: normal;
}
.header_nav-wrapper {
list-style: none;
}
.header_nav-item {
margin-left: 22px;
float: left;
clear: none;
}
.header_nav-item-a {
color: #474032;
text-decoration: none;
}
.header_nav-item-a:hover {
color: #eee;
}
.header_nav-item-a--btn {
padding: 16px 18px;
border-radius: 5px;
border: 1px solid #474032;
background-color: transparent;
}
.header_nav-item-a--donate {
margin-top: -18px;
}
.header_nav-item-a--btn:hover {
border: 1px solid #eee;
}
.info-pratiques-content {
float: left;
clear: both;
margin-top: 14px;
margin-left: 4.52489%;
font-size: 13px;
line-height: 1.38;
color: #433d2b;
}
.info-pratiques-content p {
margin-bottom: 1em;
}
.info-pratiques-tag {
margin-top: 14px;
margin-right: auto;
margin-left: auto;
padding-top: 2px;
padding-right: 2px;
padding-bottom: 2px;
padding-left: 2px;
background-color: #9d926a;
font-size: 13px;
font-weight: 400;
line-height: 1.38;
text-align: center;
text-transform: uppercase;
color: rgb(65, 61, 45);
}
.infos-pratiques {
position: absolute;
top: 217px;
right: 5.1984375%;
z-index: 26;
width: 221px;
height: 200px;
background-color: rgb(222, 222, 222);
opacity: 0.91;
}
The max-width and the background are on .slider, but your header is not inside of it. just add the background and max-width to body and everything should be fine.
Also keep in mind that absolutely positioned elements are always relative to the closest non-static element (position: fixed, relative, absolute).
edit: I also agree with Paulie_D's comment, try to reduce absolute positioning