From 074785cea106179cb3305637055ab0a009ca74f2 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:42:52 -0500 Subject: initial commit --- .../web/api/htmlelement/offsetwidth/index.html | 65 ++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 files/pt-br/web/api/htmlelement/offsetwidth/index.html (limited to 'files/pt-br/web/api/htmlelement/offsetwidth') diff --git a/files/pt-br/web/api/htmlelement/offsetwidth/index.html b/files/pt-br/web/api/htmlelement/offsetwidth/index.html new file mode 100644 index 0000000000..63d60ee4c1 --- /dev/null +++ b/files/pt-br/web/api/htmlelement/offsetwidth/index.html @@ -0,0 +1,65 @@ +--- +title: HTMLElement.offsetWidth +slug: Web/API/HTMLElement/offsetWidth +translation_of: Web/API/HTMLElement/offsetWidth +--- +
{{ APIRef("HTML DOM") }}
+ +

A propriedade HTMLElement.offsetWidth é de somente leitura e retorna a largura de um elemento no layout.  Normalmente, o offsetWidth é uma medida que inclui as bordas do elemento, seu padding horizontal e o vertical scrollbar (se presente e renderizado) e também a largura CSS do elemento.

+ +

Sintaxe 

+ +
var offsetWidth =element.offsetWidth;
+
+ +

offsetWidth é uma propriedade somente leitura.

+ +
+

Esta propriedade irá arredondar o valor para um inteiro. se você precisa um valor fracionado, use {{ domxref("element.getBoundingClientRect()") }}.

+
+ +

 

+ +

Exemplo

+ +

 

+ +

             Image:Dimensions-offset.png

+ + +

Especificação

+ + + + + + + + + + + + + + + + +
EspecificaçãoSituaçãoComentário
{{SpecName('CSSOM View', '#dom-htmlelement-offsetwidth', 'offsetWidth')}}{{Spec2('CSSOM View')}} 
+ +

Notas

+ +

offsetWidth é uma propriedade do modelo de objeto DHTML que foi primeiro apresentado pelo MSIE. Algumas vezes referenciado como as dimensões físicas/gráficas do elemento, ou a largura do border-box.

+ +

Compatibilidade de Browsers

+ +

{{Compat("api.HTMLElement.offsetWidth")}}

+ +

Veja também

+ + + +
 
-- cgit v1.2.3-54-g00ecf