简体   繁体   English

C#WebBrowser,设置div的不透明度

[英]C# WebBrowser, setting opacity of div

I'm using a WebBrowser in my C# application to display my web page. 我在我的C#应用​​程序中使用WebBrowser来显示我的网页。 I have a div that is set to semi-transparent using the standard rgba: 我有一个使用标准rgba设置为半透明的div:

background-color:rgba(255,0,255,0.5);

It works fine in Firefox and my IE 10 but just doesn't appear in my C# WebBrowser. 它在Firefox和我的IE 10中运行良好,但只是没有出现在我的C#WebBrowser中。

Is there a way I can work around this and make a semi-transparent background for a C# WebBrowser? 有没有办法解决这个问题并为C#WebBrowser创建一个半透明的背景?

maybe try something like: 也许尝试类似的东西:

background-color: #ff00ff;
filter:alpha(opacity=50);
opacity: .5;

and this question might have some insights (read all the answers/comments) How do I give text or an image a transparent background using CSS? 这个问题可能有一些见解(阅读所有答案/评论) 如何使用CSS为文本或图像提供透明背景?

Awesomium and Awesomium.NET is an HTML UI Engine that supports just that. AwesomiumAwesomium.NET是一个支持HTML UI引擎。

Check the WPF WebControl . 检查WPF WebControl You can set WebControl.IsTransparent to true , and load some content with say body { background-color: transparent; } 您可以将WebControl.IsTransparent设置为true ,并使用say body { background-color: transparent; } body { background-color: transparent; } (you can even specify a custom CSS to be applied to all loaded pages, using WebSession ). body { background-color: transparent; } (你甚至可以指定要应用到所有加载页面的自定义CSS,使用WebSession )。

via Perikles C. Stephanidis 通过Perikles C. Stephanidis

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM