#4 考虑absolute定位

Ouvert
Créé il y a 4 ans par zachary · 2 commentaires
zachary a commenté il y a 4 ans

设立一个div作为基点,···

看懂代码

关于position: https://www.hangge.com/blog/cache/detail_1776.html

http://www.ruanyifeng.com/blog/2019/11/css-position.html

设立一个div作为基点,··· 看懂代码 关于position: https://www.hangge.com/blog/cache/detail_1776.html http://www.ruanyifeng.com/blog/2019/11/css-position.html
zachary a commenté il y a 4 ans
Propriétaire

absolute定位,基点是它的第一个非static定位的祖先元素的border左上角内顶点,最终的基点只能是html根元素。

absolute定位,基点是它的第一个非static定位的祖先元素的border左上角内顶点,最终的基点只能是html根元素。
zachary a commenté il y a 4 ans
Propriétaire

absolute定位的元素必须添加top/left/bottom/right中的任一值,一般写上

top:0;
left:0;

否则,这四个值会默认为auto,就变成了relative定位

absolute定位的元素必须添加top/left/bottom/right中的任一值,一般写上 ```css top:0; left:0; ``` 否则,这四个值会默认为auto,就变成了relative定位
Connectez-vous pour rejoindre cette conversation.
Pas d'étiquette
Aucun jalon
Pas d'assignataire
1 Participants
Chargement…
Annuler
Enregistrer
Il n'existe pas encore de contenu.