- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Style elements with a "readonly" attribute with CSS
To select elements that are read-only, use the CSS :read-only selector.
Example
You can try to run the following code to implement the :read-only selector
<!DOCTYPE html> <html> <head> <style> input:read-only { background-color: blue; color: white; } </style> </head> <body> <form> Subject: <input type = "text" name = "subject" value = "Maths"><br> Student: <input type = "text" name = "student" readonly value = "Amit"><br> </form> </body> </html>
Advertisements