diff --git a/curriculum/challenges/english/01-responsive-web-design/responsive-web-design-principles/create-a-media-query.english.md b/curriculum/challenges/english/01-responsive-web-design/responsive-web-design-principles/create-a-media-query.english.md
index 02547f9751..77e968d477 100644
--- a/curriculum/challenges/english/01-responsive-web-design/responsive-web-design-principles/create-a-media-query.english.md
+++ b/curriculum/challenges/english/01-responsive-web-design/responsive-web-design-principles/create-a-media-query.english.md
@@ -26,13 +26,13 @@ Add a media query, so that the p
tag has a font-size
o
```yml
tests:
- - text: Your p
element should have the font-size
of 10px when the device height
is less than or equal to 800px.
- testString: assert($('p').css('font-size') == '10px', 'Your p
element should have the font-size
of 10px when the device height
is less than or equal to 800px.');
- text: Declare a @media
query for devices with a height
less than or equal to 800px.
- testString: assert(code.match(/@media\s*?\(\s*?max-height\s*?:\s*?800px\s*?\)/g), 'Declare a @media
query for devices with a height
less than or equal to 800px.');
-
+ testString: assert($("style").text().replace(/\s/g ,'').match(/@media\(max-height:800px\)/g));
+ - text: Your p
element should have a font-size
of 10px when the device height
is less than or equal to 800px.
+ testString: assert($("style").text().replace(/\s/g ,'').match(/@media\(max-height:800px\){p{font-size:10px;?}}/g));
+ - text: Your p
element should have an initial font-size
of 20px when the device height
is more than 800px.
+ testString: assert($("style").text().replace(/\s/g ,'').replace(/@media.*}/g, '').match(/p{font-size:20px;?}/g));
```
-
## Challenge Seed
@@ -47,7 +47,6 @@ tests:
}
/* Add media query below */
-
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.
@@ -68,7 +67,7 @@ tests: font-size: 20px; } - @media (max-height: 800px) { + @media (max-height: 800px) { p { font-size: 10px; }