diff options
Diffstat (limited to 'files/es/web/api/htmlelement/offsetparent/index.html')
| -rw-r--r-- | files/es/web/api/htmlelement/offsetparent/index.html | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/files/es/web/api/htmlelement/offsetparent/index.html b/files/es/web/api/htmlelement/offsetparent/index.html new file mode 100644 index 0000000000..4fb14be33d --- /dev/null +++ b/files/es/web/api/htmlelement/offsetparent/index.html @@ -0,0 +1,52 @@ +--- +title: HTMLElement.offsetParent +slug: Web/API/HTMLElement/offsetParent +tags: + - API + - CSSOM View + - Propiedad + - Reference + - Referencia +translation_of: Web/API/HTMLElement/offsetParent +--- +<div> +<div>{{ APIRef("HTML DOM") }}</div> +</div> + +<p>La propiedad de solo lectura <strong><code>HTMLElement.offsetParent</code></strong> retorna una referencia al objeto, el cual es el elemento contenedor posicionado más cercano (más cercano en la jerarquía contenedora). Si el elemento es no-posicionado, <code>td</code>, <code>th</code>, <code>table</code> o el <code>body</code> más cercano es retornado.</p> + +<p><code>offsetParent</code> retorna <code>null</code> cuando el elemento <code>style.display</code> tiene asignado <code>none</code>. <code>offsetParent</code> es útil porque {{domxref("HTMLElement.offsetTop","offsetTop")}} y {{domxref("HTMLElement.offsetLeft","offsetLeft")}} son relativos a su borde de relleno.</p> + +<h2 id="Syntax" name="Syntax">Sintaxis</h2> + +<pre class="syntaxbox"><var>parentObj</var> = element.offsetParent; +</pre> + +<ul> + <li><var>parentObj</var> es una referencia de objeto al elemento en el cual el elemento actual es offset.</li> +</ul> + +<h2 id="Specification" name="Specification">Especificación</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">Especificación</th> + <th scope="col">Estatus</th> + <th scope="col">Comentario</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName('CSSOM View', '#dom-htmlelement-offsetparent', 'offsetParent')}}</td> + <td>{{Spec2('CSSOM View')}}</td> + <td> </td> + </tr> + </tbody> +</table> + +<h2 id="Compatibility" name="Compatibility">Compatibilidad de Browser</h2> + +<div class="hidden">La tabla de compatibilidad de esta página es generada desde datos estructurados. Si gusta contribuir a los datos, por favor revise <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> y envíenos un pull request.</div> + +<p>{{Compat("api.HTMLElement.offsetParent")}}</p> |
