2010-07-13 72 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>