5

有没有办法让 asp.net 控件中的文本框仅显示为下划线,就像在纸质文档中放置空白用于文本输入一样?

4

2 回答 2

12

应用固体border-bottom

<asp:TextBox id="txt" runat="server" CssClass="underlined" />

CSS:

input.underlined
{
   border:0;
   border-bottom:solid 1px #000;
   outline:none; /* prevents textbox highlight in chrome */
}

-- 查看工作演示 --

于 2012-12-10T11:30:37.783 回答
0

我认为如果您只想在打印时更改它,那么您应该像这样使用

对于普通屏幕

@media screen
{
   input.underlined
   {
    /*put your attributes here*/
   }
}

用于打印屏幕

@media print
{
  input.underlined
  {
    border:0;
    border-bottom:solid 1px #000;
   }
}
于 2012-12-10T11:52:33.697 回答