2010-07-13 73 views

回答

4

因爲你沒有提供有關的CSS版本的任何信息,這裏有一個例子:

<style type="text/css"> 
    input[type=text] 
    { 
     border: 0px; 
     background: transparent; 
    } 
</style> 
<input type="text" value="helllo" /> 

working demo

2
#input { border:0; background:transparent; } 
2
#your_text_field { 
    border-style: none; 
    background-color: transparent; 
} 

編輯:哦,你怎麼知道, transparent實際上適用於IE6。我記得它不適用於某些屬性,例如border

1

試圖沿着線的東西:

<input class="noBorderAndBackground" type="text" /> 

noBorderAndBackground{ 
    background-color:white; 
    border-style:none; 
} 
2
<html> 
<head> 
<style type="text/css"> 
    input.asLabel 
    { 
     border: none; 
     background: transparent; 
    } 
</style> 
</head> 
<body> 
<form> 
    <input class="asLabel" type="text" value="See, don't touch :)" disabled/> 
</form> 
</body> 
</html>