--- title: object-position slug: Web/CSS/object-position translation_of: Web/CSS/object-position ---
Die Eigenschaft object-position
bestimmt die Ausrichtung des Elements in seiner Box.
/* <position> Werte */ object-position: 100px 50px; /* Globale Werte */ object-position: inherit; object-position: initial; object-position: unset;
{{cssinfo}}
<position>
{{csssyntax}}
<img id="object-position-1" src="https://mdn.mozillademos.org/files/12668/MDN.svg" alt="MDN Logo"/> <img id="object-position-2" src="https://mdn.mozillademos.org/files/12668/MDN.svg" alt="MDN Logo"/>
img { width: 300px; height: 250px; border: 1px solid black; background-color: silver; margin-right: 1em; object-fit: none; } #object-position-1 { object-position: 10px; } #object-position-2 { object-position: 100% 10%; }
{{ EmbedLiveSample('Example', '100%','300px') }}
Specification | Status | Comment |
---|---|---|
{{SpecName('CSS4 Images', '#the-object-position', 'object-position')}} | {{Spec2('CSS4 Images')}} | The from-image and flip keywords have been added. |
{{SpecName('CSS3 Images', '#the-object-position', 'object-position')}} | {{Spec2('CSS3 Images')}} | Initial definition |
{{ CompatibilityTable }}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | 31.0 | {{ CompatGeckoDesktop("36") }} | {{CompatNo}} | 11.60{{ property_prefix("-o") }} 19.0 |
10.0 |
Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | 4.4.4 | {{ CompatGeckoDesktop("36") }} | {{CompatNo}} | 11.5{{ property_prefix("-o") }} 24 |
{{ CompatNo }} |