当前位置: 首页 > 网络学院 > 网页制作基础教程 > CSS > CSS left属性
The left property specifies the left edge of an element.
left属性将指定与其最近一个具有定位设置的父对象左边相关的位置
Note: If the "position" property has a value of "static", the "left" property has no effect.
注意:如果"position"属性的值为"static",那么"left"属性就不会起效果了
Inherited: No
继承性:无
This example sets the left edge of the paragraph 20 px to the right of the left edge of the window: This example sets the left edge of the paragraph 20 px to the left of the left edge of the window: |
值 | 描述 |
---|---|
auto | Lets the browser calculate the left position 让浏览器来决定左定位 |
% | Sets the left position in % from the left edge of the window 以百分比的形式来设置左定位。 |
length | Sets the left position in px, cm, etc. from the left edge of the window. Negative values are allowed 用px,cm等一些单位来设置左定位。可以用负数。 |