2013-08-16 4 views
1

HTML/CSS ниже работает в последних браузерах, но не в cfdocument CF9. Кто-нибудь с идеями? Я хотел бы использовать свойство inline-block в cfdocument, если можно. Или, может быть, есть альтернатива для получения аналогичных результатов?Использование встроенного блока CSS в cfdocument

ЧТО Я ЗНАЮ?
Я знаю, что cfdocument CF поддерживает ограниченный набор свойств CSS (CSS1/CSS2). В документации CF говорится, что она поддерживает "display" CSS property. Однако он не определяет, какие значения поддерживаются. Я включил ожидаемый результат и некоторый пример кода.

ЗАПЛАНИРОВАННЫЕ (см рисунок ниже)
IMG http://i44.tinypic.com/35apx53.jpg

Пример КОД

<cfdocument format="PDF" pagetype="letter"> 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
    <title>CSS Demo: Display Property (block, inline, inline-block)</title> 
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 
</head> 

<body style="margin: 0; padding: 0"> 

<style> 
.container { margin-left: 2em; width: 35em; border: none; } 
div { margin: 1em 0; border: solid 1px red; } 
p { margin: 1em 0; border: dotted 2px blue; } 
div#one p { display: block; width: 6em; text-align: center; } 
div#two p { display: inline; width: 6em; text-align: center; } 
div#three p { display: inline-block; width: 6em; text-align: center; } 
</style> 

<div class="container"> 
    <div id="one"> 
     <strong>TEST 1: block</strong> This text is within block-level level element (DIV). 
     <p>Here's a block-level paragraph (P).</p> 
     Here's some additional text still inside a block-level elment. 
    </div> 
    <div id="two"> 
     <strong>TEST 2: inline</strong> This text is within block-level level element (DIV). 
     <p>Here's an inline paragraph (P).</p> 
     Here's some additional text still inside a block-level element. 
    </div> 
    <div id="three"> 
     <strong>TEST 3: inline-block</strong> This text is within block-level level element (DIV). 
     <p>Here's an inline-block paragraph (P).</p>  
     Here's some additional text still inside a block-level element. 
    </div> 
</div> 

</body> 
</html> 
</cfdocument> 
+0

какой формат вам нужно использовать в cfd ocument? вы пытались с помощью формата = pdf? – shemy

+0

Упс! Я обновил код примера выше. Первая строка должна включать . Спасибо @shemy. – ArdMan

+0

'cfdocument' в CF9 поддерживает только следующие значения CSS1' display': 'inline | блок | none'. 'display: inline-block' был добавлен в CSS2 и не поддерживается. – CfSimplicity

ответ

0

Вы можете попробовать плавать вместо дисплея: follow link

.container { margin-left: 2em; width: 35em; border: none; } 
div { margin: 1em 0; border: solid 1px red; } 
p { margin: 1em 0; border: dotted 2px blue; } 
div#one p { float: right; width: 6em; text-align: center; } 
div#two p { float: right; width: 6em; text-align: center; } 
div#three p { float:right; width: 6em; text-align: center; } 
.clear {clear:both; border:0px}