top
or bottom
, and left
or right
tell the browser how far to offset an item relative to where it would sit in the normal flow of the document. You're offsetting an element away from a given spot, which moves the element away from the referenced side (effectively, the opposite direction). As you saw in the last challenge, using the top offset moved the h2
downwards. Likewise, using a left offset moves an item to the right.
h2
15 pixels to the right and 10 pixels up.
h2
10px upwards. In other words, move it 10px away from the bottom
of where it normally sits.
testString: assert($('h2').css('bottom') == '10px', 'Your code should use a CSS offset to relatively position the h2
10px upwards. In other words, move it 10px away from the bottom
of where it normally sits.');
- text: Your code should use a CSS offset to relatively position the h2
15px towards the right. In other words, move it 15px away from the left
of where it normally sits.
testString: assert($('h2').css('left') == '15px', 'Your code should use a CSS offset to relatively position the h2
15px towards the right. In other words, move it 15px away from the left
of where it normally sits.');
```
I still think the h2 is where it normally sits.
```