--- title: object-position slug: Web/CSS/object-position translation_of: Web/CSS/object-position ---
La propiedad object-position determina el alineamiento del elemento dentro de la caja.
{{cssinfo}}
/* <position> valores */ object-position: 100px 50px; /* Valores globales */ object-position: inherit; object-position: initial; object-position: unset;
<position><img id="object-position-1" src="https://mdn.mozillademos.org/files/6457/mdn_logo_only_color.png" alt="MDN Logo"/> <img id="object-position-2" src="https://mdn.mozillademos.org/files/6457/mdn_logo_only_color.png" alt="MDN Logo"/>
img {
width: 150px;
height: 100px;
border: 1px solid #000;
background-color: yellow;
margin-right: 1em;
}
#object-position-1 {
object-position: 10px;
}
#object-position-2 {
object-position: 20% 10%;
}
{{ EmbedLiveSample('Example', 360, 120) }}
| Specification | Status | Comment |
|---|---|---|
| {{SpecName('CSS4 Images', '#the-object-position', 'object-position')}} | {{Spec2('CSS4 Images')}} |
Las |
| {{SpecName('CSS3 Images', '#the-object-position', 'object-position')}} | {{Spec2('CSS3 Images')}} | Definición incial |