2011-05-19 50 views
0

需要一个div来部分显示背后的图像,这甚至有可能吗?尝试:在cfdocument pdfs中div可以部分透明吗?怎么样?

opacity:.5; 

filter:alpha(opacity=50); 

两个产生固体股利。

任何帮助将不胜感激。

+0

我对cfdocument一无所知,但是您是否尝试过'background-color:rgba(0,0,0,0.5)'? – 2011-05-19 22:49:43

+0

@Demian Brecht:谢谢你的想法,但仍然给我一个坚实的div。 – invertedSpear 2011-05-19 23:09:51

+0

你尝试过使用半透明的'.png'吗? – thirtydot 2011-05-19 23:20:15

回答

1

从一个奇妙的纯猜测的评论,我设法找到工作的答案:

你尝试使用半透明 .png

耶!

0

对,你是十三岁!你必须为cfdocument折腾大拇指,呃?

我已经证实这个在CF9中的作品。我怀疑这个例子是否向后兼容。
任何人都可以确认其他ColdFusion版本支持吗?

<cfdocument format="PDF" pagetype="letter" 
    margintop="0.5" marginbottom="0.5" 
    marginleft="0.5" marginright="0.5"> 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html> 
<head> 
    <style type="text/css"> 
    body { background-image: url("images/use_your_image.jpg"); } 

    img { border: 3px solid #990000; } 
    </style> 
</head> 
<body> 
    Does transparent image appear above the background repeated image? 
    <img src="images/red_transparent_100x100.png"> 
    <!--- Generated this at http://transparent-png-generator.com/ ---> 
</body> 
</html> 

</cfdocument> 
+0

我在使用CF7时遇到了问题,并且没有问题使用半透明.png – invertedSpear 2012-08-27 16:45:02

相关问题