CSS uses expression to differentiate read-only text boxes

Source: Internet
Author: User
In the text box, the browser does not make any special mark on it in the read-only and normal status. On the surface, the effect is the same. In this way, for users, ease of use is not very high.

Of course, we can change the background color of the read-only text box to distinguish between them.ProgramThe member determines whether the text box is read-only and then introduces the corresponding CSS, which undoubtedly increases the workload.

Here, expression is used to provide a solution. You only need to introduce this CSS to each page. The program determines the other items as follows:

<Style>
Input {background-color: expression (this. readonly & this. readonly = true )? "# F0f0f0 ":"")}
</Style>
<Input type = "text" name = "">
<Input type = "text" name = "" readonly>
<Input type = "text" name = "">
<Input type = "text" name = "" readonly>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.