Is there an opposite to display:none?

后端 未结 15 1613
夕颜
夕颜 2020-12-22 19:47

The opposite of visibility: hidden is visibility: visible. Similarly, is there any opposite for display: none?

Many people be

相关标签:
15条回答
  • 2020-12-22 20:21

    display:unset sets it back to some initial setting, not to the previous "display" values

    i just copied the previous display value (in my case display: flex;) again(after display non), and it overtried the display:none successfuly

    (i used display:none for hiding elements for mobile and small screens)

    0 讨论(0)
  • 2020-12-22 20:22

    You can use display: block

    Example :

    <!DOCTYPE html>
    <html>
    <body>
    
    <p id="demo">Lorem Ipsum</p>
    
    <button type="button" 
    onclick="document.getElementById('demo').style.display='none'">Click Me!</button>
    <button type="button" 
    onclick="document.getElementById('demo').style.display='block'">Click Me!</button>
    
    </body>
    </html> 
    
    0 讨论(0)
  • 2020-12-22 20:22

    The best answer for display: none is

    display:inline
    

    or

    display:normal
    
    0 讨论(0)
提交回复
热议问题