display:none does not render an element by completely removing it from all flows : overflow « CSS « HTML / CSS






display:none does not render an element by completely removing it from all flows

   
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<style type="text/css">
.container{
    position: relative;
    width: 800px;
    height: 800px;
    background: pink;
}
* .box {
  float: right;
  overflow: auto;
  visibility: visible;
  width: auto;
  height: 100px;
  margin: 10px;
  padding: 10px;
  background: red;
}

* .small {
    display:none;
    padding-left: 10px;
    background: blue;  
}
</style>
</head>
<body>
  <div class="container"> 
    <div class="small">this is a test. <BR/>this is a test. this is a test. this is a test. </div> 
    <div class="box">this is a test</div> 
  </div> 
</body>
</html> 

   
    
  








Related examples in the same category

1.'overflow' Example
2.overflow: auto
3.overflow: hidden
4.overflow: scroll
5.You can set overflow to one of four constant values: visible, hidden, scroll, or auto.
6.The default value is visible, which allows overflowing content to be rendered outside the containing block.
7.hidden hides the overflowing content and does not provide scrollbars, which prevents a user from scrolling overflowed content into view.
8.scroll clips the overflowing content and provides scrollbars
9.auto works like scroll except that it shows scrollbars only as needed
10.visibility:hidden hides an element without affecting the other elements' inline flow.
11.overflow:scroll
12.overflow:auto; white-space: nowrap
13.The overflow property
14.Overflow value
15.overflow determines what happens when an element's content is larger than its inner box. The default is to show the overflowing content.
16.Overflow auto
17.H2 with overflow hidden
18.overflow auto, white space, nowrap
19.Overflow auto method demonstrated