tags:

views:

90

answers:

3

So i have a text input

<input type="text" value="3" class="field left">

Here is my css for it

background:url("images/number-bg.png") no-repeat scroll 0 0 transparent;
border:0 none;
color:#FFFFFF;
height:17px;
margin:0 13px 0 0;
text-align:center;
width:17px; 

Here is the page

Is there a setting or a trick to this, I was thinking of doing a label instead but how about the styling. How do I convert them and is there a better way or is that the only way

+7  A: 
<input type="text" value="3" class="field left" readonly="readonly" />

XHTML validity pedantry: self-closing elements need that / at the end.

BoltClock
+2  A: 

You can add the attribute readonly to the input.

<input type="text" value="3" class="field left" readonly="readonly" >

http://www.w3schools.com/tags/att_input_readonly.asp

Litso
A: 

You can use readonly attribute, if you want your input only to be read. And you can use disabled attribute, if you want input to be shown, but totally disabled (even processing languages like PHP wont be able to read those).

Tom