Reputation: 28324
I have a text field and I dont want to show border around it as it is a read-only text field. How can I make it to appear without the border and without the background color?
Upvotes: 1
Views: 6291
Reputation: 317
<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>
Upvotes: 2
Reputation:
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" />
Upvotes: 5
Reputation: 182
Tried something along the lines of:
<input class="noBorderAndBackground" type="text" />
noBorderAndBackground{
background-color:white;
border-style:none;
}
Upvotes: 1
Reputation: 70721
#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
.
Upvotes: 2