2012-03-19 119 views
0

我想知道如何在文本框中强调我的文本(如果可能,CSS解决方案)?下划线文本框内的文本

<textarea> 
MyText 
</textarea> 

现在Text:MyText应该加下划线。

感谢

回答

6

相当CSS的简单一点:

textarea { 
    text-decoration: underline; 
} 

这将真正地强调在textarea的文本的每一个位。

1

要么使用border-bottom:1px solid black;强调整个文本框,或

text-decoration:underline;强调只有这盒子里面的文字。由于您使用textarea,我认为这是您想要的。

1
textarea { text-decoration:underline; } 

如果不 “取”,你可能会迫使风格:

textarea { text-decoration:underline!important; } 

或添加更多的特异性:

body form textarea { text-decoration:underline; } 
0

是的,你可以使用CSS,像这样:

<html> 
<head> 
    <title>Texarea css example</title> 
    <style type="text/css"> 
    #t { 
     text-decoration: underline; 
    } 
    </style> 
</head> 
<body> 
    <textarea id="t">your text here</textarea> 
</body> 
</html>