2012-03-19 114 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>