How to assign a fixed background image relative to a div?

I used fixed background images in my website carousel made with bootstrap. Background images are fixed to show the parallax effect. But the problem is that when new carousel slides move to the left, an image that already exists remains fixed. I want the background image on the div to move when the div is moving with css transition effects.

I want this type of carousel http://www.w3schools.com/bootstrap/bootstrap_carousel.asp In other words, I want the next itembackground image to click active itemon the left. Currently, when it next itemslides to the left, it zooms in on the background image current item.

The code is as follows:

var mq = window.matchMedia("(max-width: 320px)");
var mylogo = document.getElementById("mylogo");
if (mq.matches) {
  mylogo.innerHTML = "SSR";
}

function changelogo() {
  return function() {
    if (mq.matches) {

      mylogo.innerHTML = "SSR";
    } else {
      mylogo.innerHTML = "Syco Scientist Records"
    }
  }
}

window.onresize = changelogo();

if (window.matchMedia("(max-height: 420px)").matches) {
  for (var n = 0; n < 5; n++) {
    document.getElementsByClassName("item")[n].style.backgroundSize = "100% calc(100% - 140px)";
  }
}
.navbar {
  min-height: 60px;
  border-color: #333;
  background-color: #d6d5d5;
  margin-bottom: 0;
}
.navbar .navbar-header .navbar-brand {
  height: 60px;
  padding: 20px 15px;
  color: #333;
  font-family: Raleway;
  font-weight: bold;
  font-style: italic;
}
.navbar .navbar-header .navbar-toggle {
  margin-top: 14px;
  border-color: #d5d5d5;
}
.navbar .navbar-header .navbar-toggle > .icon-bar {
  background-color: #333;
}
.navbar ul.navbar-nav {
  margin-bottom: 0;
}
.navbar ul.nav > li > a {
  height: 60px;
  font-size: 14px;
  line-height: 20px;
  padding: 20px 15px;
  color: #333;
  text-align: center;
}
.navbar ul.nav > li > a:hover {
  color: #333;
  background-color: #e7e7e7;
}
.navbar ul.nav > li.active > a,
.navbar ul.nav > li.active:hover > a {
  background-color: #333;
  color: #d6d5d5;
}
#home {
  background-color: #333;
  z-index: 6;
}
.carousel {
  width: 100%;
  height: 100vh;
  min-height: 420px;
}
.mobile-carousel {
  padding-top: 100px;
  height: 100%;
  padding-bottom: 40px;
}
.carousel-inner {
  height: 100%;
}
.carousel-inner .item {
  height: 100%;
  -webkit-transition-timing-function: cubic-bezier(.71, -0.06, .36, 1.35);
  transition-timing-function: cubic-bezier(.71, -0.06, .36, 1.35);
}
.carousel-inner .item img {
  display: block;
  width: 100%;
  height: 568px;
  height: 100%;
}
.carousel-inner .first {
  width: 100%;
  margin: auto;
  background: url(http://2.bp.blogspot.com/_OdCx7pACI9M/TQhDqhnKXgI/AAAAAAAAAH8/kPDpkHpFOnw/s1600/daffy+duck+cartoons+pictures+1.gif) no-repeat fixed;
  background-position: center 100px;
  background-size: 100% calc(100% - 140px);
  background-clip: content-box;
}
.carousel-inner .second {
  width: 100%;
  margin: auto;
  background: url(http://www.allgraphics123.com/graphics/cartoons/cartoons123.gif) no-repeat fixed;
  background-position: center 100px;
  background-size: 100% calc(100% - 140px);
  background-clip: content-box;
}
.carousel-inner .third {
  width: 100%;
  margin: auto;
  background: url(http://pic.1fotonin.com/data/wallpapers/211/WDF_2483525.png) no-repeat fixed;
  background-position: center 100px;
  background-size: 100% calc(100% - 140px);
  background-clip: content-box;
}
.carousel-inner .fourth {
  width: 100%;
  margin: auto;
  background: url(http://pic.1fotonin.com/data/wallpapers/109/WDF_1525343.jpg) no-repeat fixed;
  background-position: center 100px;
  background-size: 100% calc(100% - 140px);
  background-clip: content-box;
}
.carousel-control span {
  left: 50%;
  position: absolute;
  top: 50%;
}
.carousel-control span img {
  position: absolute;
  top: -36px;
  left: -9px;
}
.carousel-indicators {
  bottom: 0px;
  margin-bottom: 0;
}
.carousel-indicators li {
  background-color: #777;
  border: 0;
}
.carousel-indicators li.active {
  background-color: #dcdbdb;
  margin: 1px;
  width: 10px;
  height: 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">
  <title>Syco Scientist Records</title>
  <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
  <link rel="stylesheet" type="text/css" href="css/mystyle.css">
  <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
      <![endif]-->


</head>

<body>

  <nav class="navbar navbar-default navbar-fixed-top">
    <div class="container-fluid">

      <div class="navbar-header">
        <a class="navbar-brand" href="#" id="mylogo"> Syco Sientist Records </a>
        <button class="navbar-toggle collapsed" data-target="#navbar" data-toggle="collapse">
          <span class="sr-only"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
      </div>

      <div id="navbar" class="navbar-collapse collapse">
        <ul class="nav navbar-nav navbar-right">
          <li class="active"><a href="#">Home</a>
          </li>
          <li><a href="#artists">Artists</a>
          </li>
          <li><a href="#songs">Songs</a>
          </li>
          <li><a href="#beats">Beats</a>
          </li>
          <li><a href="#contact">Contact</a>
          </li>
        </ul>
      </div>
    </div>
  </nav>


  <section id="home">
    <div id="mycarousel" class="carousel slide">
      <div class="container-fluid mobile-carousel">
        <div class="carousel-inner">

          <ol class="carousel-indicators">
            <li data-target="#mycarousel" data-slide-to="0"></li>
            <li data-target="#mycarousel" data-slide-to="1"></li>
            <li data-target="#mycarousel" data-slide-to="2"></li>
            <li data-target="#mycarousel" data-slide-to="3"></li>
          </ol>

          <div class="item active first"></div>
          <div class="item second"></div>
          <div class="item third"></div>
          <div class="item fourth"></div>

          <a href="#mycarousel" class="left carousel-control" data-slide="prev">
            <span aria-hidden="true"><img src="images/left_Arrow.png"></span>
            <span class="sr-only">Previous</span>
          </a>
          <a href="#mycarousel" class="right carousel-control" data-slide="next">
            <span aria-hidden="true"><img src="images/right_arrow.png"></span>
            <span class="sr-only">Next</span>
          </a>
        </div>
      </div>
    </div>
  </section>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
  
</body>

</html>
Hide result

?

: , Firefox. , , Chrome, Firefox.

+4
4

. ,

var mq = window.matchMedia("(max-width: 320px)");
var mylogo = document.getElementById("mylogo");
if (mq.matches) {
  mylogo.innerHTML = "SSR";
}

function changelogo() {
  return function() {
    if (mq.matches) {

      mylogo.innerHTML = "SSR";
    } else {
      mylogo.innerHTML = "Syco Scientist Records"
    }
  }
}

window.onresize = changelogo();

if (window.matchMedia("(max-height: 420px)").matches) {
  for (var n = 0; n < 5; n++) {
    document.getElementsByClassName("item")[n].style.backgroundSize = "100% calc(100% - 140px)";
  }
}
.navbar {
  min-height: 60px;
  border-color: #333;
  background-color: #d6d5d5;
  margin-bottom: 0;
}
.navbar .navbar-header .navbar-brand {
  height: 60px;
  padding: 20px 15px;
  color: #333;
  font-family: Raleway;
  font-weight: bold;
  font-style: italic;
}
.navbar .navbar-header .navbar-toggle {
  margin-top: 14px;
  border-color: #d5d5d5;
}
.navbar .navbar-header .navbar-toggle > .icon-bar {
  background-color: #333;
}
.navbar ul.navbar-nav {
  margin-bottom: 0;
}
.navbar ul.nav > li > a {
  height: 60px;
  font-size: 14px;
  line-height: 20px;
  padding: 20px 15px;
  color: #333;
  text-align: center;
}
.navbar ul.nav > li > a:hover {
  color: #333;
  background-color: #e7e7e7;
}
.navbar ul.nav > li.active > a,
.navbar ul.nav > li.active:hover > a {
  background-color: #333;
  color: #d6d5d5;
}
#home {
  background-color: #333;
  z-index: 6;
}
.carousel {
  width: 100%;
  height: 100vh;
  min-height: 420px;
}
.mobile-carousel {
  padding-top: 100px;
  height: 100%;
  padding-bottom: 40px;
}
.carousel-inner {
  height: 100%;
}
.carousel-inner .item {
  height: 100%;
  -webkit-transition-timing-function: cubic-bezier(.71, -0.06, .36, 1.35);
  transition-timing-function: cubic-bezier(.71, -0.06, .36, 1.35);
}
.carousel-inner .item img {
  display: block;
  width: 100%;
  height: 568px;
  height: 100%;
}
.carousel-inner .first {
  width: 100%;
  margin: auto;
  background: url(http://2.bp.blogspot.com/_OdCx7pACI9M/TQhDqhnKXgI/AAAAAAAAAH8/kPDpkHpFOnw/s1600/daffy+duck+cartoons+pictures+1.gif) no-repeat fixed;
  background-position: center 100px;
  background-size: 100% calc(100% - 140px);
  background-clip: content-box;
  backface-visibility: visible !important;
-webkit-backface-visibility: visible !important;
transform: none !important;
-webkit-transform: none !important;
}
.carousel-inner .second {
  width: 100%;
  margin: auto;
  background: url(http://www.allgraphics123.com/graphics/cartoons/cartoons123.gif) no-repeat fixed;
  background-position: center 100px;
  background-size: 100% calc(100% - 140px);
  background-clip: content-box;
  backface-visibility: visible !important;
-webkit-backface-visibility: visible !important;
transform: none !important;
-webkit-transform: none !important;
}
.carousel-inner .third {
  width: 100%;
  margin: auto;
  background: url(http://pic.1fotonin.com/data/wallpapers/211/WDF_2483525.png) no-repeat fixed;
  background-position: center 100px;
  background-size: 100% calc(100% - 140px);
  background-clip: content-box;
 backface-visibility: visible !important;
-webkit-backface-visibility: visible !important;
transform: none !important;
-webkit-transform: none !important;
}
.carousel-inner .fourth {
  width: 100%;
  margin: auto;
  background: url(http://pic.1fotonin.com/data/wallpapers/109/WDF_1525343.jpg) no-repeat fixed;
  background-position: center 100px;
  background-size: 100% calc(100% - 140px);
  background-clip: content-box;
  backface-visibility: visible !important;
-webkit-backface-visibility: visible !important;
transform: none !important;
-webkit-transform: none !important;
}
.carousel-control span {
  left: 50%;
  position: absolute;
  top: 50%;
}
.carousel-control span img {
  position: absolute;
  top: -36px;
  left: -9px;
}
.carousel-indicators {
  bottom: 0px;
  margin-bottom: 0;
}
.carousel-indicators li {
  background-color: #777;
  border: 0;
}
.carousel-indicators li.active {
  background-color: #dcdbdb;
  margin: 1px;
  width: 10px;
  height: 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">
  <title>Syco Scientist Records</title>
  <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
  <link rel="stylesheet" type="text/css" href="css/mystyle.css">
  <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
      <![endif]-->


</head>

<body>

  <nav class="navbar navbar-default navbar-fixed-top">
    <div class="container-fluid">

      <div class="navbar-header">
        <a class="navbar-brand" href="#" id="mylogo"> Syco Sientist Records </a>
        <button class="navbar-toggle collapsed" data-target="#navbar" data-toggle="collapse">
          <span class="sr-only"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
      </div>

      <div id="navbar" class="navbar-collapse collapse">
        <ul class="nav navbar-nav navbar-right">
          <li class="active"><a href="#">Home</a>
          </li>
          <li><a href="#artists">Artists</a>
          </li>
          <li><a href="#songs">Songs</a>
          </li>
          <li><a href="#beats">Beats</a>
          </li>
          <li><a href="#contact">Contact</a>
          </li>
        </ul>
      </div>
    </div>
  </nav>


  <section id="home">
    <div id="mycarousel" class="carousel slide">
      <div class="container-fluid mobile-carousel">
        <div class="carousel-inner">

          <ol class="carousel-indicators">
            <li data-target="#mycarousel" data-slide-to="0"></li>
            <li data-target="#mycarousel" data-slide-to="1"></li>
            <li data-target="#mycarousel" data-slide-to="2"></li>
            <li data-target="#mycarousel" data-slide-to="3"></li>
          </ol>

          <div class="item active first"></div>
          <div class="item second"></div>
          <div class="item third"></div>
          <div class="item fourth"></div>

          <a href="#mycarousel" class="left carousel-control" data-slide="prev">
            <span aria-hidden="true"><img src="images/left_Arrow.png"></span>
            <span class="sr-only">Previous</span>
          </a>
          <a href="#mycarousel" class="right carousel-control" data-slide="next">
            <span aria-hidden="true"><img src="images/right_arrow.png"></span>
            <span class="sr-only">Next</span>
          </a>
        </div>
      </div>
    </div>
  </section>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
  
</body>

</html>
Hide result
+1

css:

<!DOCTYPE html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Syco Scientist Records</title>
    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
    <link rel="stylesheet" type="text/css" href="css/mystyle.css">
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
        <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
        <![endif]-->

    <style>
        div#mycarousel .carousel-inner .item{
            padding:0 10%;
        }
    </style>
</head>

<body>

    <nav class="navbar navbar-default navbar-fixed-top">
        <div class="container-fluid">

            <div class="navbar-header">
                <a class="navbar-brand" href="#" id="mylogo"> Syco Sientist Records </a>
                <button class="navbar-toggle collapsed" data-target="#navbar" data-toggle="collapse">
                    <span class="sr-only"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
            </div>

            <div id="navbar" class="navbar-collapse collapse">
                <ul class="nav navbar-nav navbar-right">
                    <li class="active"><a href="#">Home</a>
                    </li>
                    <li><a href="#artists">Artists</a>
                    </li>
                    <li><a href="#songs">Songs</a>
                    </li>
                    <li><a href="#beats">Beats</a>
                    </li>
                    <li><a href="#contact">Contact</a>
                    </li>
                </ul>
            </div>
        </div>
    </nav>


    <section id="home">
        <div id="mycarousel" class="carousel slide">
            <div class="container-fluid mobile-carousel">
                <div class="carousel-inner">

                    <ol class="carousel-indicators">
                        <li data-target="#mycarousel" data-slide-to="0"></li>
                        <li data-target="#mycarousel" data-slide-to="1"></li>
                        <li data-target="#mycarousel" data-slide-to="2"></li>
                        <li data-target="#mycarousel" data-slide-to="3"></li>
                    </ol>

                    <div class="item active first"><img src="http://blog.allisonjoyce.com/wp-content/uploads/2014/02/ablog186.jpg"></div>
                    <div class="item second"><img src="https://i.ytimg.com/vi/MLqHuAXasTY/maxresdefault.jpg"></div>
                    <div class="item third"><img src="http://blog.allisonjoyce.com/wp-content/uploads/2014/02/ablog186.jpg"></div>
                    <div class="item fourth"><img src=""><img src="http://www.monopolycity.com/acimages/ac_beach_21_560.gif"></div>

                    <a href="#mycarousel" class="left carousel-control" data-slide="prev">
                        <span aria-hidden="true"><i class="glyphicon glyphicon-chevron-left"></i></span>
                    </a>
                    <a href="#mycarousel" class="right carousel-control" data-slide="next">
                        <span aria-hidden="true"><i class="glyphicon glyphicon-chevron-right"></i></span>
                    </a>
                </div>
            </div>
        </div>
    </section>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>

</body>

+1

, , , . , div , div css.

Chrome - , .

FireFox . , , . Firefox.

background: url(..) no-repeat fixed;    // remove fixed

1: , fixed , .

div div .item div. , div , div .

var mq = window.matchMedia("(max-width: 320px)");
var mylogo = document.getElementById("mylogo");
if (mq.matches) {
  mylogo.innerHTML = "SSR";
}

function changelogo() {
  return function() {
    if (mq.matches) {

      mylogo.innerHTML = "SSR";
    } else {
      mylogo.innerHTML = "Syco Scientist Records"
    }
  }
}

window.onresize = changelogo();

if (window.matchMedia("(max-height: 420px)").matches) {
  for (var n = 0; n < 5; n++) {
    document.getElementsByClassName("item")[n].style.backgroundSize = "100% calc(100% - 140px)";
  }
}
.navbar {
  min-height: 60px;
  border-color: #333;
  background-color: #d6d5d5;
  margin-bottom: 0;
}
.navbar .navbar-header .navbar-brand {
  height: 60px;
  padding: 20px 15px;
  color: #333;
  font-family: Raleway;
  font-weight: bold;
  font-style: italic;
}
.navbar .navbar-header .navbar-toggle {
  margin-top: 14px;
  border-color: #d5d5d5;
}
.navbar .navbar-header .navbar-toggle > .icon-bar {
  background-color: #333;
}
.navbar ul.navbar-nav {
  margin-bottom: 0;
}
.navbar ul.nav > li > a {
  height: 60px;
  font-size: 14px;
  line-height: 20px;
  padding: 20px 15px;
  color: #333;
  text-align: center;
}
.navbar ul.nav > li > a:hover {
  color: #333;
  background-color: #e7e7e7;
}
.navbar ul.nav > li.active > a,
.navbar ul.nav > li.active:hover > a {
  background-color: #333;
  color: #d6d5d5;
}
#home {
  background-color: #333;
  z-index: 6;
}
.carousel {
  width: 100%;
  height: 100vh;
  min-height: 420px;
}
.mobile-carousel {
  padding-top: 100px;
  height: 100%;
  padding-bottom: 40px;
}
.carousel-inner {
  height: 100%;
}
.carousel-inner .item, .carousel-inner .item > div {
  height: 100%;
  -webkit-transition-timing-function: cubic-bezier(.71, -0.06, .36, 1.35);
  transition-timing-function: cubic-bezier(.71, -0.06, .36, 1.35);
}
.carousel-inner .item img {
  display: block;
  width: 100%;
  height: 568px;
  height: 100%;
}
.carousel-inner .first > div {
  width: 100%;
  margin: auto;
  background: url(http://2.bp.blogspot.com/_OdCx7pACI9M/TQhDqhnKXgI/AAAAAAAAAH8/kPDpkHpFOnw/s1600/daffy+duck+cartoons+pictures+1.gif) no-repeat fixed;
  background-position: center 100px;
  background-size: 100% calc(100% - 140px);
  background-clip: content-box;
}
.carousel-inner .second > div{
  width: 100%;
  margin: auto;
  background: url(http://www.allgraphics123.com/graphics/cartoons/cartoons123.gif) no-repeat fixed;
  background-position: center 100px;
  background-size: 100% calc(100% - 140px);
  background-clip: content-box;
}
.carousel-inner .third > div{
  width: 100%;
  margin: auto;
  background: url(http://pic.1fotonin.com/data/wallpapers/211/WDF_2483525.png) no-repeat fixed;
  background-position: center 100px;
  background-size: 100% calc(100% - 140px);
  background-clip: content-box;
}
.carousel-inner .fourth > div{
  width: 100%;
  margin: auto;
  background: url(http://pic.1fotonin.com/data/wallpapers/109/WDF_1525343.jpg) no-repeat fixed;
  background-position: center 100px;
  background-size: 100% calc(100% - 140px);
  background-clip: content-box;
}
.carousel-control span {
  left: 50%;
  position: absolute;
  top: 50%;
}
.carousel-control span img {
  position: absolute;
  top: -36px;
  left: -9px;
}
.carousel-indicators {
  bottom: 0px;
  margin-bottom: 0;
}
.carousel-indicators li {
  background-color: #777;
  border: 0;
}
.carousel-indicators li.active {
  background-color: #dcdbdb;
  margin: 1px;
  width: 10px;
  height: 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">
  <title>Syco Scientist Records</title>
  <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
  <link rel="stylesheet" type="text/css" href="css/mystyle.css">
  <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
      <![endif]-->


</head>

<body>

  <nav class="navbar navbar-default navbar-fixed-top">
    <div class="container-fluid">

      <div class="navbar-header">
        <a class="navbar-brand" href="#" id="mylogo"> Syco Sientist Records </a>
        <button class="navbar-toggle collapsed" data-target="#navbar" data-toggle="collapse">
          <span class="sr-only"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
      </div>

      <div id="navbar" class="navbar-collapse collapse">
        <ul class="nav navbar-nav navbar-right">
          <li class="active"><a href="#">Home</a>
          </li>
          <li><a href="#artists">Artists</a>
          </li>
          <li><a href="#songs">Songs</a>
          </li>
          <li><a href="#beats">Beats</a>
          </li>
          <li><a href="#contact">Contact</a>
          </li>
        </ul>
      </div>
    </div>
  </nav>


  <section id="home">
    <div id="mycarousel" class="carousel slide">
      <div class="container-fluid mobile-carousel">
        <div class="carousel-inner">

          <ol class="carousel-indicators">
            <li data-target="#mycarousel" data-slide-to="0"></li>
            <li data-target="#mycarousel" data-slide-to="1"></li>
            <li data-target="#mycarousel" data-slide-to="2"></li>
            <li data-target="#mycarousel" data-slide-to="3"></li>
          </ol>

          <div class="item active first"><div></div></div>
          <div class="item second"><div></div></div>
          <div class="item third"><div></div></div>
          <div class="item fourth"><div></div></div>

          <a href="#mycarousel" class="left carousel-control" data-slide="prev">
            <span aria-hidden="true"><img src="images/left_Arrow.png"></span>
            <span class="sr-only">Previous</span>
          </a>
          <a href="#mycarousel" class="right carousel-control" data-slide="next">
            <span aria-hidden="true"><img src="images/right_arrow.png"></span>
            <span class="sr-only">Next</span>
          </a>
        </div>
      </div>
    </div>
  </section>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
  
</body>

</html>
Hide result
0
background: url(../img/fav.jpg) no-repeat fixed;
height: 500px;

Set the height of your image, for example heigth:500px;, or you can use it padding:50px 0;otherwise it will not display your image on the background until you write anything on this particular div.

0
source

All Articles