How to style a text field so it doesnt have a border?
I have a text field and I dont want to show border around it as it is a read-only te开发者_如何学编程xt field. How can I make it to appear without the border and without the background color?
since you did not give any information about the css version, here's an example:
<style type="text/css">
input[type=text]
{
border: 0px;
background: transparent;
}
</style>
<input type="text" value="helllo" />
working demo
#your_text_field {
border-style: none;
background-color: transparent;
}
Edit: Oh well, what do you know, transparent
actually works on IE6. I remember it not working for certain attributes, such as border
.
#input { border:0; background:transparent; }
<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>
Tried something along the lines of:
<input class="noBorderAndBackground" type="text" />
noBorderAndBackground{
background-color:white;
border-style:none;
}
精彩评论