有背景颜色和图象的Html按钮

时间:2015-04-08 19:56:44

标签: html css asp.net webforms

我正在维护asp网络表单应用程序,我正在尝试使用按钮来渲染FF,IE和Chrome中的图像和背景颜色。这是代码的样子。

仅使用以下行,所有浏览器都会渲染没有我设置的背景颜色的图像:

newButton.Style["background"] = string.Format("{1} inherit url({0}) no-repeat inherit center", imgSrc, backgroundColor);

即使添加以下行,背景也不会着色:

newButton.Style["background-color"] = "blue";

如果我将'!important'指令添加到上面的行,那么IE和Chrome会呈现背景颜色。 FF仍然显示'background-color:transparent'和'background:url(...)transparent'

我在这里缺少什么?

0 个答案:

没有答案
相关问题