Computer >> 컴퓨터 >  >> 프로그램 작성 >> CSS

CSS [속성=값] 선택기의 역할

<시간/>

[attribute="value"] 선택기를 사용하여 지정된 속성 및 값을 가진 요소를 선택합니다.

다음 코드를 실행하여 CSS [attribute="value"] 선택기를 구현할 수 있습니다. 여기에서는 속성을 rel,으로 간주했습니다.

예시

<!DOCTYPE html>
<html>
   <head>
      <style>
         a[rel = nofollow] {
            border: 3px solid orange;
         }
      </style>
   </head>
   <body>
      <a href = "https://qries.com/What-is-Uber-s-business-model-and-how-does-it-compare-with-Ola-s-model-in-India" rel="nofollow">Uber's Business Model</a><br><br>
      <a href = "https://www.qries.com/How-does-share-market-work-in-India" rel="noreferrer">Share Market</a>
   </body>
</html>