freeCodeCamp/guide/arabic/css/properties/background-position-property/index.md

39 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
title: Background Position Property
localeTitle: موقع الخلفية الملكية
---
## موقع الخلفية الملكية
تحدد خاصية الخلفية الموقع من حيث يجب أن تبدأ صورة الخلفية. بمعنى آخر ، ستأخذ هذه الخاصية قيمة س وقيمة ص وستبدأ الصورة من النقطة `(x, y)` .
**مثال:**
`/* setting background-image of HTML doc */
body {
background-image: url('https://i.imgur.com/6Z2VStD.png');
background-repeat: no-repeat;
background-position: right top;
}
`
بشكل افتراضي ، يتم تعيين الخاصية background-position إلى `0% 0%` .
**قيم العقارات:**
`background-position: x-value y-value` حيث ،
_x-value_ : `left | center | right | x% | x px` و
القيمة_ : `top | center | bottom | y% | y px` .
قيم الخاصية الأخرى المسموح بها هي قيم `initial` `inherit` .
`initial` : تعيين هذه الخاصية إلى قيمتها الافتراضية.
`inherit` : `inherit` القيمة من العنصر الرئيسي.
**ملاحظة:** عند إعطاء قيمة واحدة فقط لخاصية الخلفية ، يتم تعيين القيمة الأخرى إلى `center` .
**موارد آخرى:**
مستندات MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/background-position