CSS Alternatives to style=“display:none”

前端 未结 5 1791
眼角桃花
眼角桃花 2020-12-08 20:17

I\'m implementing a JSF component base where you must override the css being used or it will use its default css. I\'m trying trying to hide the div and I\'ve

5条回答
  •  青春惊慌失措
    2020-12-08 20:37

    Use !important to stop it getting overridden -

    .rich-panelbar-header-act {
        display:none !important;
    }
    

    Also you can use JavaScript as a back up -

    function hidediv() {
    if (document.getElementById) { // DOM3 = IE5, NS6
    document.getElementById('DIVIDNAME').style.display = 'none';
    }else {
    if (document.layers) { // Netscape 4
    document.DIVIDNAME.display = 'hidden';
    }else { // IE 4
    document.all.DIVIDNAME.style.display = 'none';
    }}}
    
    

提交回复
热议问题