Table of Contents

Селектор html атрибута

/* <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 containing "example" */
a[href*="example"] {
    font-size: 2em;
}

/* <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;
}

w96k Ⓐ 2019-2022

2022-10-16 Sun 19:30