Podsumowanie
Własność left określa część pozycji elementów pozycjonowanych.
Dla elementów pozycjonowanych absolutnie (tych z wartościami position: absolute lub position: fixed) definiuje odległość między lewą krawędzią marginesu elementu a lewą krawędzią zawierającego go bloku.
| Wartość początkowa | auto |
|---|---|
| Stosowana do | positioned elements |
| Dziedziczona | no |
| Percentages | refer to the width of the containing block |
| Media | visual |
| Wartość wyliczona | if specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, auto |
| Animatable | yes, as a length, percentage or calc(); when both values are lengths, they are interpolated as lengths; when both values are percentages, they are interpolated as percentages; otherwise, both values are converted into a calc() function that is the sum of a length and a percentage (each possibly zero), and these calc() functions have each half interpolated as real numbers. |
| Canonical order | the unique non-ambiguous order defined by the formal grammar |
Składnia
left: <length> | <percentage> | auto | inherit ;
Wartości
<length>- Długość, może być ujemna, zerowa lub dodatnia.
<percentage>- Procenty szerokości zawierającego bloku.
Przykłady
div {
position: absolute;
left: 20px;
height: 200px;
border: 1px solid #000;
}
Specyfikacje
Zgodność z przeglądarką
| Przeglądarka | Najniższa wersja |
|---|---|
| Internet Explorer | ? |
| Firefox | 1 |
| Netscape | ? |
| Opera | ? |
| Safari | ? |