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: Write a declaration in a new rule that will reset the background color back to white, without using an actual color value?
10
+
11
+
One possible solution is as follows:
12
+
13
+
```
14
+
#outer #inner a {
15
+
background-color: initial;
16
+
}
17
+
```
18
+
19
+
There are two things you need to do in this task. First, you need to write a selector for the `a` element which is more specific than the selector used to turn the background blue. I have achieved this by using the `id` selector which has very high specificity.
20
+
21
+
Then you need to remember that there are special keyword values for all properties. In this case I am using `inherit` to set the background back to be the same as its parent element.
Task: Change the size of the second box (by adding CSS to the .alternate class) to make it match the first box in width and height.
62
+
63
+
```
64
+
.alternate {
65
+
box-sizing: border-box;
66
+
width: 390px;
67
+
height: 240px;
68
+
}
69
+
```
70
+
71
+
You will need to increase the height and width of the second block, to add the size of the padding and border.
72
+
39
73
## Backgrounds and Borders
40
74
41
75
To style the box we add a border, using the `border` property. Round the corners with `border-radius` and then add the background image setting the size to `contain`.
0 commit comments