* fix(curriculum): tests quotes * fix(curriculum): fill seed-teardown * fix(curriculum): fix tests and remove unneeded seed-teardown
2.3 KiB
2.3 KiB
id, title, challengeType, videoUrl
| id | title | challengeType | videoUrl |
|---|---|---|---|
| 587d78b1367417b2b2512b0c | Make Typography Responsive | 0 | https://scrimba.com/p/pzrPu4/crzN7T8 |
Description
em or px to size text, you can use viewport units for responsive typography. Viewport units, like percentages, are relative units, but they are based off different items. Viewport units are relative to the viewport dimensions (width or height) of a device, and percentages are relative to the size of the parent container element.
The four different viewport units are:
vw: 10vwwould be 10% of the viewport's width.vh: 3vhwould be 3% of the viewport's height.vmin: 70vminwould be 70% of the viewport's smaller dimension (height vs. width).vmax: 100vmaxwould be 100% of the viewport's bigger dimension (height vs. width).
Instructions
width of the h2 tag to 80% of the viewport's width and the width of the paragraph as 75% of the viewport's smaller dimension.
Tests
tests:
- text: Your <code>h2</code> tag should have a <code>width</code> of 80vw.
testString: assert(code.match(/h2\s*?{\s*?width:\s*?80vw;\s*?}/g), 'Your <code>h2</code> tag should have a <code>width</code> of 80vw.');
- text: Your <code>p</code> tag should have a <code>width</code> of 75vmin.
testString: assert(code.match(/p\s*?{\s*?width:\s*?75vmin;\s*?}/g), 'Your <code>p</code> tag should have a <code>width</code> of 75vmin.');
Challenge Seed
<style>
</style>
<h2>Importantus Ipsum</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus quis tempus massa. Aenean erat nisl, gravida vel vestibulum cursus, interdum sit amet lectus. Sed sit amet quam nibh. Suspendisse quis tincidunt nulla. In hac habitasse platea dictumst. Ut sit amet pretium nisl. Vivamus vel mi sem. Aenean sit amet consectetur sem. Suspendisse pretium, purus et gravida consequat, nunc ligula ultricies diam, at aliquet velit libero a dui.</p>
Solution
var code = "h2 {width: 80vw;} p {width: 75vmin;}"