overflow-x



значения свойства:


  • visible
  • hidden
  • scroll
  • auto
  • no-display НЕ РАБОТАЕТ!!!
  • no-content НЕ РАБОТАЕТ!!!



css/style.css
  • .a {
  •  width: 300px;
  •  height: 100px;
  •  background-color: #3BA9DE;
  •  overflow-x: visible;
  •  white-space: nowrap;
  • }
  •  
  • #div1 {
  •  width: 300px;
  •  height: 100px;
  •  background-color: #56A31D;
  •  white-space: nowrap;
  • }
  •  
  • .b {
  •  width: 300px;
  •  height: 100px;
  •  background-color: #852E76;
  •  white-space: nowrap;
  • }
  •  
  • .c {
  •  width: 300px;
  •  height: 100px;
  •  background-color: #C1AE00;
  •  overflow-x: auto;
  •  white-space: nowrap;
  • }
  •  
  • .d {
  •  width: 300px;
  •  height: 100px;
  •  background-color: #CCCCFF;
  •  overflow-x: no-display; /*NOT WORK!!!*/
  •  white-space: nowrap;
  • }
  •  
  • .e {
  •  width: 300px;
  •  height: 100px;
  •  background-color: #CCFF00;
  •  overflow-x: no-content; /*NOT WORK!!!*/
  •  white-space: nowrap;
  • }
.a {
 width: 300px;
 height: 100px;
 background-color: #3BA9DE;
 overflow-x: visible;
 white-space: nowrap;
}

#div1 {
 width: 300px;
 height: 100px;
 background-color: #56A31D;
 white-space: nowrap;
}

.b {
 width: 300px;
 height: 100px;
 background-color: #852E76;
 white-space: nowrap;
}

.c {
 width: 300px;
 height: 100px;
 background-color: #C1AE00;
 overflow-x: auto;
 white-space: nowrap;
}

.d {
 width: 300px;
 height: 100px;
 background-color: #CCCCFF;
 overflow-x: no-display; /*NOT WORK!!!*/
 white-space: nowrap;
}

.e {
 width: 300px;
 height: 100px;
 background-color: #CCFF00;
 overflow-x: no-content; /*NOT WORK!!!*/
 white-space: nowrap;
}


index.html
  • <!DOCTYPE html>
  • <html>
  • <head>
  •  <meta charset="utf-8" />
  •  <title>New Page</title>
  •  <link href="css/style.css" rel="stylesheet" />
  •  <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
  • </head>
  • <body>
  •  <div class="a">
  •   But it was a dream. Three weeks ago, I had been lying on a beach
  •   in Hawaii.
  •  </div>
  •  <br />
  •  <br />
  •  <div id="div1">
  •   But it was a dream. Three weeks ago, I had been lying on a beach
  •   in Hawaii.
  •  </div>
  •  <br />
  •  <br />
  •  <div class="b">
  •   But it was a dream. Three weeks ago, I had been lying on a beach
  •   in Hawaii.
  •  </div>
  •  <br />
  •  <br />
  •  <div class="c">
  •   Hello World!
  •  </div>
  •  <br />
  •  <br />
  •  <div class="d">
  •   But it was a dream. Three weeks ago, I had been lying on a beach
  •   in Hawaii.
  •  </div>
  •  <br />
  •  <br />
  •  <div class="e">
  •   But it was a dream. Three weeks ago, I had been lying on a beach
  •   in Hawaii.
  •  </div>
  • <script>
  •  /*JavaScript*/
  •  document.getElementById("div1").style.overflowX = "hidden";
  •  /*jQuery*/
  •  $(document).ready(function () {
  •   $(".b").css({ "overflow-x": "scroll" });
  •  });
  • </script>
  • </body>
  • </html>
  • <!DOCTYPE html>
  • <html>
  • <head>
  •  <meta charset="utf-8" />
  •  <title>New Page</title>
  •  <link href="css/style.css" rel="stylesheet" />
  •  <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
  • </head>
  • <body>
  •  <div class="a">
  •   But it was a dream. Three weeks ago, I had been lying on a beach
  •   in Hawaii.
  •  </div>
  •  <br />
  •  <br />
  •  <div id="div1">
  •   But it was a dream. Three weeks ago, I had been lying on a beach
  •   in Hawaii.
  •  </div>
  •  <br />
  •  <br />
  •  <div class="b">
  •   But it was a dream. Three weeks ago, I had been lying on a beach
  •   in Hawaii.
  •  </div>
  •  <br />
  •  <br />
  •  <div class="c">
  •   Hello World!
  •  </div>
  •  <br />
  •  <br />
  •  <div class="d">
  •   But it was a dream. Three weeks ago, I had been lying on a beach
  •   in Hawaii.
  •  </div>
  •  <br />
  •  <br />
  •  <div class="e">
  •   But it was a dream. Three weeks ago, I had been lying on a beach
  •   in Hawaii.
  •  </div>
  • <script>
  •  /*JavaScript*/
  •  document.getElementById("div1").style.overflowX = "hidden";
  •  /*jQuery*/
  •  $(document).ready(function () {
  •   $(".b").css({ "overflow-x": "scroll" });
  •  });
  • </script>
  • </body>
  • </html>