It is possible to show in the browser a empty xml element with css

0

I have this xml code for example:

<br>
    <?xml version="1.0" encoding="iso-8859-1"?>
    <raiz>
       <activo/>
    </raiz>
<br>

and I would like to show the active word in the browser by applying css.

    
asked by Javier Reyero Huerga 08.06.2017 в 13:01
source

2 answers

0

With CSS, you can select the elements% co_of% empty: activo ( link ). For example, the rule

activo:empty {
    border: 1px solid red;
}

causes the browser to put a border on active:empty elements that have no content (except comments).

You can also insert content in these elements with the activo selector, for example:

activo:empty::before {
    content: 'empty';
}

raiz, activo {
	display: block;
}
activo:empty {
	border: 1px solid red;
}
activo:empty::before {
	content: 'empty';
}
<raiz>
	<activo></activo>
	<activo>contenido</activo>
</raiz>
    
answered by 08.06.2017 / 16:08
source
0

I self-answer is already fixed by adding CSS activo:before { content: "Activo"; }

    
answered by 08.06.2017 в 16:08