읽기 전용 요소를 선택하려면 CSS :read-only 선택기를 사용하세요.
예시
다음 코드를 실행하여 :read-only 선택기를 구현할 수 있습니다.
<!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>