overflow-y



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


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



css/style.css
  • .a {
  •  width: 150px;
  •  height: 100px;
  •  background-color: #3BA9DE;
  •  overflow-y: visible;
  • }
  •  
  • #div1 {
  •  width: 150px;
  •  height: 100px;
  •  background-color: #56A31D;
  • }
  •  
  • .b {
  •  width: 150px;
  •  height: 100px;
  •  background-color: #852E76;
  • }
  •  
  • .c {
  •  width: 150px;
  •  height: 100px;
  •  background-color: #C1AE00;
  •  overflow-y: auto;
  • }
  •  
  • .d {
  •  width: 150px;
  •  height: 100px;
  •  background-color: #CCCCFF;
  •  overflow-y: no-display; /*NOT WORK!!!*/
  • }
  •  
  • .e {
  •  width: 150px;
  •  height: 100px;
  •  background-color: #CCFF00;
  •  overflow-y: no-content; /*NOT WORK!!!*/
  • }
  •  
  • div {
  •  float: left;
  •  display: inline;
  • }
  •  
  • .empty {
  •  width: 15px;
  •  height: 150px;
  • }
.a {
 width: 150px;
 height: 100px;
 background-color: #3BA9DE;
 overflow-y: visible;
}

#div1 {
 width: 150px;
 height: 100px;
 background-color: #56A31D;
}

.b {
 width: 150px;
 height: 100px;
 background-color: #852E76;
}

.c {
 width: 150px;
 height: 100px;
 background-color: #C1AE00;
 overflow-y: auto;
}

.d {
 width: 150px;
 height: 100px;
 background-color: #CCCCFF;
 overflow-y: no-display; /*NOT WORK!!!*/
}

.e {
 width: 150px;
 height: 100px;
 background-color: #CCFF00;
 overflow-y: no-content; /*NOT WORK!!!*/
}

div {
 float: left;
 display: inline;
}

