반응형

2024/11 80

CSS selection (문구 드래그 시 색상 변경하기)

DOCTYPE html>html lang="kr"> head> title>The Nick Timestitle> style> body { height: 1000vh; margin: 50px; } p::selection { background-color: yellowgreen; } style> head> body> p>안녕하세요 반갑습니다. CSS 독학 독하게 하는 중입니다.p> body>html>      결과문구를 드래그하면 yellowgreen으로 바뀜ㅋㅋ 오.. 신기해   (참고)https://developer.mozilla.org/en-US/docs/Web/CSS/::selection

2. CSS 2024.11.30

CSS visited, hover, focus 동시에 사용하기

DOCTYPE html>html lang="kr"> head> title>The Nick Timestitle> style> body { height: 1000vh; margin: 50px; } a:visited { color: tomato; } a:hover { color: teal; } a:focus { color: turquoise; } style> head> body> a href="https://appl.com">Go to applea> body>html>    결과   마우스 오버 시: teal 색상으로 변경마우스 클릭 시: turquoise 색상으로 변경클릭 후 새로고침 시:  tomato 색상으로 변경

2. CSS 2024.11.30

CSS 특정 단어가 포함된 placeholder 꾸미기

placeholder에 "name" 이라는 단어를 포함한 모든 input의 배경색을 pink로 설정해보기 DOCTYPE html>html lang="kr"> head> title>The Nick Timestitle> style> body { height: 1000vh; margin: 50px; } input { border: 1px solid wheat; } input:required { border-color: tomato; } input[placeholder~="name"] { background-color: pink; } style> head> body> div> form> input type="text" placeholder="First name" /> input type="text" placeh..

2. CSS 2024.11.29
반응형