_yoonie
개발일기
_yoonie
전체 방문자
오늘
어제
  • 분류 전체보기 (70)
    • 개발일기 (2)
    • DB (8)
      • MySQL (2)
      • PostgreSQL (6)
    • WEB (30)
      • JAVASCRIPT (7)
      • Vue.js (2)
      • MyBatis (3)
      • PHP (7)
      • HTML_CSS (5)
      • etc. (3)
    • Java (9)
    • Android (5)
    • Kotlin (0)
    • C# (3)
    • Python (2)
    • 개발 툴 (5)
    • 기획 (1)
    • 자료실 (2)
    • React (0)

인기 글

태그

  • java programming
  • 안드로이드스튜디오
  • androidstudio
  • PostgreSQL
  • CSS
  • c#
  • VirtualBox
  • Java
  • 기획
  • ubuntu

최근 댓글

최근 글

티스토리

160x600
hELLO · Designed By 정상우.
_yoonie

개발일기

[CSS] 특정한 요소를 제외시키는 :not 선택자
WEB/HTML_CSS

[CSS] 특정한 요소를 제외시키는 :not 선택자

2023. 6. 21. 13:36

: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
    _yoonie
    _yoonie
    일상이 개발인 개발자의 일상

    티스토리툴바