.empty {
 width: 15px;
 height: 150px;
}


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. But I was not in Hawaii now. I was dreaming in my office
  •   in Los Angeles. I had returned from my holiday and there was no
  •   work for me. Nobody wanted to hire me. I went to my office every
  •   day, but the telephone didn't ring. So I slept in my chair and I dreamt
  •   about Hawaii. But it was a dream. Three weeks ago, I had been lying on a beach
  •   in Hawaii. But I was not in Hawaii now. I was dreaming in my office
  •   in Los Angeles. I had returned from my holiday and there was no
  •   work for me. Nobody wanted to hire me. I went to my office every
  •   day, but the telephone didn't ring. So I slept in my chair and I dreamt
  •   about Hawaii.
  •  </div>
  •  <div class="empty"></div>
  •  <div id="div1">
  •   But it was a dream. Three weeks ago, I had been lying on a beach
  •   in Hawaii. But I was not in Hawaii now. I was dreaming in my office
  •   in Los Angeles. I had returned from my holiday and there was no
  •   work for me. Nobody wanted to hire me. I went to my office every
  •   day, but the telephone didn't ring. So I slept in my chair and I dreamt
  •   about Hawaii. But it was a dream. Three weeks ago, I had been lying on a beach
  •   in Hawaii. But I was not in Hawaii now. I was dreaming in my office
  •   in Los Angeles. I had returned from my holiday and there was no
  •   work for me. Nobody wanted to hire me. I went to my office every
  •   day, but the telephone didn't ring. So I slept in my chair and I dreamt
  •   about Hawaii.
  •  </div>
  •  <div class="empty"></div>
  •  <div class="b">
  •   But it was a dream. Three weeks ago, I had been lying on a beach
  •   in Hawaii. But I was not in Hawaii now. I was dreaming in my office
  •   in Los Angeles. I had returned from my holiday and there was no
  •   work for me. Nobody wanted to hire me. I went to my office every
  •   day, but the telephone didn't ring. So I slept in my chair and I dreamt
  •   about Hawaii. But it was a dream. Three weeks ago, I had been lying on a beach
  •   in Hawaii. But I was not in Hawaii now. I was dreaming in my office
  •   in Los Angeles. I had returned from my holiday and there was no
  •   work for me. Nobody wanted to hire me. I went to my office every
  •   day, but the telephone didn't ring. So I slept in my chair and I dreamt
  •   about Hawaii.
  •  </div>
  •  <div class="empty"></div>
  •  <div class="c">
  •   Hello World!
  •  </div>
  •  <div class="empty"></div>
  •  <div class="d">
  •   But it was a dream. Three weeks ago, I had been lying on a beach
  •   in Hawaii. But I was not in Hawaii now. I was dreaming in my office
  •   in Los Angeles. I had returned from my holiday and there was no
  •   work for me. Nobody wanted to hire me. I went to my office every
  •   day, but the telephone didn't ring. So I slept in my chair and I dreamt
  •   about Hawaii. But it was a dream. Three weeks ago, I had been lying on a beach
  •   in Hawaii. But I was not in Hawaii now. I was dreaming in my office
  •   in Los Angeles. I had returned from my holiday and there was no
  •   work for me. Nobody wanted to hire me. I went to my office every
  •   day, but the telephone didn't ring. So I slept in my chair and I dreamt
  •   about Hawaii.
  •  </div>
  •  <div class="empty"></div>
  •  <div class="e">
  •   But it was a dream. Three weeks ago, I had been lying on a beach
  •   in Hawaii. But I was not in Hawaii now. I was dreaming in my office
  •   in Los Angeles. I had returned from my holiday and there was no
  •   work for me. Nobody wanted to hire me. I went to my office every
  •   day, but the telephone didn't ring. So I slept in my chair and I dreamt
  •   about Hawaii. But it was a dream. Three weeks ago, I had been lying on a beach
  •   in Hawaii. But I was not in Hawaii now. I was dreaming in my office
  •   in Los Angeles. I had returned from my holiday and there was no
  •   work for me. Nobody wanted to hire me. I went to my office every
  •   day, but the telephone didn't ring. So I slept in my chair and I dreamt
  •   about Hawaii.
  •  </div>
  • <script>
  •  /*JavaScript*/
  •  document.getElementById("div1").style.overflowY = "hidden";
  •  /*jQuery*/
  •  $(document).ready(function () {
  •   $(".b").css({ "overflow-y": "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. But I was not in Hawaii now. I was dreaming in my office
  •   in Los Angeles. I had returned from my holiday and there was no
  •   work for me. Nobody wanted to hire me. I went to my office every
  •   day, but the telephone didn't ring. So I slept in my chair and I dreamt
  •   about Hawaii. But it was a dream. Three weeks ago, I had been lying on a beach
  •   in Hawaii. But I was not in Hawaii now. I was dreaming in my office
  •   in Los Angeles. I had returned from my holiday and there was no
  •   work for me. Nobody wanted to hire me. I went to my office every
  •   day, but the telephone didn't ring. So I slept in my chair and I dreamt
  •   about Hawaii.
  •  </div>
  •  <div class="empty"></div>
  •  <div id="div1">
  •   But it was a dream. Three weeks ago, I had been lying on a beach
  •   in Hawaii. But I was not in Hawaii now. I was dreaming in my office
  •   in Los Angeles. I had returned from my holiday and there was no
  •   work for me. Nobody wanted to hire me. I went to my office every
  •   day, but the telephone didn't ring. So I slept in my chair and I dreamt
  •   about Hawaii. But it was a dream. Three weeks ago, I had been lying on a beach
  •   in Hawaii. But I was not in Hawaii now. I was dreaming in my office
  •   in Los Angeles. I had returned from my holiday and there was no
  •   work for me. Nobody wanted to hire me. I went to my office every
  •   day, but the telephone didn't ring. So I slept in my chair and I dreamt
  •   about Hawaii.
  •  </div>
  •  <div class="empty"></div>
  •  <div class="b">
  •   But it was a dream. Three weeks ago, I had been lying on a beach
  •   in Hawaii. But I was not in Hawaii now. I was dreaming in my office
  •   in Los Angeles. I had returned from my holiday and there was no
  •   work for me. Nobody wanted to hire me. I went to my office every
  •   day, but the telephone didn't ring. So I slept in my chair and I dreamt
  •   about Hawaii. But it was a dream. Three weeks ago, I had been lying on a beach
  •   in Hawaii. But I was not in Hawaii now. I was dreaming in my office
  •   in Los Angeles. I had returned from my holiday and there was no
  •   work for me. Nobody wanted to hire me. I went to my office every
  •   day, but the telephone didn't ring. So I slept in my chair and I dreamt
  •   about Hawaii.
  •  </div>
  •  <div class="empty"></div>
  •  <div class="c">
  •   Hello World!
  •  </div>
  •  <div class="empty"></div>
  •  <div class="d">
  •   But it was a dream. Three weeks ago, I had been lying on a beach
  •   in Hawaii. But I was not in Hawaii now. I was dreaming in my office
  •   in Los Angeles. I had returned from my holiday and there was no
  •   work for me. Nobody wanted to hire me. I went to my office every
  •   day, but the telephone didn't ring. So I slept in my chair and I dreamt
  •   about Hawaii. But it was a dream. Three weeks ago, I had been lying on a beach
  •   in Hawaii. But I was not in Hawaii now. I was dreaming in my office
  •   in Los Angeles. I had returned from my holiday and there was no
  •   work for me. Nobody wanted to hire me. I went to my office every
  •   day, but the telephone didn't ring. So I slept in my chair and I dreamt
  •   about Hawaii.
  •  </div>
  •  <div class="empty"></div>
  •  <div class="e">
  •   But it was a dream. Three weeks ago, I had been lying on a beach
  •   in Hawaii. But I was not in Hawaii now. I was dreaming in my office
  •   in Los Angeles. I had returned from my holiday and there was no
  •   work for me. Nobody wanted to hire me. I went to my office every
  •   day, but the telephone didn't ring. So I slept in my chair and I dreamt
  •   about Hawaii. But it was a dream. Three weeks ago, I had been lying on a beach
  •   in Hawaii. But I was not in Hawaii now. I was dreaming in my office
  •   in Los Angeles. I had returned from my holiday and there was no
  •   work for me. Nobody wanted to hire me. I went to my office every
  •   day, but the telephone didn't ring. So I slept in my chair and I dreamt
  •   about Hawaii.
  •  </div>
  • <script>
  •  /*JavaScript*/
  •  document.getElementById("div1").style.overflowY = "hidden";
  •  /*jQuery*/
  •  $(document).ready(function () {
  •   $(".b").css({ "overflow-y": "scroll" });
  •  });
  • </script>
  • </body>
  • </html>