You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Task: Target the `<a>` element with a title attribute and make the border pink (border-color: pink).
10
+
11
+
To select elements with a title attribute we can add `title` inside the square brackets, which will select the second link, which is the only one with a title attribute.
12
+
13
+
```
14
+
a[title] {
15
+
border-color: pink;
16
+
}
17
+
```
18
+
19
+
Target the `<a>` element with an href attribute which contains the word contact anywhere in its value and make the border orange (border-color: orange).
20
+
21
+
There are two things we want to match here, the href value "/contact" and also "../contact". So we need to match the string "contact" anywhere in the value using `*=`. This will select the third and fourth links.
22
+
23
+
```
24
+
a[href*="contact"] {
25
+
border-color: orange;
26
+
}
27
+
```
28
+
29
+
Target the `<a>` element with an href value starting with https and give it a green border (border-color: green).
30
+
31
+
Here we can look for an href value which starts with "https" and so use `^=`, this will only select the first link.
0 commit comments