:not 선택자
이미 지정된 css스타일에서 특정한 요소를 제외시킬 경우 사용한다.
선택할 요소:not(제외시킬 요소){...}
예제
<!DOCTYPE html>
<html>
<head>
<style>
#test p:not(.highlight) {
color: blue;
}
</style>
</head>
<body>
<div id="test">
<p>This is a normal paragraph.</p>
<p class="highlight">This paragraph has a "highlight" class and will not be affected.</p>
<p>This is another normal paragraph.</p>
<p>This is a third normal paragraph.</p>
</div>
</body>
</html>
결과
This is a normal paragraph.
This paragraph has a "highlight" class and will not be affected.
This is another normal paragraph.
This is a third normal paragraph.
728x90
'WEB > HTML_CSS' 카테고리의 다른 글
[html] <video> 태그 자동 재생 (0) | 2023.07.18 |
---|---|
[CSS] 텍스트 길면 ... 표시하기 (0) | 2023.07.12 |
[CSS] border 안쪽으로 주기 box-shadow (0) | 2023.07.05 |
[HTML] 모바일웹에서 자동링크 해제하기 format-detection (1) | 2023.06.19 |