将 css 样式应用于所有 asp.net 文本框和文本类型的 Html 输入

发布于 2024-12-19 02:53:49 字数 77 浏览 3 评论 0原文

我正在使用 asp.net 网站,我需要将 css 样式应用于所有文本框和 html 输入,并在一处键入文本。 我希望在这个问题上帮助我..

I'm using asp.net website and I need to apply css style to all text boxes and html Input with type text in one place.
I hope to help me in this issue ..

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

千柳 2024-12-26 02:53:49

您可以使用 CSS 来做到这一点:

[type=text] {
    color:Red;
    border: 1px solid black;   
}

这会将该样式应用于作为文本类型输入的任何元素。这也适用于 ASP 文本框控件,因为它呈现为具有文本类型的输入。

You can do this with CSS:

[type=text] {
    color:Red;
    border: 1px solid black;   
}

This will apply that style to any element that is an input of type text. This will also work with the ASP text box control because that renders out as an input with a type of text.

早乙女 2024-12-26 02:53:49

上面的 CSS 将显示:

错误“意外的字符序列。需要样式规则的选择器。”

您必须编写以下代码:

input[type=”text”] { 
    color:Red; 
    border: 1px solid black;   
}

The above CSS will show:

Error "Unexpected Character Sequence.Expected a selecter for style Rule."

You have to write the following code:

input[type=”text”] { 
    color:Red; 
    border: 1px solid black;   
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文