freeCodeCamp/guide/chinese/css/css-position/index.md

23 lines
672 B
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: CSS Position
localeTitle: CSS职位
---
## CSS职位
position属性指定用于元素的定位方法的类型。它有5个关键字值
```css
.static { position: static; } // default value
.relative { position: relative; }
.sticky { position: sticky; }
.fixed { position: fixed; }
.absolute { position: absolute; }
```
### 更多信息:
MDN文档 [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/position)
浏览器支持: [caniuse](http://caniuse.com/#search=position)
YouTube [Part1](https://www.youtube.com/watch?v=kejG8G0dr5U) | [第2部分](https://www.youtube.com/watch?v=Rf6zAP4YnZA)