CSS Attribute Selector

Creator
Creator
Seonglae ChoSeonglae Cho
Created
Created
2022 Jan 22 11:7
Editor
Edited
Edited
2023 Oct 23 5:33
Refs
Refs

style 에 많이 사용

/* <a> elements with an href containing "example" */ a[style*="color: blue"] { font-size: 2em; }
 
/* Internal links, beginning with "#" */ a[href^="#"] { background-color: gold; }
 
/* <a> elements with a title attribute */ a[title] { color: purple; } /* <a> elements with an href matching "https://example.org" */ a[href="https://example.org"] { color: green; } /* <a> elements with an href ending ".org" */ a[href$=".org"] { font-style: italic; } /* <a> elements whose class attribute contains the word "logo" */ a[class~="logo"] { padding: 2px; }
 
 
 
 
 

Recommendations