코드:
결과보기 »
<!DOCTYPE html> <html lang="ko"> <head> <meta charset="UTF-8"> <title>CSS State Selectors</title> <style> span { margin-left: 5px; } input { color: #FFEFD5; } input:checked + span { color: #CD853F; } </style> </head> <body> <h1>input 요소의 스타일 설정</h1> <form> <input type="checkbox" name="lecture" value="html" checked="checked"><span>HTML</span><br> <input type="checkbox" name="lecture" value="css"><span>CSS</span><br> <input type="checkbox" name="lecture" value="java"><span>JAVA</span><br> <input type="checkbox" name="lecture" value="cpp"><span>C++</span> </form> </body> </html>