יום שני, 13 באפריל 2009

7.5 background-position

background-position מגדיר לדפדפן היכן למקם את תמונת הרקע. ברירת המחדל היא כרגיל, הפינה השמאלית העליונה של האלמנט. 

תכונה זו יכולה לקבל ערך אחד או שניים. אם רק ערך אחד ניתן, הערך ישמש את שתי התכונות. אם ניתנו שני ערכים הראשון מתייחס לאופקי והשני לאנכי. לדוגמה:

Table{background-position: 20px 50px;}

במקרה זה ימקם הדפדפן את התמונה עשרים פיקסלים משמאל וחמישים מלמעלה. אפשר גם באחוזים:

Table{background-position: 33% 20%;}

אבל אפשר גם במילים. לאופקי משתמשים ב:left, right, center ולאנכי ב: top, center, bottom.

td{background-position: center middle;}

Value

Description

top left
top center
top right
center left
center center
center right
bottom left
bottom center
bottom right

If you only specify one keyword, the second value will be "center".

Default value: 0% 0%

x% y%

The first value is the horizontal position and the second value is the vertical. The top left corner is 0% 0%. The right bottom corner is 100% 100%. If you only specify one value, the other value will be 50%.

xpos ypos

The first value is the horizontal position and the second value is the vertical. The top left corner is 0 0. Units can be pixels (0px 0px) or any other CSS units. If you only specify one value, the other value will be 50%. You can mix % and positions.

 הקודם  הבא  


אין תגובות:

הוסף רשומת תגובה