TextBox Style Like Label?

J

John Saunders

localhost said:
How can I style a TextBox so it appears like a label when rendered?

I don't think you can. A TextBox and a Label are two different things. A
Label renders "like a label" not because of its styles, but because the
Label control renders as a <span/> element. A TextBox renders as a text box
because it renders as a <input type="text"> element.

John Saunders
 
J

James Thomas

I have used CSS to accomplish the reverse (make a label appear like a
textbox) but it should be easily done using CSS, something similar to
below perhaps:

/* Works for all textboxes */
input {
border: none;
background-color: <page background color>
}

/* Works for textboxes with a class of label
input.label {
<same as above>
}

I tested this briefly on my development machine and it works like a
charm.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top