본문 바로가기
study/Html

[Html] 7. htmlcss (input 선택자 : <input>, <:enabled>, <:disabled>, <value>, <readonly>, <disabled>)

by 금이패런츠 2022. 4. 4.
728x90
반응형
<!-- src/main/webapp/7/otherselector.html -->
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>input 선택자</title>
<style type="text/css">
	input[type=text] {
		background-color: yellow; 
		whdth: 50%;
	}
/* input 태그에 입력이 가능한 경우 글자크기를 30px로 설정*/
	input[type=text]:enabled {
		font-size: 30px;
	}
/* input 태그에 입력이 불가능한 경우 배경색을 검정, 글자색을 흰색으로 설정*/
	input[type=text]:disabled {
		background-color: black;
		color : white;
	}
</style>
</head>
<body>
	아이디 : <input type="text" value="입력가능"><br>
	이름  : <input type="text" value="입력불가능" readonly="readonly"><br>
	주소  : <input type="text" value="입력불가능" disabled="disabled"><br>
</body>
</html>
728x90
반응형