---
id: bad87fee1348bd9aedf08746
title: Inherit Styles from the Body Element
challengeType: 0
videoUrl: ''
localeTitle: وراثة الأنماط من عنصر الجسم
---
## Description
الآن لقد ثبت أن كل صفحة HTML لديها body
عنصر، والتي لها body
عنصر يمكن أيضا أن تكون على غرار مع CSS. تذكر أن بإمكانك تصميم عنصر body
تمامًا مثل أي عنصر HTML آخر ، وسوف ترث جميع العناصر الأخرى أنماط عناصر body
.
## Instructions
أولاً ، قم بإنشاء عنصر h1
باستخدام النص Hello World
Then ، دعنا نمنح كل العناصر على صفحتك لون green
بإضافة color: green;
لإعلان أسلوب عنصر body
. أخيرًا ، امنح عنصر body
الخاص بك body
عائلة monospace
من خلال إضافة font-family: monospace;
لإعلان أسلوب عنصر body
.
## Tests
```yml
tests:
- text: قم بإنشاء عنصر h1
.
testString: 'assert(($("h1").length > 0), "Create an h1
element.");'
- text: يجب أن يحتوي عنصر h1
على نص Hello World
.
testString: 'assert(($("h1").length > 0 && $("h1").text().match(/hello world/i)), "Your h1
element should have the text Hello World
.");'
- text: تأكد من أن عنصر h1
لديه علامة إغلاق.
testString: 'assert(code.match(/<\/h1>/g) && code.match(//g).length === code.match(/h1 element has a closing tag.");'
- text: امنح body
عنصر خاصية color
green
.
testString: 'assert(($("body").css("color") === "rgb(0, 128, 0)"), "Give your body
element the color
property of green
.");'
- text: امنح body
عنصر الخاصية monospace
font-family
monospace
.
testString: 'assert(($("body").css("font-family").match(/monospace/i)), "Give your body
element the font-family
property of monospace
.");'
- text: بك h1
عنصر يجب أن يرث الخط monospace
من هاتفك body
العنصر.
testString: 'assert(($("h1").length > 0 && $("h1").css("font-family").match(/monospace/i)), "Your h1
element should inherit the font monospace
from your body
element.");'
- text: بك h1
عنصر يجب أن يرث اللون الأخضر من هاتفك body
العنصر.
testString: 'assert(($("h1").length > 0 && $("h1").css("color") === "rgb(0, 128, 0)"), "Your h1
element should inherit the color green from your body
element.");'
```
## Challenge Seed
## Solution
```js
// solution required
```