overflow

JavaScript syntax:

overflow

Values:

visible | hidden | scroll | auto | inherit

Initial value:

visible

Applies to:

Block-level and replaced elements.

Inherited:

No.

Description:

overflow defines what to do during overflow.

Examples:

 
<script language="JavaScript">
  function fn1() {
    if (myBody.style.overflow == "auto") {
      myBody.style.overflow = "scroll";
      myButton.value = "Set overflow to hidden.";
      results.innerText = "overflow is set to scroll.";
      return false;
    }
    if (myBody.style.overflow == "scroll") {
      myBody.style.overflow = "hidden";
      myButton.value = "Set overflow to auto";
      results.innerText = "overflow is set to hidden.";
      return false;
    }
    if (myBody.style.overflow == "hidden") {
      myBody.style.overflow = "auto";
      myButton.value = "Set overflow to scroll";
      results.innerText = "overflow is set to auto.";
      return false;
    }
  }
</script>
<body id="myBody" bottommargin="150" style="overflow: auto">
  <div id="results" style="color: red">overflow is set to auto.</div>
  <br>
  <input id=myButton type=button value="Set overflow to scroll"
    onclick="fn1();">
  
Home 
  HTML CSS Book 
    CSS Reference  

Property:
  1. background
  2. background-attachment
  3. background-color
  4. background-image
  5. background-position
  6. background-repeat
  7. border
  8. border-bottom
  9. border-bottom-color
  10. border-bottom-style
  11. border-bottom-width
  12. border-color
  13. border-left
  14. border-left-color
  15. border-left-style
  16. border-left-width
  17. border-right
  18. border-right-color
  19. border-right-style
  20. border-right-width
  21. border-style
  22. border-top
  23. border-top-color
  24. border-top-style
  25. border-top-width
  26. border-width
  27. bottom
  28. clear
  29. clip
  30. color
  31. content
  32. counter-increment
  33. counter-reset
  34. cursor
  35. direction
  36. display
  37. float
  38. font
  39. font-family
  40. font-size
  41. font-style
  42. font-variant
  43. font-weight
  44. height
  45. left
  46. letter-spacing
  47. line-height
  48. list-style
  49. list-style-image
  50. list-style-position
  51. list-style-type
  52. margin
  53. margin-bottom
  54. margin-left
  55. margin-right
  56. margin-top
  57. max-height
  58. max-width
  59. min-height
  60. min-width
  61. outline
  62. outline-color
  63. outline-style
  64. outline-width
  65. overflow
  66. padding
  67. padding-bottom
  68. padding-left
  69. padding-right
  70. padding-top
  71. position
  72. quotes
  73. right
  74. text-align
  75. text-decoration
  76. text-indent
  77. text-transform
  78. top
  79. unicode-bidi
  80. vertical-align
  81. visibility
  82. white-space
  83. width
  84. word-spacing
  85. z-index
Related: