Home > Web Front-end > HTML Tutorial > How to display and hide divs in css_html/css_WEB-ITnose

How to display and hide divs in css_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:28:01
Original
1286 people have browsed it

   1.对于多个DIV的显示和隐藏

     
        
         
        无标题文档 
         
       

 
       
        
 
             
             
                 
             
             
                 
            
 
             
                 
             
             
                 
             
             
                 
             
             
                 
             
             
                 
             
             
                 
             
             
                 
             
        
 
                会员管理
 
        
ggggg
 
        
ggggg
 
        
bbbbb
 
        
ccccc
 
        
ddddd
 
        
eeeee
 
        
fffff

                                   lt;/body>


2. Hide the display of a single DIV
VisibilityThe hidden object also retains the physical space occupied by the object when it is displayed, but display does not retain it. You can save the following code to see the effect:
Specific steps:
Code example:



                                                                                                                                                                                                                              🎜>                                                                                                                 
←Objects whose SS attribute is display:none
No.

Special instructions

The display attribute sets the display mode of the element. The corresponding script feature is display. The optional values ​​are none, block and inline. The description of each value is as follows:
none hides the element , does not preserve the space when the element is displayed.
Block displays elements in block mode.
inline displays the element inline.
inline-block objects appear as inline elements, but all child objects appear as block elements. Adjacent inline elements will appear on the same line, spaces are allowed.
list-item displays block elements as list objects and can add item punctuation. (Requires IE6.0 support)
table-header-group displays the element as a table header group, equivalent to the tHead element.
table-footer-group displays the element as a table footer group, equivalent to the tFoot element.
The visibility attribute sets whether to display the element. The corresponding script feature is visibility. The optional values ​​are inherit, hidden and visible. The description of each value is as follows:
inherit inherits the visibility attribute setting of the parent element.
hidden hides the element but retains the space it occupies.
Visible display element (default value).


source:php.cn
Previous article:9. How to control frame pages or