I'd have thought the best solution is to use the technology as design and set the method of the output to be HTML. There are a few tags like this, switching this means you let the technology handle it all for you :)
Regardless of location (XSLT macro, static page or template). Some browsers if you are using HTML Strict will take <div></div> and convert it to <div /> so its always worth using the nbsp method.
If you are just using the empty div to stop floated elements overflowing out of the surrounding div, then you can use CSS to achieve this and get rid of the div al together using the overflow:hidden; or overflow:auto; styles on the holding div.
Self closed empty div breakes design
In XSLT I insert empty div to clear float.
<div style="clear: both"></div>
It generates short self closed div:
<div style="clear: both" />
Such self closed div breakes disign in ALL browsers. Usual closed does not.
How can I generate usual closed div?
I tried use
<xsl:value-of select="<div style="clear: both"> <div>" disable-output-escaping="yes" />
but I can not save such XSLT.
Alex,
Please refer to http://our.umbraco.org/wiki/how-tos/xslt-useful-tips-and-snippets/stop-html-tags-from-self-closing
Regards
Ismail
I do this!
I generates empty usual closed div by using variable.
I usually just use a non-breaking space, like this:
<div class="clear"> </div>
CCS:
div.class{clear:both; height:0px;}
I'd have thought the best solution is to use the technology as design and set the method of the output to be HTML. There are a few tags like this, switching this means you let the technology handle it all for you :)
<xsl:output method="html" omit-xml-declaration="yes" />
Its generally considered best practice to use...
Regardless of location (XSLT macro, static page or template). Some browsers if you are using HTML Strict will take <div></div> and convert it to <div /> so its always worth using the nbsp method.
If you are just using the empty div to stop floated elements overflowing out of the surrounding div, then you can use CSS to achieve this and get rid of the div al together using the overflow:hidden; or overflow:auto; styles on the holding div.
is working on a reply...