--- title: float slug: Web/CSS/float tags: - CSS - CSS Referenz translation_of: Web/CSS/float ---

{{ CSSRef() }}

Übersicht

Die float Eigenschaft bestimmt, ob ein Element aus dem normalen Fluss herausgelöst werden soll und nachfolgende Inhalte auf der linken oder rechten Seite des gefloateten Elements platziert werden sollen.

Syntax

float:  left | right | none | inherit

Werte

none
Standardwert. Das Element wird nicht umflossen.
left
Das Element wird nach links gerückt und die Inhalte des umliegenden Elements (containing block) werden rechts vom Element angeordnet.
right
Das Element wird nach rechts gerückt und die Inhalte des umliegenden Elements (containing block) werden links vom Element angeordnet.
inherit
Der Wert des Elternelements wird geerbt.

Beispiele

Live Beispiel

<style type="text/css">
  div { border: solid red;  max-width: 70ex; }
  h4  { float: left;  margin: 0; }
</style>

<div>
  <h4>HELLO!</h4>
  This is some text. This is some text. This is some text.
  This is some text. This is some text. This is some text.
  This is some text. This is some text. This is some text.
  This is some text. This is some text. This is some text.
</div>

HELLO!

This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.

Spezifikationen

Spezifikation Status Kommentar
{{SpecName('CSS Logical Properties', '#float-clear', 'float and clear')}} {{Spec2('CSS Logical Properties')}} Adds the values inline-start and inline-end.
{{SpecName('CSS3 Box', '#float', 'float')}} {{Spec2('CSS3 Box')}} Lots of new values, not all clearly defined yet. Any differences in behavior, unrelated to new features, are expected to be unintentional; please report.
{{SpecName('CSS2.1', 'visuren.html#float-position', 'float')}} {{Spec2('CSS2.1')}} No change
{{SpecName('CSS1', '#float', 'float')}} {{Spec2('CSS1')}} Initial definition

Browser Kompatibilität

{{Compat("css.properties.float")}}

Siehe auch

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