**background-position**
* 描述:設置或檢索對象的背景圖位置
* 版本:CSS1 | CSS3 該屬性在 CSS3 有修改
* 繼承性:無
**語法**
```
background-position:定位點;
```
定位點
* 百分比定位:第一個值是水平位置,第二個值是垂直位置。默認值:0% 0%,左上角是 0% 0%。右下角是 100% 100%。
* 關鍵詞定位:top left | top center | top right | center left | center center | center right | bottom left | bottom center | bottom right
* CSS單位定位:第一個值是水平位置,第二個值是垂直位置。左上角是 (0px 0px) 或任何其他的 CSS 單位。
**使用說明**
設置對象的背景圖位置,必須先指定 background-image 屬性。
如果只提供一個,該值將用于橫坐標,縱坐標將默認為 50% 。
如果提供兩個,第一個用于橫坐標,第二個用于縱坐標。
在 CSS3 中允許提供三個或四個值。
如果提供三或四個,在通過百分比定位或CSS單位定位偏移前面都必須跟著一個邊界關鍵字 left | right | top | bottom,偏移量相對關鍵字位置進行偏移。
**代碼示例**
將背景圖定位在右下角,距有邊框 10 像素,底邊框 20 像素。
```
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>background-position</title>
<style>
#container{
width: 400px;
height: 400px;
border: 1px solid #ff6600;
background-image: url(../img/01.jpg);
background-repeat: no-repeat;
background-position: right 10px bottom 20px;
}
</style>
</head>
<body>
<div id="container">
</div>
</body>
</html>
```

- 空白目錄
- CSS3專業名詞
- 復合屬性
- 繼承性
- CSS3背景
- background
- background-color
- background-image
- background-repeat
- background-attachment
- background-position
- background-origin
- background-clip
- background-size
- CSS邊框
- border
- border-width
- border-style
- border-color
- border-top
- border-top-width
- border-top-style
- border-top-color
- border-right
- border-right-width
- border-right-style
- border-right-color
- border-bottom
- border-bottom-width
- border-bottom-style
- border-bottom-color
- border-left
- border-left-width
- border-left-style
- border-left-color
- border-radius
- border-top-left-radius
- border-top-right-radius
- border-bottom-right-radius
- border-bottom-left-radius
- CSS顏色
- color
- opacity
- CSS字體
- font
- font-style
- font-variant
- font-weight
- font-size
- font-family
- font-stretch
- font-size-adjust
- CSS定位
- position
- z-index
- clip