--- id: bad87fee1348bd9aedf08807 title: Import a Google Font challengeType: 0 videoUrl: '' localeTitle: '' --- ## Description
بالإضافة إلى تحديد الخطوط العامة الموجودة في معظم أنظمة التشغيل ، يمكننا أيضًا تحديد خطوط ويب مخصصة غير قياسية للاستخدام على موقعنا على الويب. هناك مصادر متنوعة لخطوط الويب على الإنترنت ، ولكن في هذا المثال سنركز على مكتبة Google Fonts. Google Fonts هي مكتبة مجانية لخطوط الويب يمكنك استخدامها في CSS بالرجوع إلى عنوان URL الخاص بالخط. لذلك ، دعنا نمضي قدمًا ونستورد ونطبق خط Google (لاحظ أنه إذا تم حظر Google في بلدك ، فستحتاج إلى تخطي هذا التحدي). لاستيراد أحد خطوط Google ، يمكنك نسخ عنوان URL (الخطوط) من مكتبة Google Fonts ، ثم لصقه في HTML. لهذا التحدي ، سنقوم باستيراد خط Lobster . لإجراء ذلك ، انسخ مقتطف الشفرة التالي وألصقه في الجزء العلوي من محرر الشفرة (قبل عنصر style الافتتاحي): <link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css"> يمكنك الآن استخدام خط Lobster في CSS باستخدام Lobster باعتباره FAMILY_NAME كما في المثال التالي:
font-family: FAMILY_NAME, GENERIC_NAME; . GENERIC_NAME اختياري ، وهو خط احتياطي في حالة عدم توفر الخط المحدد الآخر. يتم تغطيتها في التحدي التالي. أسماء العائلة حساسة لحالة الأحرف وتحتاج إلى لفها بين علامتي تنصيص إذا كان هناك فراغ في الاسم. على سبيل المثال ، تحتاج إلى علامات اقتباس لاستخدام الخط "Open Sans" ، ولكن لا تستخدم خط Lobster .
## Instructions undefined ## Tests
```yml tests: - text: '' testString: 'assert(new RegExp("googleapis", "gi").test(code), "Import the Lobster font.");' - text: '' testString: 'assert($("h2").css("font-family").match(/lobster/i), "Your h2 element should use the font Lobster.");' - text: استخدم محدد CSS h2 لتغيير الخط. testString: 'assert(/\s*h2\s*\{\s*font-family\:\s*(\"|")?Lobster(\"|")?\s*;\s*\}/gi.test(code), "Use an h2 CSS selector to change the font.");' - text: يجب أن يستمر عنصر p استخدام monospace للخط. testString: 'assert($("p").css("font-family").match(/monospace/i), "Your p element should still use the font monospace.");' ```
## Challenge Seed
```html

CatPhotoApp

Click here to view more cat photos.

A cute orange cat lying on its back.

Things cats love:

  • cat nip
  • laser pointers
  • lasagna

Top 3 things cats hate:

  1. flea treatment
  2. thunder
  3. other cats


```
## Solution
```js // solution required ```