tags:

views:

63

answers:

5

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?

+3  A: 

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

Andreas Niedermair
+2  A: 
#input { border:0; background:transparent; }
meder
+2  A: 
#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.

casablanca
+1  A: 

Tried something along the lines of:

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

noBorderAndBackground{
   background-color:white;
   border-style:none;
}
Jason B-H
+2  A: 
<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>
ttchong