Files
freeCodeCamp/guide/english/css/selectors/attribute/star/index.md

34 lines
565 B
Markdown
Raw Normal View History

2018-10-12 15:37:13 -04:00
---
title: Star
---
## Star
Star CSS attribute selector or * is used for selecting attributes that contain specific value.
2018-10-19 15:55:57 +02:00
### CSS Syntax
```css
attribute *= value {
css declarations;
}
```
2018-10-12 15:37:13 -04:00
#### Example
If you want to search all anchor links that contain "code" anywhere in the URL value and make them yellow, you can do it like this:
```css
a[href*="code"] {
color: yellow;
}
```
2018-10-19 15:55:57 +02:00
Set a background color on all `<div>` elements that have a class attribute value containing "backing":
```css
div[class*="backing"] {
background: #ffff00;
}
```