2.7 KiB
2.7 KiB
id | title | challengeType | videoUrl |
---|---|---|---|
587d78b0367417b2b2512b08 | Create a Media Query | 0 | https://scrimba.com/p/pzrPu4/cqwKrtm |
Description
@media (max-width: 100px) { /* CSS Rules */ }
and the following media query returns the content when the device's height is more than or equal to 350px:
@media (min-height: 350px) { /* CSS Rules */ }
Remember, the CSS inside the media query is applied only if the media type matches that of the device being used.
Instructions
p
tag has a font-size
of 10px when the device's height is less than or equal to 800px.
Tests
tests:
- text: Your <code>p</code> element should have the <code>font-size</code> of 10px when the device <code>height</code> is less than or equal to 800px.
testString: 'assert($(''p'').css(''font-size'') == ''10px'', ''Your <code>p</code> element should have the <code>font-size</code> of 10px when the device <code>height</code> is less than or equal to 800px.'');'
- text: Declare a <code>@media</code> query for devices with a <code>height</code> less than or equal to 800px.
testString: 'assert(code.match(/@media\s*?\(\s*?max-height\s*?:\s*?800px\s*?\)/g), ''Declare a <code>@media</code> query for devices with a <code>height</code> less than or equal to 800px.'');'
Challenge Seed
<style>
p {
font-size: 20px;
}
/* Add media query below */
</style>
<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
// solution required