CSS Target Attribute [Snippet] <> No-Code Supply Co.
CSS Target Attribute
/* Select elements with a specified attribute and value. */
a[target="_blank"] {
color: red;
}
/* Select elements with an attribute value containing a specified WORD. */
svg[title~="flower"] {
border: 5px solid yellow;
}
/* Select elements with the specified attribute, whose value can be exactly the specified value, or the specified value followed by a hyphen (-). */
h2[class|="top"] {
background: yellow;
}
/* Select elements with the specified attribute, whose value STARTS with the specified value. */
[class^="top"] {
background: yellow;
}
/* Select elements whose attribute value ENDS with a specified value. */
[class$="test"] {
background: yellow;
}
/* Select elements whose attribute value contains a specified value, which does NOT have to be a whole word. */
[class*="te"] {
background: yellow;
}

Alter the style of an element with CSS by targeting a custom attribute you add to it. Learn more about the possibilities with attribute selectors here: https://www.w3schools.com/css/cssattributeselectors.asp

Tags

Have feedback or a question related to this item? Drop us some feedback!

Curated: 
10.30.20

Similar items

Lapz

11.7.24

Unblocked AI Figma Plugin

11.7.24

Onx UI

11.7.24

Webflow With Cloudflare Proxy On (My New Kickass Method!)

10.30.24

1-800-D2C

10.30.24

Perplexity Supply

10.30.24

Glyphic

10.30.24

Wand

10.30.24

Check

10.29.24

Flow Sparrow

10.29.24

FlowMapp

10.29.24

Popcorn

10.29.24

Autopilot

10.29.24

ShareClub

10.29.24

Fitonist App

10.29.24

Wayfinder Ventures

10.29.24

Groteskly Yours Studio

10.28.24

Reweb

10.27.24

MINO

10.27.24

Biograph

10.27.24

Bleed Design Studio

10.27.24

Frameblox

10.27.24

Rotato

10.24.24

También Studio Courses

$99+
10.24.24

CSS Hamburgers

10.24.24

X Shack

10.24.24
Load more

Bummer, no results

Try a different search/filter combo, or drop us some feedback if there is something missing you would love to see!

Reset filters

Subscribe for updates

Get updates on the latest curated resources and be the first to hear of new features.