This repository has been archived by the owner on Sep 25, 2019. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 125
/
basic-css.json
6104 lines (6104 loc) · 333 KB
/
basic-css.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"name": "Basic CSS",
"order": 1,
"time": "5 hours",
"helpRoom": "Help",
"challenges": [
{
"id": "bad87fee1348bd9aedf08803",
"title": "Change the Color of Text",
"description": [
"Now let's change the color of some of our text.",
"We can do this by changing the <code>style</code> of your <code>h2</code> element.",
"The property that is responsible for the color of an element's text is the <code>color</code> style property.",
"Here's how you would set your <code>h2</code> element's text color to blue:",
"<code><h2 style=\"color: blue;\">CatPhotoApp</h2></code>",
"Note that it is a good practice to end inline <code>style</code> declarations with a <code>;</code> .",
"<hr>",
"Change your <code>h2</code> element's style so that its text color is red."
],
"tests": [
{
"text": "Your <code>h2</code> element should be red.",
"testString": "assert($(\"h2\").css(\"color\") === \"rgb(255, 0, 0)\", 'Your <code>h2</code> element should be red.');"
},
{
"text": "Your <code>style</code> declaration should end with a <code>;</code> .",
"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> .');"
}
],
"challengeType": 0,
"translations": {
"de": {
"description": [
"Lass uns jetzt die Farbe von unserem Text ändern.",
"Wir können das bewerkstelligen, indem wir den <code>style</code> des <code>h2</code> Elements ändern.",
"Der Style, der zuständig für die Textfarbe eines Elements ist, ist der \"color\" Style.",
"So könntest du die Textfarbe des <code>h2</code> Elements in Blau ändern:",
"<code><h2 style=\"color: blue\">CatPhotoApp</h2></code>",
"<hr>",
"Ändere den Style des <code>h2</code> Elements, damit die Textfarbe rot (\"red\") ist."
]
},
"fr": {
"title": "Changer la couleur du texte",
"description": [
"Changeons maintenant la couleur de quelques-uns de nos textes.",
"Nous pouvons le faire en changeant le <code>style</code> de votre élément <code>h2</code>.",
"Le style responsable de la couleur de texte d'un élément est \"color\".",
"Voici comment changer en bleu la couleur du texte de votre élément <code>h2</code> :",
"<code><h2 style=\"color: blue\">CatPhotoApp</h2></code>",
"<hr>",
"Changez le style de votre élément <code>h2</code> pour que son texte soit de couleur rouge."
]
},
"pt-br": {
"title": "Substitua a Cor do Texto",
"description": [
"Agora vamos substituir a cor de parte do nosso texto.",
"Podemos fazer isso mudando o <code>style</code> do elemento <code>h2</code>.",
"A propriedade de estilo responsável pela cor do texto se chama \"color\".",
"Você pode mudar a cor do texto de seu elemento <code>h2</code> para azul assim:",
"<code><h2 style=\"color: blue\">CatPhotoApp</h2></code>",
"<hr>",
"Mude o estilo do elemento <code>h2</code> para que seu texto fique com a cor vermelha."
]
},
"ru": {
"title": "Измените цвет текста",
"description": [
"Теперь давайте изменим цвет части нашего текста.",
"Мы можем сделать это изменив <code>style</code> нашего элемента <code>h2</code>.",
"Параметр стиля, отвечающий за цвет текста внутри элемента - \"color\".",
"Вот как вы могли бы установить цвет текста вашего элемента <code>h2</code> синим:",
"<code><h2 style=\"color: blue\">CatPhotoApp</h2></code>",
"<hr>",
"Измените стиль вашего элемента <code>h2</code> таким образом, чтобы текст элемента стал красным."
]
}
},
"videoUrl": "https://scrimba.com/c/cRkVmSm",
"files": {
"indexhtml": {
"key": "indexhtml",
"ext": "html",
"name": "index",
"contents": [
"<h2>CatPhotoApp</h2>",
"<main>",
" <p>Click here to view more <a href=\"#\">cat photos</a>.</p>",
" ",
" <a href=\"#\"><img src=\"https://bit.ly/fcc-relaxing-cat\" alt=\"A cute orange cat lying on its back.\"></a>",
" ",
" <div>",
" <p>Things cats love:</p>",
" <ul>",
" <li>cat nip</li>",
" <li>laser pointers</li>",
" <li>lasagna</li>",
" </ul>",
" <p>Top 3 things cats hate:</p>",
" <ol>",
" <li>flea treatment</li>",
" <li>thunder</li>",
" <li>other cats</li>",
" </ol>",
" </div>",
" ",
" <form action=\"/submit-cat-photo\">",
" <label><input type=\"radio\" name=\"indoor-outdoor\" checked> Indoor</label>",
" <label><input type=\"radio\" name=\"indoor-outdoor\"> Outdoor</label><br>",
" <label><input type=\"checkbox\" name=\"personality\" checked> Loving</label>",
" <label><input type=\"checkbox\" name=\"personality\"> Lazy</label>",
" <label><input type=\"checkbox\" name=\"personality\"> Energetic</label><br>",
" <input type=\"text\" placeholder=\"cat photo URL\" required>",
" <button type=\"submit\">Submit</button>",
" </form>",
"</main>"
],
"head": [],
"tail": []
}
}
},
{
"id": "bad87fee1348bd9aedf08805",
"title": "Use CSS Selectors to Style Elements",
"description": [
"With CSS, there are hundreds of CSS <code>properties</code> that you can use to change the way an element looks on your page.",
"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>.",
"That's one way to specify the style of an element, but there's a better way to apply <code>CSS</code>.",
"At the top of your code, create a <code>style</code> block like this:",
"<blockquote><style><br></style></blockquote>",
"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:",
"<blockquote><style><br> h2 {color: red;}<br></style></blockquote>",
"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.",
"<hr>",
"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."
],
"tests": [
{
"text": "Remove the style attribute from your <code>h2</code> element.",
"testString": "assert(!$(\"h2\").attr(\"style\"), 'Remove the style attribute from your <code>h2</code> element.');"
},
{
"text": "Create a <code>style</code> element.",
"testString": "assert($(\"style\") && $(\"style\").length > 1, 'Create a <code>style</code> element.');"
},
{
"text": "Your <code>h2</code> element should be blue.",
"testString": "assert($(\"h2\").css(\"color\") === \"rgb(0, 0, 255)\", 'Your <code>h2</code> element should be blue.');"
},
{
"text": "Ensure that your stylesheet <code>h2</code> declaration is valid with a semicolon and closing brace.",
"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.",
"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.');"
}
],
"challengeType": 0,
"translations": {
"de": {
"description": [
"CSS liefert dir hunderte Attribute oder <code>properties</code> um HTML Elemente auf deiner Seite zu gestalten.",
"Mit <code><h2 style=\"color: red\">CatPhotoApp</h2></code> hast du dem einzelnen <code>h2</code> Element einen sogenannten <code>inline style</code> gegeben.",
"Das ist ein Weg, um Elemente zu gestalten. Es ist aber besser <code>CSS</code>, was für <code>Cascading Style Sheets</code> steht, zu benutzen.",
"Erstelle über deinem Code ein <code>style</code> Element:",
"<blockquote><style><br></style></blockquote>",
"Innerhalb des Style Elements kannst du einen <code>CSS selector</code> für alle <code>h2</code> Elemente erstellen. Wenn du zum Beispiel alle <code>h2</code> Elemente rot färben willst, schreibst du:",
"<blockquote><style><br> h2 {color: red;}<br></style></blockquote>",
"Beachte, dass du öffnende und schließende geschwungene Klammern (<code>{</code> und <code>}</code>) um jeden Style setzen musst. Außerdem musst du sichergehen, dass deine Styles innerhalb dieser Klammern stehen. Zum Schluss benötigst du am Ende jedes Styles ein Semikolon.",
"<hr>",
"Lösche das Style Attribute deines <code>h2</code> Elements und erstelle stattdessen ein CSS <code>style</code> Element. Füge das notwendige CSS hinzu, um alle <code>h2</code> Elemente Blau zu färben."
]
},
"fr": {
"title": "Utiliser les sélecteurs CSS pour styliser des éléments",
"description": [
"Avec CSS, il y a des centaines de <code>propriétés</code> que vous pouvez utliser pour changer l'apparence d'un élément dans votre page.",
"Quand vous avez entré <code><h2 style=\"color: red\">CatPhotoApp</h2></code>, vous donniez à cet élément <code>h2</code> uniquement, un style <code>inline</code>.",
"C'est une des façons d'ajouter un style à un élément, mais une meilleure approche est d'utiliser <code>CSS</code>, acronyme de <code>Cascading Style Sheets</code>.",
"Au sommet de votre code, créez un élément <code>style</code> comme ceci :",
"<blockquote><style><br></style></blockquote>",
"À l'intérieur de cet élément style, vous pouvez créer des <code>sélecteurs CSS</code> pour tous les éléments <code>h2</code>. Par exemple, si vous voulez que tous les éléments <code>h2</code> soient en rouge, votre élément style ressemblerait à ceci :",
"<blockquote><style><br> h2 {color: red;}<br></style></blockquote>",
"Prenez note qu'il est important d'avoir les accolades ouvrantes et fermantes (<code>{</code> and <code>}</code>) autour de chaque élément de style. Vous devez aussi vous assurer que vos styles se retrouvent entre une balise style ouvrante et fermante. Finalement, assurez-vous d'ajouter un point-virgule â la fin de chacun des styles d'éléments.",
"<hr>",
"Supprimez les attributs de styles de votre élément <code>h2</code> et créez plutôt un élément de <code>style</code> CSS. Ajoutez le CSS nécessaire pour rendre tous vos éléments <code>h2</code> de couleur bleu."
]
},
"pt-br": {
"title": "Use Seletores CSS para Estilizar Elementos",
"description": [
"Com o CSS, existem centenas de <code>propriedades</code> que você pode utilizar para modificar a forma de como um elemento pode ser visto em uma página da internet.",
"Quando você usou o <code><h2 style=\"color: red\">CatPhotoApp<h2></code>, você deu ao elemento <code>h2</code> um <code>estilo inline</code>.",
"Essa é uma forma de adicionar estilos a um elemento, mas o jeito recomendado para isso é utilizar <code>Folhas de Estilo em Cascata (Cascading Style Sheets, CSS)</code>.",
"Acima de seu código, crie um elemento <code>style</code> como esse: <code><style></style></code>",
"Dentro do elemento style, é possível criar um <code>seletor CSS</code> para todos os elementos <code>h2</code>. Por exemplo, se você quiser que todos os elementos <code>h2</code> tenham a cor vermelha, seu elemento style será assim:",
"<code><style></code>",
" <code>h2 {color: red;}</code>",
"<code></style></code>",
"Observe que é importante utilizar as chaves de abertura e de fechamento (<code>{</code> e <code>}</code>) ao redor do estilo de cada elemento. Também é necessário que o estilo de seu elemento esteja entre as tags de abertura e fechamento. Por fim, não se esqueça de adicionar o ponto-e-vírgula no final de cada um dos estilos de seu elemento.",
"<hr>",
"Apague o atributo <code>style</code> de seu elemento <code>h2</code> e então crie um elemento <code>style</code> CSS. Adicione o CSS necessário para fazer com que todos os elementos <code>h2</code> tenham a cor azul."
]
},
"ru": {
"title": "Используйте CSS-селекторы для стилизации элементов",
"description": [
"В CSS существуют сотни CSS-<code>свойств</code>, которые вы можете использовать для изменения внешнего вида элементов вашей страницы.",
"Когда вы вводите <code><h2 style=\"color: red\">CatPhotoApp</h2></code>, вы присваиваете определённому <code>h2</code> элементу <code>встроенный стиль</code>.",
"Это один из способов добавления стиля к элементу, но лучший способ - использование <code>CSS</code>, который является сокращением от <code>Cascading Style Sheets (Каскадные таблицы стилей)</code>.",
"Вверху вашего кода создайте элемент <code>style</code> следующим образом:",
"<blockquote><style><br></style></blockquote>",
"Внутри этого элемента <code>style</code> вы можете создать <code>CSS-селектор</code> для всех элементов <code>h2</code> в документе. Например, если бы вы хотели, чтобы все элементы <code>h2</code> были красными, ваш элемент <code>style</code> выглядел бы следующим образом:",
"<blockquote><style><br> h2 {color: red;}<br></style></blockquote>",
"Обратите внимание, что важно наличие открывающих и закрывающих фигурных скобок (<code>{</code> и <code>}</code>) вокруг стиля каждого элемента. Также вам необходимо убедиться в том, что стиль элемента присвоен внутри элемента <code>style</code>. В завершении, убедитесь, что строка объявления каждого элемента стиля должна заканчиваться точкой с запятой.",
"<hr>",
"Удалите атрибут стиль вашего элемента <code>h2</code> и взамен создайте CSS-элемент <code>style</code>. Добавьте необходимый CSS, чтобы все элементы <code>h2</code> стали синими."
]
}
},
"videoUrl": "https://scrimba.com/c/cJKMBT2",
"files": {
"indexhtml": {
"key": "indexhtml",
"ext": "html",
"name": "index",
"contents": [
"<h2 style=\"color: red\">CatPhotoApp</h2>",
"<main>",
" <p>Click here to view more <a href=\"#\">cat photos</a>.</p>",
" ",
" <a href=\"#\"><img src=\"https://bit.ly/fcc-relaxing-cat\" alt=\"A cute orange cat lying on its back.\"></a>",
" ",
" <div>",
" <p>Things cats love:</p>",
" <ul>",
" <li>cat nip</li>",
" <li>laser pointers</li>",
" <li>lasagna</li>",
" </ul>",
" <p>Top 3 things cats hate:</p>",
" <ol>",
" <li>flea treatment</li>",
" <li>thunder</li>",
" <li>other cats</li>",
" </ol>",
" </div>",
" ",
" <form action=\"/submit-cat-photo\">",
" <label><input type=\"radio\" name=\"indoor-outdoor\" checked> Indoor</label>",
" <label><input type=\"radio\" name=\"indoor-outdoor\"> Outdoor</label><br>",
" <label><input type=\"checkbox\" name=\"personality\" checked> Loving</label>",
" <label><input type=\"checkbox\" name=\"personality\"> Lazy</label>",
" <label><input type=\"checkbox\" name=\"personality\"> Energetic</label><br>",
" <input type=\"text\" placeholder=\"cat photo URL\" required>",
" <button type=\"submit\">Submit</button>",
" </form>",
"</main>"
],
"head": [],
"tail": []
}
}
},
{
"id": "bad87fee1348bd9aecf08806",
"title": "Use a CSS Class to Style an Element",
"description": [
"Classes are reusable styles that can be added to HTML elements.",
"Here's an example CSS class declaration:",
"<blockquote><style><br> .blue-text {<br> color: blue;<br> }<br></style></blockquote>",
"You can see that we've created a CSS class called <code>blue-text</code> within the <code><style></code> tag.",
"You can apply a class to an HTML element like this:",
"<code><h2 class=\"blue-text\">CatPhotoApp</h2></code>",
"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.",
"<hr>",
"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>.",
"Give your <code>h2</code> element the <code>class</code> attribute with a value of <code>'red-text'</code>."
],
"tests": [
{
"text": "Your <code>h2</code> element should be red.",
"testString": "assert($(\"h2\").css(\"color\") === \"rgb(255, 0, 0)\", 'Your <code>h2</code> element should be red.');"
},
{
"text": "Your <code>h2</code> element should have the class <code>red-text</code>.",
"testString": "assert($(\"h2\").hasClass(\"red-text\"), 'Your <code>h2</code> element should have the class <code>red-text</code>.');"
},
{
"text": "Your stylesheet should declare a <code>red-text</code> class and have its color set to red.",
"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.');"
},
{
"text": "Do not use inline style declarations like <code>style=\"color: red\"</code> in your <code>h2</code> element.",
"testString": "assert($(\"h2\").attr(\"style\") === undefined, 'Do not use inline style declarations like <code>style=\"color: red\"</code> in your <code>h2</code> element.');"
}
],
"challengeType": 0,
"translations": {
"de": {
"description": [
"Klassen sind wiederverwendbare Styles, die HTML Elementen zugewiesen werden können.",
"So sieht eine CSS Klasse aus:",
"<blockquote><style><br> .blue-text {<br> color: blue;<br> }<br></style></blockquote>",
"Du siehst, dass wir die CSS Klasse <code>blue-text</code> innerhalb von <code><style></code> geschrieben haben.",
"Du kannst eine Klasse folgendermaßen einem HTML Element beifügen:",
"<code><h2 class=\"blue-text\">CatPhotoApp</h2></code>",
"Beachte, dass Klassen in deinem CSS <code>style</code> Element mit einem Punkt beginnen sollten. In deinen Klassen-Deklarationen von HTML Elementen sollten diese nicht mit einem Punkt beginnen.",
"<hr>",
"Ändere deinen <code>h2</code> Selektor innerhalb deines <code>style</code> Elements zu <code>.red-text</code> und ändere den Farbwert von <code>blue</code> zu <code>red</code>.",
"Gib deinem <code>h2</code> Element das <code>class</code> Attribut mit dem Wert <code>'red-text'</code>."
]
},
"fr": {
"title": "Utiliser les classes CSS pour styler un élément",
"description": [
"Les classes sont des styles réutilisables qui peuvent être ajoutées à des éléments HTML.",
"Voici un exemple de déclaration de classe CSS :",
"<blockquote><style><br> .blue-text {<br> color: blue;<br> }<br></style></blockquote>",
"Remarquez que nous avons créer une classe CSS nommée <code>blue-text</code> à l'intérieur de notre balise <code><style></code>.",
"Vous pouvez appliquer une classe à un élément HTML comme ceci :",
"<code><h2 class=\"blue-text\">CatPhotoApp</h2></code>",
"Prenez note que que dans votre élément CSS <code>style</code>, les classes doivent débuter par un point. Dans les déclarations de classes à l'intérieur des éléments HTML, on doit omettre le point du début.",
"<hr>",
"À l'intérieur de votre élément <code>style</code>, changez le sélecteur du <code>h2</code> pour <code>.red-text</code> et changez la couleur, passant de <code>blue</code> à <code>red</code>.",
"Donnez à votre élément <code>h2</code> l'attribut de classe la valeur de <code>red-text</code>."
]
},
"pt-br": {
"title": "Use Classes CSS para Estilizar Elementos",
"description": [
"As classes são estilos reutilizáveis que podem ser adicionadas a elementos HTML.",
"Aqui está um exemplo de como declarar uma classe com CSS:",
"<code><style></code>",
"<code> .blue-text {</code>",
"<code> color: blue;</code>",
"<code> }</code>",
"<code></style></code>",
"Veja que criamos uma classe CSS chamada \"blue-text\" no interior da tag <code><style></code>.",
"Você pode aplicar uma classe a um elemento HTML assim:",
"<code><h2 class=\"blue-text\">CatPhotoApp</h2></code>",
"Note que em seu elemento <code>style</code> CSS, as classes devem começar com um ponto. Já nos elementos HTML, as declarações de classes não devem começar com o ponto.",
"<hr>",
"Ao invés de criar um novo elemento <code>style</code>, tente eliminar a declaração de estilo de <code>h2</code> dos elementos de estilo existentes, e troque ela pela declaração de classe <code>.red-text</code>.",
"Crie uma classe CSS chamada <code>red-text</code> e então a aplique em seu elemento <code>h2</code>."
]
},
"ru": {
"title": "Используйте CSS-класс для стилизации элемента",
"description": [
"Классы являются повторно применяемыми стилями, которые могут быть добавлены к HTML-элементам.",
"Вот пример объявления CSS-класса:",
"<blockquote><style><br> .blue-text {<br> color: blue;<br> }<br></style></blockquote>",
"Вы можете увидеть, что мы создали CSS-класс названный <code>blue-text</code> внутри элемента <code><style></code>.",
"Вы можете применить класс к HTML-элементу следующим образом:",
"<code><h2 class=\"blue-text\">CatPhotoApp</h2></code>",
"Обратите внимание, что в вашем CSS-элементе <code>style</code> названию классов следует начинаться с точки. При присваивании классов HTML-элементам названия классов не должны начинаться с точки.",
"<hr>",
"Внутри вашего элемента <code>style</code>, замените селектор <code>h2</code> на <code>.red-text</code> и измените значение цвета с <code>blue</code> на <code>red</code>.",
"Присвойте вашему элементу <code>h2</code> атрибут <code>class</code> со значением <code>'red-text'</code>."
]
}
},
"videoUrl": "https://scrimba.com/c/c2MvDtV",
"files": {
"indexhtml": {
"key": "indexhtml",
"ext": "html",
"name": "index",
"contents": [
"<style>",
" h2 {",
" color: blue;",
" }",
"</style>",
"",
"<h2>CatPhotoApp</h2>",
"<main>",
" <p>Click here to view more <a href=\"#\">cat photos</a>.</p>",
" ",
" <a href=\"#\"><img src=\"https://bit.ly/fcc-relaxing-cat\" alt=\"A cute orange cat lying on its back.\"></a>",
" ",
" <div>",
" <p>Things cats love:</p>",
" <ul>",
" <li>cat nip</li>",
" <li>laser pointers</li>",
" <li>lasagna</li>",
" </ul>",
" <p>Top 3 things cats hate:</p>",
" <ol>",
" <li>flea treatment</li>",
" <li>thunder</li>",
" <li>other cats</li>",
" </ol>",
" </div>",
" ",
" <form action=\"/submit-cat-photo\">",
" <label><input type=\"radio\" name=\"indoor-outdoor\" checked> Indoor</label>",
" <label><input type=\"radio\" name=\"indoor-outdoor\"> Outdoor</label><br>",
" <label><input type=\"checkbox\" name=\"personality\" checked> Loving</label>",
" <label><input type=\"checkbox\" name=\"personality\"> Lazy</label>",
" <label><input type=\"checkbox\" name=\"personality\"> Energetic</label><br>",
" <input type=\"text\" placeholder=\"cat photo URL\" required>",
" <button type=\"submit\">Submit</button>",
" </form>",
"</main>"
],
"head": [],
"tail": []
}
}
},
{
"id": "bad87fee1348bd9aefe08806",
"title": "Style Multiple Elements with a CSS Class",
"description": [
"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."
],
"tests": [
{
"text": "Your <code>h2</code> element should be red.",
"testString": "assert($(\"h2\").css(\"color\") === \"rgb(255, 0, 0)\", 'Your <code>h2</code> element should be red.');"
},
{
"text": "Your <code>h2</code> element should have the class <code>red-text</code>.",
"testString": "assert($(\"h2\").hasClass(\"red-text\"), 'Your <code>h2</code> element should have the class <code>red-text</code>.');"
},
{
"text": "Your first <code>p</code> element should be red.",
"testString": "assert($(\"p:eq(0)\").css(\"color\") === \"rgb(255, 0, 0)\", 'Your first <code>p</code> element should be red.');"
},
{
"text": "Your second and third <code>p</code> elements should not be red.",
"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.');"
},
{
"text": "Your first <code>p</code> element should have the class <code>red-text</code>.",
"testString": "assert($(\"p:eq(0)\").hasClass(\"red-text\"), 'Your first <code>p</code> element should have the class <code>red-text</code>.');"
}
],
"challengeType": 0,
"translations": {
"de": {
"description": [
"Du kannst Klassen zu HTML Elementen hinzufügen, indem du zum Beispiel <code>class=\"deine-klasse\"</code> innerhalb des öffnenden Tags schreibst.",
"Vergiss nicht dass CSS Klassenselektoren einen Punkt am Anfang brauchen:",
"<blockquote>.blue-text {<br> color: blue;<br>}</blockquote>",
"Aber Klassen-Deklarationen brauchen keinen Punkt:",
"<code><h2 class=\"blue-text\">CatPhotoApp</h2></code>",
"<hr>",
"Füge die <code>red-text</code> Klasse dem ersten <code>p</code> Element hinzu."
]
},
"fr": {
"title": "Stylez plusieurs éléments avec une classe CSS",
"description": [
"Souvenez-vous que vous pouvez ajouter des classes aux éléments HTML en utilisant <code>class=\"votre-classe-ici\"</code> à l'intérieur de la balise ouvrante correspondante.",
"Souvenez-vous que les sélecteurs CSS nécessitent un point au début comme ceci :",
"<blockquote>.blue-text {<br> color: blue;<br>}</blockquote>",
"Rappelez-vous également que les déclarations de classes n'ont pas de point, comme ceci :",
"<code><h2 class=\"blue-text\">CatPhotoApp</h2></code>",
"<hr>",
"Appliquez la classe <code>red-text</code> à votre premier élément <code>p</code>."
]
},
"pt-br": {
"title": "Estilize Múltiplos Elementos com uma Classe CSS",
"description": [
"Lembre-se que é possível adicionar classes a elementos HTML ao utilizar <code>class=\"sua-classe-aqui\"</code> dentro da tag de abertura do elemento.",
"Relembre também que os seletores de classes CSS exigem um ponto em seu início, assim:",
"<code>.blue-text {</code>",
"<code> color: blue;</code>",
"<code>}</code>",
"Contudo, não se esqueça que as declarações de classes em elementos não utilizam ponto, assim:",
"<code><h2 class=\"blue-text\">CatPhotoApp<h2></code>",
"<hr>",
"Adicione a classe <code>red-text</code> ao seu primeiro elemento <code>p</code>."
]
},
"ru": {
"title": "Стилизуйте множество элементов с помощью CSS-класса",
"description": [
"Помните, что вы можете присваивать классы HTML-элементам используя <code>class=\"ваш-класс-тут\"</code> внутри открывающей метки соответствующего элемента.",
"Помните, что селекторы CSS-классов должны начинаться с точки, например:",
"<blockquote>.blue-text {<br> color: blue;<br>}</blockquote>",
"Но также не забывайте, что присваивание классов не использует точку, например:",
"<code><h2 class=\"blue-text\">CatPhotoApp</h2></code>",
"<hr>",
"Примените класс <code>red-text</code> к вашим элемент первые <code>p</code>."
]
}
},
"videoUrl": "https://scrimba.com/c/cRkVbsQ",
"files": {
"indexhtml": {
"key": "indexhtml",
"ext": "html",
"name": "index",
"contents": [
"<style>",
" .red-text {",
" color: red;",
" }",
"</style>",
"",
"<h2 class=\"red-text\">CatPhotoApp</h2>",
"<main>",
" <p>Click here to view more <a href=\"#\">cat photos</a>.</p>",
" ",
" <a href=\"#\"><img src=\"https://bit.ly/fcc-relaxing-cat\" alt=\"A cute orange cat lying on its back.\"></a>",
" ",
" <div>",
" <p>Things cats love:</p>",
" <ul>",
" <li>cat nip</li>",
" <li>laser pointers</li>",
" <li>lasagna</li>",
" </ul>",
" <p>Top 3 things cats hate:</p>",
" <ol>",
" <li>flea treatment</li>",
" <li>thunder</li>",
" <li>other cats</li>",
" </ol>",
" </div>",
" ",
" <form action=\"/submit-cat-photo\">",
" <label><input type=\"radio\" name=\"indoor-outdoor\" checked> Indoor</label>",
" <label><input type=\"radio\" name=\"indoor-outdoor\"> Outdoor</label><br>",
" <label><input type=\"checkbox\" name=\"personality\" checked> Loving</label>",
" <label><input type=\"checkbox\" name=\"personality\"> Lazy</label>",
" <label><input type=\"checkbox\" name=\"personality\"> Energetic</label><br>",
" <input type=\"text\" placeholder=\"cat photo URL\" required>",
" <button type=\"submit\">Submit</button>",
" </form>",
"</main>"
],
"head": [],
"tail": []
}
}
},
{
"id": "bad87fee1348bd9aedf08806",
"title": "Change the Font Size of an Element",
"description": [
"Font size is controlled by the <code>font-size</code> CSS property, like this:",
"<blockquote>h1 {<br> font-size: 30px;<br>}</blockquote>",
"<hr>",
"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>)."
],
"tests": [
{
"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%.",
"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%.');"
}
],
"challengeType": 0,
"translations": {
"de": {
"description": [
"Schriftgröße wird von dem CSS Attribut <code>font-size</code> kontrolliert:",
"<blockquote>h1 {<br> font-size: 30px;<br>}</blockquote>",
"<hr>",
"Erstelle dann innerhalb deines <code><style></code> Elements, das auch deine <code>red-text</code> Klasse enthält, einen Eintrag für <code>p</code> Elemente und setzte <code>font-size</code> auf 16 Pixel (<code>16px</code>)."
]
},
"fr": {
"title": "Changez la taille de police d'un élément",
"description": [
"La taille de police est contrôlée par la propriété CSS <code>font-size</code>, comme ceci :",
"<blockquote>h1 {<br> font-size: 30px;<br>}</blockquote>",
"<hr>",
"À l'intérieur de la même balise <code><style></code> qui contiens votre classe <code>.red-text</code>, créez une nouvelle entrée pour les éléments <code>p</code> et paramétrer le <code>font-size</code> à 16 pixels (<code>16px</code>)."
]
},
"pt-br": {
"title": "Mude o Tamanho da Fonte de um Elemento",
"description": [
"O tamanho da fonte é controlado pela propriedade CSS \"font-size\", como aqui:",
"<code>h1 {</code>",
"<code> font-size: 30px;</code>",
"<code>}</code>",
"<hr>",
"Dentro da mesma tag <code><style></code> que criamos para sua classe <code>red-text</code>, modifique o <code>font-size</code> dos elementos <code>p</code> para que tenha um tamanho de 16 pixels (<code>16px</code>)."
]
},
"ru": {
"title": "Измените размер шрифта элемента",
"description": [
"Размером шрифта управляют с помощтю CSS-своайства <code>font-size</code>, например:",
"<blockquote>h1 {<br> font-size: 30px;<br>}</blockquote>",
"<hr>",
"Внутри того же элемента <code><style></code>, который содержит ваш класс <code>red-text</code>, создайте вхождение для элементов <code>p</code> и установите свойство <code>font-size</code> равным 16 пикселей (<code>16px</code>)."
]
}
},
"videoUrl": "https://scrimba.com/c/c3bvDc8",
"files": {
"indexhtml": {
"key": "indexhtml",
"ext": "html",
"name": "index",
"contents": [
"<style>",
" .red-text {",
" color: red;",
" }",
"</style>",
"",
"<h2 class=\"red-text\">CatPhotoApp</h2>",
"<main>",
" <p class=\"red-text\">Click here to view more <a href=\"#\">cat photos</a>.</p>",
" ",
" <a href=\"#\"><img src=\"https://bit.ly/fcc-relaxing-cat\" alt=\"A cute orange cat lying on its back.\"></a>",
" ",
" <div>",
" <p>Things cats love:</p>",
" <ul>",
" <li>cat nip</li>",
" <li>laser pointers</li>",
" <li>lasagna</li>",
" </ul>",
" <p>Top 3 things cats hate:</p>",
" <ol>",
" <li>flea treatment</li>",
" <li>thunder</li>",
" <li>other cats</li>",
" </ol>",
" </div>",
" ",
" <form action=\"/submit-cat-photo\">",
" <label><input type=\"radio\" name=\"indoor-outdoor\" checked> Indoor</label>",
" <label><input type=\"radio\" name=\"indoor-outdoor\"> Outdoor</label><br>",
" <label><input type=\"checkbox\" name=\"personality\" checked> Loving</label>",
" <label><input type=\"checkbox\" name=\"personality\"> Lazy</label>",
" <label><input type=\"checkbox\" name=\"personality\"> Energetic</label><br>",
" <input type=\"text\" placeholder=\"cat photo URL\" required>",
" <button type=\"submit\">Submit</button>",
" </form>",
"</main>"
],
"head": [],
"tail": []
}
}
},
{
"id": "bad87fee1348bd9aede08807",
"title": "Set the Font Family of an Element",
"description": [
"You can set which font an element should use, by using the <code>font-family</code> property.",
"For example, if you wanted to set your <code>h2</code> element's font to <code>sans-serif</code>, you would use the following CSS:",
"<blockquote>h2 {<br> font-family: sans-serif;<br>}</blockquote>",
"<hr>",
"Make all of your <code>p</code> elements use the <code>monospace</code> font."
],
"tests": [
{
"text": "Your <code>p</code> elements should use the font <code>monospace</code>.",
"testString": "assert($(\"p\").not(\".red-text\").css(\"font-family\").match(/monospace/i), 'Your <code>p</code> elements should use the font <code>monospace</code>.');"
}
],
"challengeType": 0,
"translations": {
"de": {
"description": [
"Du kannst einem Element mit <code>font-family</code> eine Schriftart zuweisen.",
"Wenn du zum Beispiel deinem <code>h2</code> Element die Schriftart <code>sans-serif</code> zuweisen willst, kannst du das mit dem folgenden CSS tun:",
"<blockquote>h2 {<br> font-family: sans-serif;<br>}</blockquote>",
"<hr>",
"Definiere für alle <code>p</code> Elemente die Schriftart <code>monospace</code>."
]
},
"fr": {
"title": "Paramétrer la famille de police d'un élément",
"description": [
"Vous pouvez paramétrer la police d'un élément en utilisant la propriété <code>font-family</code>.",
"Par exemple, si vous voulez paramétrer la police de votre élément <code>h2</code> à <code>sans-serif</code>, vous devez utiliser le CSS suivant :",
"<blockquote>h2 {<br> font-family: sans-serif;<br>}</blockquote>",
"<hr>",
"Faites en sorte que tous vos éléments <code>p</code> aient la police <code>monospace</code>."
]
},
"pt-br": {
"title": "Defina a Fonte para um Elemento",
"description": [
"Você pode estabelecer o estilo de fonte para um elemento ao utilizar a propriedade <code>font-family</code>.",
"Por exemplo, se você quiser estabelecer o estilo de fonte de seu elemento <code>h2</code> como <code>sans-serif</code>, você poderá utilizar o seguinte código em CSS:",
"<code>h2 {</code>",
"<code> font-family: sans-serif;</code>",
"<code>}</code>",
"<hr>",
"Faça com que todos os elementos <code>p</code> utilizem o estilo de fonte <code>monospace</code>."
]
},
"ru": {
"title": "Установите семейство шрифтов для элемента",
"description": [
"Вы можете установить семейство шрифтов для элемента используя свойство <code>font-family</code>.",
"Например, если бы вы хотели установить семейство шрифтов <code>sans-serif</code> для вашего элемента <code>h2</code>, вы бы использовали следующий CSS:",
"<blockquote>h2 {<br> font-family: sans-serif;<br>}</blockquote>",
"<hr>",
"Присвойте шрифт <code>monospace</code> всем вашим элементам <code>p</code>."
]
}
},
"videoUrl": "https://scrimba.com/c/c3bvpCg",
"files": {
"indexhtml": {
"key": "indexhtml",
"ext": "html",
"name": "index",
"contents": [
"<style>",
" .red-text {",
" color: red;",
" }",
"",
" p {",
" font-size: 16px;",
" }",
"</style>",
"",
"<h2 class=\"red-text\">CatPhotoApp</h2>",
"<main>",
" <p class=\"red-text\">Click here to view more <a href=\"#\">cat photos</a>.</p>",
" ",
" <a href=\"#\"><img src=\"https://bit.ly/fcc-relaxing-cat\" alt=\"A cute orange cat lying on its back.\"></a>",
" ",
" <div>",
" <p>Things cats love:</p>",
" <ul>",
" <li>cat nip</li>",
" <li>laser pointers</li>",
" <li>lasagna</li>",
" </ul>",
" <p>Top 3 things cats hate:</p>",
" <ol>",
" <li>flea treatment</li>",
" <li>thunder</li>",
" <li>other cats</li>",
" </ol>",
" </div>",
" ",
" <form action=\"/submit-cat-photo\">",
" <label><input type=\"radio\" name=\"indoor-outdoor\" checked> Indoor</label>",
" <label><input type=\"radio\" name=\"indoor-outdoor\"> Outdoor</label><br>",
" <label><input type=\"checkbox\" name=\"personality\" checked> Loving</label>",
" <label><input type=\"checkbox\" name=\"personality\"> Lazy</label>",
" <label><input type=\"checkbox\" name=\"personality\"> Energetic</label><br>",
" <input type=\"text\" placeholder=\"cat photo URL\" required>",
" <button type=\"submit\">Submit</button>",
" </form>",
"</main>"
],
"head": [],
"tail": []
}
}
},
{
"id": "bad87fee1348bd9aedf08807",
"title": "Import a Google Font",
"description": [
"In addition to specifying common fonts that are found on most operating systems, we can also specify non-standard, custom web fonts for use on our website. There are various sources for web fonts on the internet but, for this example we will focus on the Google Fonts library.",
"<a href='https://fonts.google.com/' target='_blank'>Google Fonts</a> is a free library of web fonts that you can use in your CSS by referencing the font's URL.",
"So, let's go ahead and import and apply a Google font (note that if Google is blocked in your country, you will need to skip this challenge).",
"To import a Google Font, you can copy the font(s) URL from the Google Fonts library and then paste it in your HTML. For this challenge, we'll import the <code>Lobster</code> font. To do this, copy the following code snippet and paste it into the top of your code editor(before the opening <code>style</code> element):",
"<code><link href=\"https://fonts.googleapis.com/css?family=Lobster\" rel=\"stylesheet\" type=\"text/css\"></code>",
"Now you can use the <code>Lobster</code> font in your CSS by using <code>Lobster</code> as the FAMILY_NAME as in the following example:<br><code>font-family: FAMILY_NAME, GENERIC_NAME;</code>.",
"The GENERIC_NAME is optional, and is a fallback font in case the other specified font is not available. This is covered in the next challenge.",
"Family names are case-sensitive and need to be wrapped in quotes if there is a space in the name. For example, you need quotes to use the <code>\"Open Sans\"</code> font, but not to use the <code>Lobster</code> font.",
"<hr>",
"Create a <code>font-family</code> CSS rule that uses the <code>Lobster</code> font, and ensure that it will be applied to your <code>h2</code> element."
],
"tests": [
{
"text": "Import the <code>Lobster</code> font.",
"testString": "assert(new RegExp(\"googleapis\", \"gi\").test(code), 'Import the <code>Lobster</code> font.');"
},
{
"text": "Your <code>h2</code> element should use the font <code>Lobster</code>.",
"testString": "assert($(\"h2\").css(\"font-family\").match(/lobster/i), 'Your <code>h2</code> element should use the font <code>Lobster</code>.');"
},
{
"text": "Use an <code>h2</code> CSS selector to change the font.",
"testString": "assert(/\\s*h2\\s*\\{\\s*font-family\\:\\s*(\\'|\")?Lobster(\\'|\")?\\s*;\\s*\\}/gi.test(code), 'Use an <code>h2</code> CSS selector to change the font.');"
},
{
"text": "Your <code>p</code> element should still use the font <code>monospace</code>.",
"testString": "assert($(\"p\").css(\"font-family\").match(/monospace/i), 'Your <code>p</code> element should still use the font <code>monospace</code>.');"
}
],
"challengeType": 0,
"translations": {
"de": {
"description": [
"Lass uns jetzt eine Google Font importieren und verwenden. (Beachte dass du diese Challenge überspringen musst, falls Google in deinem Land blockiert wird)",
"Zuerst musst du einen <code>call</code> (Anfrage) an Google machen um um auf <code>Lobster</code> zugreifen und in dein HMTL einbinden zu können.",
"Kopiere den folgenden Code und füge diesen in deinen Editor oben ein:",
"<code><link href=\"https://fonts.googleapis.com/css?family=Lobster\" rel=\"stylesheet\" type=\"text/css\"></code>",
"Jetzt kannst du \"Lobster\" als font-family Attribut zu deinem <code>h2</code> Element hinzufügen.",
"<hr>",
"Füge dem <code>h2</code> Element die Schriftart oder <code>font-family</code> <code>Lobster</code> hinzu."
]
},
"fr": {
"title": "Importer une police de Google",
"description": [
"Maintenant, importons et appliquons une police de Google (prenez note que si Google est interdit d'accès dans votre pays, vous devrez omettre ce défi).",
"Premièrement, vous devrez faire un <code>appel</code> vers Google pour prendre la police <code>Lobster</code> et la charger dans votre HTML.",
"Copier l'extrait de code suivant et coller le dans le haut de votre éditeur de code :",
"Maintenant vous pouvez paramétrer <code>Lobster</code> comme valeur de police de votre élément <code>h2</code>.",
"<hr>",
"Appliquer la valeur <code>Lobster</code> à la <code>font-family</code> de votre élément <code>h2</code>."
]
},
"pt-br": {
"title": "Importe uma Fonte a Partir do Google Fonts",
"description": [
"Agora, vamos importar e aplicar um estilo de fonte por meio do Google Fonts.",
"Primeiro, faça um <code>chamado</code> ao Google Fonts para poder utilizar a fonte chamada <code>Lobster</code> e carregá-la em seu HTML.",
"Para fazer isso, copie o código abaixo e insira-o na parte superior de seu editor de texto:",
"<code><link href=\"https://fonts.googleapis.com/css?family=Lobster\" rel=\"stylesheet\" type=\"text/css\"></code>",
"<hr>",
"Agora, estableça <code>Lobster</code> como o valor para font-family em seu elemento <code>h2</code>."
]
},
"ru": {
"title": "Импортируйте шрифт Google",
"description": [
"Теперь давайте импортируем и применим шрифт Google (обратите внимание, что если Google заблокирован в ваней стране, вам нужно будет пропустить это испытание).",
"Сначала вам понадобится сделать <code>запрос</code> к Google для получения шрифта <code>Lobster</code> и загрузить его в ваш HTML.",
"Скопируйте следующй кусок кода и вставьте его в самый верх вашего редактора кода:",
"<code><link href=\"https://fonts.googleapis.com/css?family=Lobster\" rel=\"stylesheet\" type=\"text/css\"></code>",
"Теперь вы можете установить шрифт <code>Lobster</code> в качестве значения семейства шрифтов для вашего <code>h2</code>.",
"<hr>",
"Примените свойство <code>font-family</code> со значением <code>Lobster</code> к вашему элементу <code>h2</code>."
]
}
},
"videoUrl": "https://scrimba.com/c/cM9MRsJ",
"files": {
"indexhtml": {
"key": "indexhtml",
"ext": "html",
"name": "index",
"contents": [
"<style>",
" .red-text {",
" color: red;",
" }",
"",
" p {",
" font-size: 16px;",
" font-family: monospace;",
" }",
"</style>",
"",
"<h2 class=\"red-text\">CatPhotoApp</h2>",
"<main>",
" <p class=\"red-text\">Click here to view more <a href=\"#\">cat photos</a>.</p>",
" ",
" <a href=\"#\"><img src=\"https://bit.ly/fcc-relaxing-cat\" alt=\"A cute orange cat lying on its back.\"></a>",
" ",
" <div>",
" <p>Things cats love:</p>",
" <ul>",
" <li>cat nip</li>",
" <li>laser pointers</li>",
" <li>lasagna</li>",
" </ul>",
" <p>Top 3 things cats hate:</p>",
" <ol>",
" <li>flea treatment</li>",
" <li>thunder</li>",
" <li>other cats</li>",
" </ol>",
" </div>",
" ",
" <form action=\"/submit-cat-photo\">",
" <label><input type=\"radio\" name=\"indoor-outdoor\" checked> Indoor</label>",
" <label><input type=\"radio\" name=\"indoor-outdoor\"> Outdoor</label><br>",
" <label><input type=\"checkbox\" name=\"personality\" checked> Loving</label>",
" <label><input type=\"checkbox\" name=\"personality\"> Lazy</label>",
" <label><input type=\"checkbox\" name=\"personality\"> Energetic</label><br>",
" <input type=\"text\" placeholder=\"cat photo URL\" required>",
" <button type=\"submit\">Submit</button>",
" </form>",
"</main>"
],
"head": [],
"tail": []
}
}
},
{
"id": "bad87fee1348bd9aedf08808",
"title": "Specify How Fonts Should Degrade",
"description": [
"There are several default fonts that are available in all browsers. These generic font families include <code>monospace</code>, <code>serif</code> and <code>sans-serif</code>",
"When one font isn't available, you can tell the browser to \"degrade\" to another font.",
"For example, if you wanted an element to use the <code>Helvetica</code> font, but degrade to the <code>sans-serif</code> font when <code>Helvetica</code> wasn't available, you will specify it as follows:",
"<blockquote>p {<br> font-family: Helvetica, sans-serif;<br>}</blockquote>",
"Generic font family names are not case-sensitive. Also, they do not need quotes because they are CSS keywords.",
"<hr>",
"To begin with, apply the <code>monospace</code> font to the <code>h2</code> element, so that it now has two fonts - <code>Lobster</code> and <code>monospace</code>.",
"In the last challenge, you imported the <code>Lobster</code> font using the <code>link</code> tag. Now comment out that import of the <code>Lobster</code> font(using the HTML comments you learned before) from Google Fonts so that it isn't available anymore. Notice how your <code>h2</code> element degrades to the <code>monospace</code> font.",
"<strong>Note</strong><br>If you have the Lobster font installed on your computer, you won't see the degradation because your browser is able to find the font."
],
"tests": [
{
"text": "Your h2 element should use the font <code>Lobster</code>.",
"testString": "assert($(\"h2\").css(\"font-family\").match(/^\"?lobster/i), 'Your h2 element should use the font <code>Lobster</code>.');"
},
{
"text": "Your h2 element should degrade to the font <code>monospace</code> when <code>Lobster</code> is not available.",
"testString": "assert(/\\s*h2\\s*\\{\\s*font-family\\:\\s*(\\'|\")?Lobster(\\'|\")?,\\s*monospace\\s*;\\s*\\}/gi.test(code), 'Your h2 element should degrade to the font <code>monospace</code> when <code>Lobster</code> is not available.');"
},
{
"text": "Comment out your call to Google for the <code>Lobster</code> font by putting <code><!--</code> in front of it.",
"testString": "assert(new RegExp(\"<!--[^fc]\", \"gi\").test(code), 'Comment out your call to Google for the <code>Lobster</code> font by putting <code><!--</code> in front of it.');"
},
{
"text": "Be sure to close your comment by adding <code>--></code>.",
"testString": "assert(new RegExp(\"[^fc]-->\", \"gi\").test(code), 'Be sure to close your comment by adding <code>--></code>.');"
}
],
"challengeType": 0,
"translations": {
"de": {
"description": [
"Es gibt verschiedene Schriftarten, die jedem Browser standardmäßig zur Verfügung stehen. Das sind unter anderem <code>monospace</code>, <code>serif</code> und <code>sans-serif</code>.",
"Falls eine Font nicht verfügbar ist kannst du dem Browser sagen was er stattdessen verwenden soll.",
"Wenn du zum Beispiel einem Element die Schriftart <code>Helvetica</code> geben möchtest, aber gleichzeitig als Alertnative die Schrift <code>sans-serif</code> laden willst, falls <code>Helvetica</code> nicht verfügbar ist, kannst du diesen CSS Style verwenden:",
"<blockquote>p {<br> font-family: Helvetica, sans-serif;<br>}</blockquote>",
"<hr>",
"Kommentiere jetzt den Aufruf an Google Fonts aus, sodass <code>Lobster</code> nicht zur Verfügung steht. Beachte, wie nun alternativ die Schriftart <code>monospace</code> geladen wird."
]
},
"fr": {
"title": "Spécifier comment vos polices devraient dégrader",
"description": [
"Il y a plusieurs polices par défaut qui sont disponible dans tous les navigateurs Web. Ceci comprend <code>monospace</code>, <code>serif</code> et <code>sans-serif</code>.",
"Quand une police n'est pas disponible, vous pouvez demander au navigateur de \"dégrader\" vers une autre police.",
"Par exemple, si vous voulez qu'un élément utilise la police <code>Helvetica</code>, mais également dégrader vers <code>sans-serif</code> lorsque la police <code>Helvetica</code> n'est pas disponible, vous pouvez utiliser le style CSS suivant :",
"<blockquote>p {<br> font-family: Helvetica, sans-serif;<br>}</blockquote>",
"<hr>",
"Maintenant, commenter votre appel vers les polices de Google, pour que la police <code>Lobster</code> ne soit pas disponible. Regardez comment la police se dégrade vers <code>monospace</code>."
]
},
"pt-br": {
"title": "Especifique como as Fontes Devem se Degradar",
"description": [
"Existem diversas fontes que estão disponíveis por padrão nos navegadores de internet, incluindo <code>monospace</code>, <code>serif</code> e <code>sans-serif</code>.",
"No entanto, quando uma fonte não está disponível, podemos dizer ao navegador que \"degrade\" a outro tipo de fonte.",
"Por exemplo, se você deseja que um elemento use a fonte <code>Helvetica</code>, e que degrade para a fonte <code>sans-serif</code> quando a <code>Helvetica</code> não estiver disponível, você pode utilizar o seguinte CSS:",
"<code>p {</code>",
"<code> font-family: Helvetica, sans-serif;</code>",
"<code>}</code>",
"<hr>",
"Agora, comente o seu chamado para a fonte do Google, para que a fonte <code>Lobster</code> não esteja disponível. Note como a fonte degrada para <code>monospace</code>."
]
},
"ru": {
"title": "Укажите порядок деградации шрифтов",
"description": [
"Существует несколько стандартных шрифтов, которые доступны во всех браузерах. Среди них <code>monospace</code>, <code>serif</code> и <code>sans-serif</code>",
"Когда один шрифт недоступен, вы можете сообщить браузеру \"деградировать\" до другого шрифта.",
"Например, если бы вы хотели, чтобы элемент использовал шрифт <code>Helvetica</code>, но также деградировал до шрифта <code>sans-serif</code>, когда <code>Helvetica</code> недоступен, вы могли бы использовать этот CSS-стиль:",
"<blockquote>p {<br> font-family: Helvetica, sans-serif;<br>}</blockquote>",
"<hr>",
"Теперь закомментируйте ваш запрос к Google Fonts, таким образом шрифт <code>Lobster</code> становится недоступен. Обратите внимание как происходит деградация до шрифта <code>monospace</code>."
]
}
},
"videoUrl": "https://scrimba.com/c/cpVKBfQ",
"files": {
"indexhtml": {
"key": "indexhtml",
"ext": "html",
"name": "index",
"contents": [
"<link href=\"https://fonts.googleapis.com/css?family=Lobster\" rel=\"stylesheet\" type=\"text/css\">",
"<style>",
" .red-text {",
" color: red;",
" }",
"",
" h2 {",
" font-family: Lobster;",
" }",
"",
" p {",
" font-size: 16px;",