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
"text": "Your <code>style</code> declaration should end with a <code>;</code> .",
27
-
"testString": "assert(code.match(/<h2\\s+style\\s*=\\s*(\\'|\")\\s*color\\s*:\\s*(?:rgb\\(\\s*255\\s*,\\s*0\\s*,\\s*0\\s*\\)|rgb\\(\\s*100%\\s*,\\s*0%\\s*,\\s*0%\\s*\\)|red|#ff0000|#f00|hsl\\(\\s*0\\s*,\\s*100%\\s*,\\s*50%\\s*\\))\\s*\\;(\\'|\")>\\s*CatPhotoApp\\s*<\\/h2>/),' Your <code>style</code> declaration should end with a <code>;</code> .');"
"With CSS, there are hundreds of CSS <code>properties</code> that you can use to change the way an element looks on your page.",
79
-
"When you entered <code><h2 style=\"color: red\">CatPhotoApp</h2></code>, you were styling that individual <code>h2</code> element with <code>inline CSS</code>, which stands for <code>Cascading Style Sheets</code>.",
80
-
"That's one way to specify the style of an element, but there's a better way to apply <code>CSS</code>.",
81
-
"At the top of your code, create a <code>style</code> block like this:",
"Inside that style block, you can create a <code>CSS selector</code> for all <code>h2</code> elements. For example, if you wanted all <code>h2</code> elements to be red, you would add a style rule that looks like this:",
"Note that it's important to have both opening and closing curly braces (<code>{</code> and <code>}</code>) around each element's style rule(s). You also need to make sure that your element's style definition is between the opening and closing style tags. Finally, be sure to add a semicolon to the end of each of your element's style rules.",
"Delete your <code>h2</code> element's style attribute, and instead create a CSS <code>style</code> block. Add the necessary CSS to turn all <code>h2</code> elements blue."
"text": "Ensure that your stylesheet <code>h2</code> declaration is valid with a semicolon and closing brace.",
104
-
"testString": "assert(code.match(/h2\\s*\\{\\s*color\\s*:.*;\\s*\\}/g), 'Ensure that your stylesheet <code>h2</code> declaration is valid with a semicolon and closing brace.');"
"text": "Make sure all your <code>style</code> elements are valid and have a closing tag.",
108
-
"testString": "assert(code.match(/<\\/style>/g) && code.match(/<\\/style>/g).length === (code.match(/<style((\\s)*((type|media|scoped|title|disabled)=\"[^\"]*\")?(\\s)*)*>/g) || []).length, 'Make sure all your <code>style</code> elements are valid and have a closing tag.');"
"Note that in your CSS <code>style</code> element, class names start with a period. In your HTML elements' class attribute, the class name does not include the period.",
"Inside your <code>style</code> element, change the <code>h2</code> selector to <code>.red-text</code> and update the color's value from <code>blue</code> to <code>red</code>.",
168
-
"Give your <code>h2</code> element the <code>class</code> attribute with a value of <code>'red-text'</code>."
"text": "Your <code>h2</code> element should have the class <code>red-text</code>.",
177
-
"testString": "assert($(\"h2\").hasClass(\"red-text\"), 'Your <code>h2</code> element should have the class <code>red-text</code>.');"
172
+
"text": "你的<code>h2</code>元素应含有<code>red-text</code> class 选择器。",
173
+
"testString": "assert($(\"h2\").hasClass(\"red-text\"), '你的<code>h2</code>元素应含有<code>red-text</code> class 选择器。');"
178
174
},
179
175
{
180
-
"text": "Your stylesheet should declare a <code>red-text</code> class and have its color set to red.",
181
-
"testString": "assert(code.match(/\\.red-text\\s*\\{\\s*color\\s*:\\s*red;\\s*\\}/g), 'Your stylesheet should declare a <code>red-text</code> class and have its color set to red.');"
176
+
"text": "你的<code>style</code>样式声明区域里应该包含一个<code>red-text</code> class 选择器,并且它的颜色应为红色。",
177
+
"testString": "assert(code.match(/\\.red-text\\s*\\{\\s*color\\s*:\\s*red;\\s*\\}/g), '你的<code>style</code>样式声明区域里应该包含一个<code>red-text</code> class 选择器,并且它的颜色应为红色。');"
182
178
},
183
179
{
184
-
"text": "Do not use inline style declarations like <code>style=\"color: red\"</code> in your <code>h2</code> element.",
185
-
"testString": "assert($(\"h2\").attr(\"style\") === undefined, 'Do not use inline style declarations like <code>style=\"color: red\"</code> in your <code>h2</code> element.');"
"title": "Style Multiple Elements with a CSS Class",
241
237
"description": [
242
-
"Classes allow you to use the same CSS styles on multiple HTML elements. You can see this by applying your <code>red-text</code> class to the first <code>p</code> element."
238
+
"通过 CSS class 选择器,多个 HTML 元素可以使用相同的 CSS 样式规则。你可以将<code>red-text</code> class 选择器应用在第一个<code>p</code>元素上。"
243
239
],
244
240
"tests": [
245
241
{
246
-
"text": "Your <code>h2</code> element should be red.",
247
-
"testString": "assert($(\"h2\").css(\"color\") === \"rgb(255, 0, 0)\", 'Your <code>h2</code> element should be red.');"
"text": "Your second and third <code>p</code> elements should not be red.",
259
-
"testString": "assert(!($(\"p:eq(1)\").css(\"color\") === \"rgb(255, 0, 0)\") && !($(\"p:eq(2)\").css(\"color\") === \"rgb(255, 0, 0)\"), 'Your second and third <code>p</code> elements should not be red.');"
"Inside the same <code><style></code> tag that contains your <code>red-text</code> class, create an entry for <code>p</code> elements and set the <code>font-size</code> to 16 pixels (<code>16px</code>)."
319
+
"在包含<code>red-text</code> class 的<code><style></code>声明区域的里,创建一个<code>p</code>元素样式规则,并设置<code>font-size</code>为 16 像素(<code>16px</code>)。"
324
320
],
325
321
"tests": [
326
322
{
327
-
"text": "Between the <code>style</code> tags, give the <code>p</code> elements <code>font-size</code> of <code>16px</code>. Browser and Text zoom should be at 100%.",
328
-
"testString": "assert(code.match(/p\\s*{\\s*font-size\\s*:\\s*16\\s*px\\s*;\\s*}/i), 'Between the <code>style</code> tags, give the <code>p</code> elements <code>font-size</code> of <code>16px</code>. Browser and Text zoom should be at 100%.');"
"text": "Your <code>p</code> elements should use the font <code>monospace</code>.",
394
-
"testString": "assert($(\"p\").not(\".red-text\").css(\"font-family\").match(/monospace/i), 'Your <code>p</code> elements should use the font <code>monospace</code>.');"
0 commit comments