--- title: float slug: Web/CSS/float tags: - CSS - 'CSS:Dokumentacje' - Dokumentacje - Wszystkie_kategorie translation_of: Web/CSS/float ---

{{ CSSRef() }}

Podsumowanie

Własność float określa, że element powinien być wyjęty z normalnego przepływu i umieszczony przy lewej lub prawej stronie zawierającego go kontenera, zaś tekst i elementy liniowe będą zawijały się wokół niego.

Element pływający jest jedynym, gdzie wartość wyliczona float nie jest równa none.

Zauważ, że, jeśli odwołujesz się do tej wartości z JavaScript jako elementu obiektu element.style, musisz oznaczyć to cssFloat (zobacz listę na DOM:CSS). Zwróć też uwagę, że IE nazywa to styleFloat.

Składnia

float: left | right | none | inherit

Wartości

Przykłady

Zobacz przykład

<html>
 <head>
  <style type="text/css">
   b
   {
     font-size: 25px;
     float:right;
   }
  </style>
 </head>
 <body>

  <p>
    <b>HELLO!</b>
    To jest jakiś tekst. To jest jakiś tekst. To jest jakiś tekst.
    To jest jakiś tekst. To jest jakiś tekst. To jest jakiś tekst.
    To jest jakiś tekst. To jest jakiś tekst. To jest jakiś tekst.
    To jest jakiś tekst. To jest jakiś tekst. To jest jakiś tekst.
    To jest jakiś tekst. To jest jakiś tekst. To jest jakiś tekst.
    To jest jakiś tekst. To jest jakiś tekst. To jest jakiś tekst.
    To jest jakiś tekst. To jest jakiś tekst. To jest jakiś tekst.
    To jest jakiś tekst. To jest jakiś tekst. To jest jakiś tekst.
    To jest jakiś tekst. To jest jakiś tekst. To jest jakiś tekst.
    To jest jakiś tekst. To jest jakiś tekst. To jest jakiś tekst.
  </p>

</body>
</html>

Notatki

TODO: Notatka powinna wyjaśniać, jak elementy pływające są pozycjonowane. Wzmianka o block formatting context.

Specyfikacje

Zgodność z przeglądarką

Przeglądarka Najniższa wersja
Internet Explorer 4
Netscape 4
Opera 3.5

Zobacz także

{{ Cssxref("clear") }}, {{ Cssxref("display") }}, {{ Cssxref("position") }}

 

{{ languages( { "en": "en/CSS/float", "es": "es/CSS/float", "fr": "fr/CSS/float" } ) }}