2017年1月12日 星期四

css background position


example:

body { 
    background-image: url('smiley.gif');
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: 30% 20%; 
}


Property Values

ValueDescriptionPlay it
left top
left center
left bottom
right top
right center
right bottom
center top
center center
center bottom
If you only specify one keyword, the other value will be "center"Play it »
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%. . Default value is: 0% 0%Play it »
xpos yposThe 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 positionsPlay it »
initialSets this property to its default value. Read about initialPlay it »
inheritInherits this property from its parent element. Read about inherit

沒有留言:

張貼留言