background image on site one page

0

Good morning, I'm creating a one page site, but I'm having difficulty putting the background of the image filling the space 100%, how can I put the background under the menu, filling all the space? each link. here is the codepen: link

    
asked by anonymous 10.01.2017 / 14:57

1 answer

0

With the menu on the right side and logo on the left side. With the background images.

$(document).ready(function() {
  $('header a').click(function() {
    var section = $(this).attr('href');
    var speed = 750;
    $('html,body').animate({
      sholetop: $(section).offset().top6,
      speed
    });
    return false;
  });
});
* {
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  -webkit-transition-timing-function: ease-out;
  -webkit-font-smoothing: antialiased;
}
html,
body {
  margin: 0px;
  padding: 0px;
}
a {
  text-decoration: none;
}
h1 {
  color: #fff;
  font-weight: 600;
  text-shadow: #000 1px -1px 2px, #000 -1px 1px 2px, #000 1px 1px 2px, #000 -1px -1px 2px;
  text-align: center;
  margin: .67em 0;
}
header {
  z-index: 1;
  position: fixed;
  width: 100%;
  display: table;
  height: 60px;
  background: rgba(0, 0, 0, 0.1);
}
header a {
  font-family: 'Trebuchet MS', sans-serif;
  line-height: 60px;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
  color: #fff;
  text-shadow: 2px 2px #222;
  display: inline-block;
  padding: 0px 30px;
}
header .logo {
  float: left;
}
header .menu {
  float: right;
}
.inner {
  min-height: 600px;
  position: relative
}
p {
  color: #fff;
  font-family: 'Trebuchet MS', cursive;
  font-size: 1.2em;
  font-weight: 600;
  text-shadow: 2px 2px #222;
  max-width: 700px;
  width: 100%;
  line-height: 10px;
}
.block {
  position: absolute;
  width: 100%;
  height: 10em;
  margin-top: -5em;
  left: 0;
  right: 0;
  margin: auto;
}
#slide1 {
  border: 1px solid #000000;
  padding: 160px;
  height: 80%;
  background-image: url('https://placeholdit.imgix.net/~text?txtsize=33&txt=SLIDE 1&w=1024&h=680');
  background-color: #0000CD;
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
}
#slide2 {
  border: 1px solid #000000;
  padding: 160px;
  height: 80%;
  background-image: url('https://placeholdit.imgix.net/~text?txtsize=33&txt=SLIDE 2&w=1024&h=680');
  background-color: #00FF7F;
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
}
#slide3 {
  border: 1px solid #000000;
  padding: 160px;
  height: 80%;
  background-image: url('https://placeholdit.imgix.net/~text?txtsize=33&txt=SLIDE 3&w=1024&h=680');
  background-color: #FF4500;
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
}
#slide4 {
  border: 1px solid #000000;
  padding: 160px;
  height: 80%;
  background-image: url('https://placeholdit.imgix.net/~text?txtsize=33&txt=SLIDE 4&w=1024&h=680');
  background-color: #9400D3;
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
}
#contato {
  background-color: #ccc;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><header><divclass="logo">
    <img src="https://placeholdit.imgix.net/~text?txtsize=33&txt=Logo&w=50&h=50"></div><divclass="menu">
    <a href="#slide1">Slide1</a>
    <a href="#slide2">Slide2</a>
    <a href="#slide3">Slide3</a> 
    <a href="#slide4">Slide4</a> 
    <a href="#contato" </a>
  </div>
</header>
<!--slide1 -->
<section id="slide1">
  <div class="inner">
    <div class="block">
      <h1> Montagem e Manutenção de PC</h1>
      <p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
      <p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
      <p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
      <p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
      <p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
      <p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
      <p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
      <p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
      <p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
      <div></div>
    </div>
  </div>
</section>
<!--slide2 -->
<section id="slide2">
  <div class="inner">
    <div class="block">
      <h1> Design Gráfico</h1>
      <p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
      <p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
      <p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
      <p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
      <p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
      <p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
      <p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
      <p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
      <p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
      <div></div>
    </div>
</section>
<!--slide4 -->
<section id="slide3">
  <div class="inner">
    <div class="block">
      <h1> Loja Virtual</h1>
      <p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
      <p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
      <p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
      <p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
      <p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
      <p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
      <p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
      <p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
      <p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
      <div></div>
    </div>
</section>
<section id="slide4">
  <div class="inner">
    <div class="block">
      <h1> Criação de Sites </h1>
      <p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
      <p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
      <p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
      <p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
      <p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
      <p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
      <p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
      <p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
      <p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
      <div></div>
    </div>
</section>
    
10.01.2017 / 16:14