freeCodeCamp/curriculum/challenges/arabic/01-responsive-web-design/applied-visual-design/create-a-graphic-using-css....

3.7 KiB

id title challengeType videoUrl localeTitle
587d78a6367417b2b2512add Create a Graphic Using CSS 0 قم بإنشاء رسم باستخدام CSS

Description

من خلال التلاعب بمختصرات وخصائص مختلفة ، يمكنك عمل أشكال مثيرة للاهتمام. واحدة من أسهل في محاولة هو شكل هلال القمر. لهذا التحدي ، تحتاج إلى العمل مع خاصية box-shadow التي تقوم بتعيين ظل عنصر ، مع خاصية border-radius التي تتحكم في استدارة زوايا العنصر. سوف تقوم بإنشاء كائن مستدير وشفافة مع ظل هش يعوض قليلاً إلى الجانب - الظل سيكون في الواقع شكل القمر الذي تراه. لإنشاء كائن مستدير ، يجب تعيين الخاصية border-radius إلى قيمة 50٪. قد تتذكر من تحدي سابق أن خاصية box-shadow تأخذ قيمًا offset-x ، offset-y ، blur-radius ، و blur-radius spread-radius وقيمة اللون بهذا الترتيب. تعد قيم spread-radius blur-radius و blur-radius spread-radius اختيارية.

Instructions

التعامل مع عنصر مربع في المحرر لإنشاء شكل القمر. أولاً ، قم بتغيير background-color إلى شفاف ، ثم قم بتعيين الخاصية border-radius إلى 50٪ لجعل الشكل الدائري. وأخيرًا ، قم بتغيير الخاصية box-shadow لتعيين offset-x إلى 25px ، و offset-y إلى 10px ، و blur-radius إلى 0 ، spread-radius إلى 0 ، و color to blue.

Tests

tests:
  - text: يجب تعيين قيمة الخاصية <code>background-color</code> إلى <code>transparent</code> .
    testString: 'assert(code.match(/background-color:\s*?transparent;/gi), "The value of the <code>background-color</code> property should be set to <code>transparent</code>.");'
  - text: يجب تعيين قيمة خاصية <code>border-radius</code> إلى <code>50%</code> .
    testString: 'assert(code.match(/border-radius:\s*?50%;/gi), "The value of the <code>border-radius</code> property should be set to <code>50%</code>.");'
  - text: يجب تعيين قيمة الخاصية <code>box-shadow</code> إلى 25px للإزاحة <code>offset-x</code> ، و <code>offset-x</code> بكسل لـ <code>offset-x</code> <code>offset-y</code> ، و 0 لـ <code>blur-radius</code> ، و 0 لـ <code>spread-radius</code> ، وأخيراً اللون الأزرق للون.
    testString: 'assert(code.match(/box-shadow:\s*?25px\s+?10px\s+?0(px)?\s+?0(px)?\s+?blue\s*?;/gi), "The value of the <code>box-shadow</code> property should be set to 25px for <code>offset-x</code>, 10px for <code>offset-y</code>, 0 for <code>blur-radius</code>, 0 for <code>spread-radius</code>, and finally blue for the color.");'

Challenge Seed

<style>
.center
{
  position: absolute;
  margin: auto;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100px;
  height: 100px;

  background-color: blue;
  border-radius: 0px;
  box-shadow: 25px 10px 10px 10px green;
}

</style>
<div class="center"></div>

Solution

// solution required