Added a CSS syntax and Example
This commit is contained in:
committed by
Kristofer Koishigawa
parent
e659e5ecf5
commit
f5cd5cd715
@ -5,6 +5,14 @@ title: Star
|
||||
|
||||
Star CSS attribute selector or * is used for selecting attributes that contain specific value.
|
||||
|
||||
### CSS Syntax
|
||||
|
||||
```css
|
||||
attribute *= value {
|
||||
css declarations;
|
||||
}
|
||||
```
|
||||
|
||||
#### 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:
|
||||
@ -15,3 +23,11 @@ a[href*="code"] {
|
||||
}
|
||||
```
|
||||
|
||||
Set a background color on all `<div>` elements that have a class attribute value containing "backing":
|
||||
|
||||
```css
|
||||
div[class*="backing"] {
|
||||
background: #ffff00;
|
||||
}
|
||||
```
|
||||
|
||||
|
Reference in New Issue
Block a user