coldfusioncoldfusion-9coldfusion-8

Nested floats do not work in CFDOCUMENT css


The below html was provided inside a <cfdocumentitem type="header"> block. But the output is empty.

<div class="grid">                              
    <div class="span5">
        <div class="span5">
            Label1
        </div>
        <div class="span5">
            Data1
        </div>
    </div>
    <div class="span5">
        <div class="span5">
            Label2
        </div>
        <div class="span5">
            Data2
        </div>
    </div>
    <div style="clear:both"></div>
</div>

But when I remove the nested 'class="span5"' divs and put some content there, it is working fine. Is there any problem with nested float in cfdocument???


Solution

  • Unfortunately, CSS support in CFDOCUMENT is kind of hit or miss.

    2 rules to follow that might help:

    1. Make sure your HTML validates as XHTML 1.0 Transitional
    2. Import your style sheets using

      <style type="text/css" media="screen">@import "style.css";</style>
      

    This same information can be found here: http://rip747.wordpress.com/2007/09/10/cfdocument-it-works-if-you-know-how/