Visualizzazione dei risultati da 1 a 7 su 7

Discussione: nascondere div vuoto

  1. #1
    Utente di HTML.it
    Registrato dal
    Jul 2006
    Messaggi
    128

    nascondere div vuoto

    buongiorno a tutti,
    ho il seguente html:
    codice:
    <div class="ygtvchildren" id="ygtvc10">
    <div class="ygtvitem" id="ygtv11">
    <table border="0" cellpadding="0" cellspacing="0">
    	<tbody>
    		<tr>
    			<td class="ygtvblankdepthcell"></td>
    			<td id="ygtvt11" class="ygtvtn"
    				onclick="javascript:YAHOO.widget.TreeView.getNode('treeElement',11).toggle()"></td>
    			<td><a id="ygtvlabelel11" class="ygtvlabel" href="#"
    				target="_self"
    				onclick="return YAHOO.widget.TreeView.getNode('treeElement',11).onLabelClick(YAHOO.widget.TreeView.getNode('treeElement',11))">Bond
    			(4)</a></td>
    		</tr>
    	</tbody>
    </table>
    <div class="ygtvchildren" id="ygtvc11"></div>
    </div>
    con firefox tutto bene, mentre con ie6 quando c'p il div ygtvc11 vuoto, a video mi fa vedere ugualmente il div con un altezza di circa 1em. ho provato a forzare la height a 0px ma non succede nulla.. come posso non farlo vedere quando dentro al div non c'è nulla?
    grazie

  2. #2
    Prova cosi:

    codice:
    <div class="ygtvchildren" id="ygtvc11">&!nbsp;</div>   -->senza ! ovviamente<--
    fammi sapere^^

  3. #3
    Utente di HTML.it
    Registrato dal
    Jul 2006
    Messaggi
    128
    mmh... dovrei lavorare sul css non sull'html perché in verità l'html che vedi è il risultato di una trasformazione xsl

  4. #4
    Posso vedere il Css che hai utilizzato?

  5. #5
    Utente di HTML.it
    Registrato dal
    Jul 2006
    Messaggi
    128
    codice:
    #custom_doc {
    	width: 100%; min-width: 250px; height: 100%;
    }
    
    body, html {
    	background-color: white;
    	height: 650px;
    	overflow:hidden;
    }
    
    
    a {
      color:  blue;
    }
    a:visited {
        color: blue;
    }
    
    .ctrl a, a.ctrl {
        text-decoration: none;
    }
    
    .ctrl a:hover, a.ctrl:hover {
        
        
    }
    
    
    #log {
    	z-index: 99;
    	position:absolute;
    	right:0px;
    }
    		
    #hd {
    	margin-bottom: 15px;
    	background-color: #98b6d2;
    	height: 30px;
    	position: relative;
    	top: 10px;
    	z-index:0;
    	border-top: 1px solid gray;
    	border-bottom: 1px solid gray;
    }
    
    #hdh {
    	width: 216px;
    	background-color: #98b6d2;
    	position: absolute;
    	top: 4px;
    	left: 18px;
    	height: 30px;
    	z-index:10;
    	border-top: 1px solid gray;
    	border-bottom: 1px solid gray;
    	text-align: center;
    	border-right: 1px solid gray;
    	border-left: 1px solid gray;			
    }
    
    #hdh h1 {
    	color:white;
    }
    
    #leftContainer {
    	position:absolute;
    	top:0px;
    	padding: 9px;
    	padding-top:50px;
    	background-color: #E0903F;
    	height: 900px;
    	width: 196px;
    	border-left: 5px solid #9E301C;
    	border-right: 5px solid #9E301C;
    	margin-left: 15px;
    	z-index: 0;
    }
    
    /* left panel */
    #controlPnl {
    	border: 2px solid gray;
    }
    
    /* menucontainer */
    #menuContainer {
    	/*border: 1px solid black;*/
    	text-align: center;
    	color:gray;
    	font-weight: bold;
    	margin-bottom: 3px;
    	margin-top: 2px;
    }
    
    /* calendar */
    #calendarContainer {
    	border: 0;
    	height: 177px;			
    }
    
    #calendarElement {
    	margin: 4px;
    	margin-top: 7px;			
    }
    
    #calendarElement input {
        border: 1px solid black;
    }
    
    #calendarPnlselectMode {
        border: 1px solid black;
        background-color: red;
    }
    /* search */
    #searchContainer {
    	border: 0;
    	vertical-align:bottom;
    	margin: 0;
    	padding: 0;		 				
    }
    
    #searchContainer form {						
    	padding-left: 10px;
    	padding: 0;
    	text-align: center;			
    }
    
    #searchContainer input {
    	margin: 0;																	
    	padding-bottom: 1px;
    }				
    
    #searchContainer input.text {												
    	border:1px solid gray;
    	width: 142px;
    	color: gray;
    	padding-left: 4px;
    	
    }
    
    #searchContainer input.submit {	
    	height: 18px;
    	background-color: #eeeeee;
    	border: 1px solid gray;
    	padding-bottom: 1px;			
    }
    
    /* tree */
    #treeContainer {
    	border: 1px solid #98b6d2;
    	height: 264px;
    	width: 158px;
    	overflow:auto;
    	margin-left: 12px;
    	background-color: #eeeeee;
    	padding:3px;
    }
    			
    #treeContainer #treeElement {
    	border: 1px solid #cccccc;
    	background-color:white;
    	margin:0px;
    }
    			
    #treeElement * td.label {
    	background-color: gray;
    }
    
    #treeElement * .selectedTextNode {
        font-weight: bold;
    	text-decoration: underline;
    }
    
    	
    #treeElement * .disabledTextNode {
        color: gray;
        text-decoration: none;
    	
    }
    
    #treeElement * .disabledTextNode.selectedTextNode {
        color: gray;
        text-decoration: underline;
    
    }
    
    #treeElement * .disabledTextNode:hover {
        cursor: default;
    
    }
    
    /* Div che da il problema su internet explorer */
    /*
    .ygtvchildren
    {	
    	height:1em;
    	border:1px solid #000;
    }
    */
    
    /* body */
    #bodyPnl {
    	border:4px solid #98b6d2;
    	vertical-align:top;
    	padding: 0;
    	margin: 0;
    	background-color: #eeeeee;
    }
    
    #bodyPnl * div.bd {									
    	background-color: #eeeeee;
    	width: 653px;
    
    }
    
    /* list */
    #listPnl {
    	vertical-align:top;
    	margin-left: -1px;
    	margin-top:0px;
    	border: 1px solid #dedede;			
    	border-bottom: 0px;
    	height: 220px;
    	overflow:auto;
    }
    
    #listPnl div.bd {
    	width: 635px;
    	background-color:#fbfcef;									
    	overflow:auto;
    }
    
    #listPnl div.bd table.reportList {
    	margin-top: 0px;
    	margin: 0px;
    	margin-right:2px;			
    	width: 630px;
    
    }
    #listPnl div.bd table.reportList tr {
    	border-bottom: 1px solid #bbb;			
    }
    
    #listPnl div.bd table.reportList tr.altr {
    	border-top: 1px solid #aaa;			
    }
    
    #listPnl div.bd table.reportList tr.hi {
    	border-bottom: 2px solid #6693BC;			
    }
    
    #listPnl div.bd table.reportList tr td {
    	padding: 0px;
    	background-color:#f6f3Fc;
    	cursor: pointer;
    	white-space: nowrap;
    	padding-left:4px;
    	padding-right:4px;
    	/*border-left: 1px dashed #dda;*/
    	border-bottom: 1px solid #cbcbcc;
    }
    
    #listPnl div.bd table.reportList tr:hover td  {
    	background-color: white;			
    }
    #listPnl div.bd table.reportList tr.altr:hover td {
    	background-color: #ececdc;
    }
    #listPnl div.bd table.reportList tr.altr td,
    #listPnl div.bd table.reportList tr.altr.hi td{
    	background-color: #e1e1d1;
    }
    
    #listPnl div.bd table.reportList tr.hi td,
    #listPnl div.bd table.reportList tr.altr.hi td,
    #listPnl div.bd table.reportList tr.hi:hover td,
    #listPnl div.bd table.reportList tr.altr.hi:hover td {
    	background-color:#feab46;
    	border-color: #6693BC;			
    	border-style: solid;
    	border-width: 2px;
    	border-left: 0;
    	border-right: 0;
    	color: #444444;
    }
    
    #listPnl div.bd table.reportList td img {
    	vertical-align:bottom;
    }
    
    #listPnl div.bd table.reportList td.ctrl {
    	padding-left: 0px;
    	padding-right: 0;			
    	width: 54px;
    }
    
    #listPnl div.bd table.reportList td.ctrl a {
    	color: blue;
        margin-top: 5px;
        height: 15px;	
    }
    
    #listPnl div.bd table.reportList tr.sep {
        border: 0px;
        margin-top: 5px;
        height: 15px;
    }
    
    #listPnl div.bd table.reportList tr.sep td {
        background-color: white;
        margin-top: 5px;
        padding-top: 5px;
        font-size: 11pt;
        color: gray;
    }
    
    /* preview */
    #previewPnl {			
    	vertical-align:top;														
    	border-top: 0px;
    	margin-top:0px;
    	border: 0px;			
    	border: 1px solid #dedede;						
    	border-top: 0px;
    }
    
    
    
    
    #previewPnl div.bd {			
    	background-color:#fbfcef;
    	height:260px;
    	overflow:auto;																
    }
    
    #previewPnl div.bd div.rpContainer {
    	overflow:auto; height:100%;
        padding: 0px;
        margin: 0px;
    }
    
    #previewPnl div.bd div.rpContainer * {
    	padding: 0px;
    	margin: 0px;
    }
    
    #previewPnl div.bd div.rpContainer iframe {
        width: 653px;
        height: 224px;
        border: 0px;
        font-size: 2pt;
    }
    
    
    /* Riga arancione che non si vede in IE6*/
    #previewPnl div.hd {
    	border-top: 0px;
    	border-bottom: 0px;
    	background-color: #E0903F;
        min-height: 5px;
        padding: 0px;
        overflow: visible;
    }
    
    #previewPnl div.hd .summary {
        font-size: 9pt;
        padding-left: 5px;
        height: 50px;
    }
    
    #previewPnl div.hd .summary span {
        color: #444444;
    }
    
    #previewPnl .ctrl {
        font-size: 9pt;
        padding-right: 4pt;
        background-color:white;
        margin: 0px;
    }
    
    #previewPnlCtrl
    {
    	top:30px;
    }
    
    #previewPnl .ctrl a {
        font-weight: normal;
        /*background-color: #eeeeee;*/
        padding-left: 3px;
        padding-right: 3px;
        margin-left: 3px;    
    }
    
    #previewPnl .ctrl.disabled  {
        display: none;
    }
    
    .yui-log .calendar {
    	border: 2px solid #00C816;
    	background-color: #88FF83;
    }
    
    .yui-log .tree {
    	border: 2px solid #00C816;
    	background-color: #88FF83;
    }
    
    .yui-log .preview {
    	border: 2px solid #00C816;
    	background-color: #88FF83;
    }
    
    .yui-log .list {
    	border: 2px solid #00C816;
    	background-color: #88FF83;
    }
    
    .yui-log .userctrl {
    	border: 2px solid #FFC000;
    	background-color: #FBDF87;
    }
    
    .yui-log .netctrl {
    	border: 2px solid #FFC000;
    	background-color: #FBDF87;
    }
    
    .yui-log .user {
    	border: 2px solid #0097FF;
    	background-color: #A0D8FF;
    }
    
    .yui-log .net {
    	border: 2px solid #0097FF;
    	background-color: #A0D8FF;

  6. #6
    qualè lo stile che fa riferimento alla sezione id="ygtvc11"??

  7. #7

    Re: nascondere div vuoto

    Originariamente inviato da patrick82
    con firefox tutto bene, mentre con ie6 quando c'p il div ygtvc11 vuoto, a video mi fa vedere ugualmente il div con un altezza di circa 1em. ho provato a forzare la height a 0px ma non succede nulla.. come posso non farlo vedere quando dentro al div non c'è nulla?
    grazie
    Ribalto la domanda. Perché hai inserito un div vuoto? In fondo, non aggiunge nessuna informazione, no? Allora può essere eliminato. Sono sicuro che esiste un'alternativa.

    Se generi le pagine dinamicamente e ti trovi talora ad avere un div vuoto, prova ad aggiungergli un &amp;nbsp; che genera uno spazio vuoto, che dovrebbe essere interpretato come testo.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.