Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/29.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net ASP文本框标签字体颜色_Asp.net_Colors_Textbox_Label - Fatal编程技术网

Asp.net ASP文本框标签字体颜色

Asp.net ASP文本框标签字体颜色,asp.net,colors,textbox,label,Asp.net,Colors,Textbox,Label,我希望更改应用于文本框的ASP标签的字体颜色,但不确定要使用什么属性。在我下面展示的内容中,我想更改“Student Search:”的字体颜色,因为我认为默认为黑色,但标签位于黑色背景之上,因此我目前无法看到它 <asp:Label id="label" AssociatedControlId="masterSearchBox" Text="Student Search: " runat="server"/> <asp:TextBox id="masterSear

我希望更改应用于文本框的ASP标签的字体颜色,但不确定要使用什么属性。在我下面展示的内容中,我想更改“Student Search:”的字体颜色,因为我认为默认为黑色,但标签位于黑色背景之上,因此我目前无法看到它

<asp:Label id="label" AssociatedControlId="masterSearchBox" Text="Student Search: " 
    runat="server"/>

<asp:TextBox id="masterSearchBox" runat="server" placeholder="Enter Student Name..."/>

您应该使用CSS类来控制字体颜色和您拥有的内容。在css文件中,输入类名,并确保asp页面引用了css文件

.YourClassName{
颜色:白色;
}

我认为您需要添加背景色:#000;这显示了如何设置标签的字体颜色。没有了。是的,但是代码段不会显示它,因为默认的背景颜色是白色。如果你读了这个问题,你会看到OP将背景颜色设置为黑色。