将所有文本框(输入字段)的背景颜色设置为透明

时间:2010-09-22 15:12:39

标签: asp.net css textbox

我正在升级一个非常古老的网站的一部分。我拥有的其中一个页面使用的控件和dll我没有。有一个dll在页面上放置一个文本框(输入字段)。该字段是概念上的标签,但该人选择使用文本框。无论如何,我无法改变dll。

我的asp.net页面中是否有一种方法可以使用dll来说明此页面上的所有文本框都应该具有透明背景?

这是我可以访问的代码。我所做的任何改变都必须在这里进行。

<asp:Content ID="Content1" ContentPlaceHolderID="bodyContent" Runat="Server">
<style type="text/css">
.heading { color:#007DC3; font-weight:300; font-size:1.5em; line-height:1.22em; margin-bottom:22px; }
</style> 
    <cc1:wizard id="wizCtl" runat="server"></cc1:wizard>
</asp:Content>

谢谢!

像这样?

<div style = "input[type='text']{ 
border: none; 
background-color: transparent; 
} 
">
    <cc1:wizard id="wizCtl" runat="server"></cc1:wizard>
</div>

它似乎无法运作......

也试过这个:

<style input [type='text']{ border: none; background-color: transparent;} >

<cc1:wizard id="wizCtl" runat="server"></cc1:wizard>

</style>

6 个答案:

答案 0 :(得分:1)

试试这个

input[type='text']{
border: none;
background-color: transparent;
}

答案 1 :(得分:1)

我可以看到你的问题。 将您的代码更改为

<style type='text/css'>div.tbwrap input[type='text']{ border: none; background-color: transparent;}</style>
<div class='tbwrap'><cc1:wizard id="wizCtl" runat="server"></cc1:wizard></div>

你的样式标签有点偏离我并不认为'cc1:wizard'标签应该在样式标签内。

答案 2 :(得分:0)

这就是你所追求的:

<style>
  input {border:0;}
</style>

答案 3 :(得分:0)

input[type='text']
{
    border: none;
    background-color: transparent;
}

答案 4 :(得分:0)

试试这个:

在doc的头部:

<style type="text/css">

   div#someDiv input[type='text']{ 
   background-color: transparent; 
   } 

</style>

然后用div包装你的文本框并给它一个ID

<div id="someDiv">
    <cc1:wizard id="wizCtl" runat="server"></cc1:wizard> 
</div>

答案 5 :(得分:0)

<asp:Content ID="Content1" ContentPlaceHolderID="bodyContent" Runat="Server">
<style type="text/css">
.heading { color:#007DC3; font-weight:300; font-size:1.5em; line-height:1.22em; margin-bottom:22px; }
input[type='text']{
    border: none;
    background-color: transparent;
}
</style> 
<cc1:wizard id="wizCtl" runat="server"></cc1:wizard> <!-- if this does transform into a text input, check the page source just to be certain -->
</asp:Content>
相关问题