` has `
` as `offsetParent` and `offse
```

-There are several occasions when `offsetParent` is `null`:
+Existem várias ocasiões em que `offsetParent` é `null`:
-1. For not shown elements (`display:none` or not in the document).
-2. For `` and ``.
-3. For elements with `position:fixed`.
+1. Para elementos não exibidos (`display:none` ou não no documento).
+2. Para `` e ``.
+3. Para elementos com `position:fixed`.
## offsetWidth/Height
-Now let's move on to the element itself.
+Agora vamos passar ao elemento em si.
-These two properties are the simplest ones. They provide the "outer" width/height of the element. Or, in other words, its full size including borders.
+Essas duas propriedades são as mais simples. Elas fornecem a largura/altura "externa" do elemento. Ou, em outras palavras, seu tamanho completo incluindo as bordas.

-For our sample element:
+Para nosso elemento de exemplo:
-- `offsetWidth = 390` -- the outer width, can be calculated as inner CSS-width (`300px`) plus paddings (`2 * 20px`) and borders (`2 * 25px`).
-- `offsetHeight = 290` -- the outer height.
+- `offsetWidth = 390` -- a largura externa, pode ser calculada como a largura CSS interna (`300px`) mais os preenchimentos (`2 * 20px`) e as bordas (`2 * 25px`).
+- `offsetHeight = 290` -- a altura externa.
-````smart header="Geometry properties are zero/null for elements that are not displayed"
-Geometry properties are calculated only for displayed elements.
+````smart header="As propriedades de geometria são zero/null para elementos que não são exibidos"
+As propriedades de geometria são calculadas apenas para elementos exibidos.
-If an element (or any of its ancestors) has `display:none` or is not in the document, then all geometry properties are zero (or `null` for `offsetParent`).
+Se um elemento (ou qualquer um de seus ancestrais) tiver `display:none` ou não estiver no documento, então todas as propriedades de geometria serão zero (ou `null` para `offsetParent`).
-For example, `offsetParent` is `null`, and `offsetWidth`, `offsetHeight` are `0` when we created an element, but haven't inserted it into the document yet, or it (or its ancestor) has `display:none`.
+Por exemplo, `offsetParent` é `null`, e `offsetWidth`, `offsetHeight` são `0` quando criamos um elemento, mas ainda não o inserimos no documento, ou ele (ou seu ancestral) tem `display:none`.
-We can use this to check if an element is hidden, like this:
+Podemos usar isso para verificar se um elemento está oculto, assim:
```js
function isHidden(elem) {
@@ -116,76 +116,76 @@ function isHidden(elem) {
}
```
-Please note that such `isHidden` returns `true` for elements that are on-screen, but have zero sizes.
+Note que esse `isHidden` retorna `true` para elementos que estão visíveis na tela, mas têm tamanhos zero.
````
## clientTop/Left
-Inside the element we have the borders.
+Dentro do elemento temos as bordas.
-To measure them, there are properties `clientTop` and `clientLeft`.
+Para medi-las, existem as propriedades `clientTop` e `clientLeft`.
-In our example:
+No nosso exemplo:
-- `clientLeft = 25` -- left border width
-- `clientTop = 25` -- top border width
+- `clientLeft = 25` -- largura da borda esquerda
+- `clientTop = 25` -- largura da borda superior

-...But to be precise -- these properties are not border width/height, but rather relative coordinates of the inner side from the outer side.
+...Mas, para ser preciso -- essas propriedades não são a largura/altura da borda, mas sim as coordenadas relativas do lado interno em relação ao lado externo.
-What's the difference?
+Qual é a diferença?
-It becomes visible when the document is right-to-left (the operating system is in Arabic or Hebrew languages). The scrollbar is then not on the right, but on the left, and then `clientLeft` also includes the scrollbar width.
+Ela se torna visível quando o documento é da direita para a esquerda (o sistema operacional está em árabe ou hebraico). A barra de rolagem fica então não à direita, mas à esquerda, e então `clientLeft` também inclui a largura da barra de rolagem.
-In that case, `clientLeft` would be not `25`, but with the scrollbar width `25 + 16 = 41`.
+Nesse caso, `clientLeft` não seria `25`, mas com a largura da barra de rolagem `25 + 16 = 41`.
-Here's the example in hebrew:
+Aqui está o exemplo em hebraico:

## clientWidth/Height
-These properties provide the size of the area inside the element borders.
+Essas propriedades fornecem o tamanho da área dentro das bordas do elemento.
-They include the content width together with paddings, but without the scrollbar:
+Elas incluem a largura do conteúdo junto com os preenchimentos, mas sem a barra de rolagem:

-On the picture above let's first consider `clientHeight`.
+Na imagem acima, vamos primeiro considerar o `clientHeight`.
-There's no horizontal scrollbar, so it's exactly the sum of what's inside the borders: CSS-height `200px` plus top and bottom paddings (`2 * 20px`) total `240px`.
+Não há barra de rolagem horizontal, então é exatamente a soma do que está dentro das bordas: a altura CSS `200px` mais os preenchimentos superior e inferior (`2 * 20px`), totalizando `240px`.
-Now `clientWidth` -- here the content width is not `300px`, but `284px`, because `16px` are occupied by the scrollbar. So the sum is `284px` plus left and right paddings, total `324px`.
+Agora `clientWidth` -- aqui a largura do conteúdo não é `300px`, mas `284px`, porque `16px` são ocupados pela barra de rolagem. Então a soma é `284px` mais os preenchimentos esquerdo e direito, totalizando `324px`.
-**If there are no paddings, then `clientWidth/Height` is exactly the content area, inside the borders and the scrollbar (if any).**
+**Se não há preenchimentos, então `clientWidth/Height` é exatamente a área de conteúdo, dentro das bordas e da barra de rolagem (se houver).**

-So when there's no padding we can use `clientWidth/clientHeight` to get the content area size.
+Então, quando não há preenchimento, podemos usar `clientWidth/clientHeight` para obter o tamanho da área de conteúdo.
## scrollWidth/Height
-These properties are like `clientWidth/clientHeight`, but they also include the scrolled out (hidden) parts:
+Essas propriedades são como `clientWidth/clientHeight`, mas também incluem as partes roladas para fora (ocultas):

-On the picture above:
+Na imagem acima:
-- `scrollHeight = 723` -- is the full inner height of the content area including the scrolled out parts.
-- `scrollWidth = 324` -- is the full inner width, here we have no horizontal scroll, so it equals `clientWidth`.
+- `scrollHeight = 723` -- é a altura interna completa da área de conteúdo, incluindo as partes roladas para fora.
+- `scrollWidth = 324` -- é a largura interna completa, aqui não temos rolagem horizontal, então é igual a `clientWidth`.
-We can use these properties to expand the element wide to its full width/height.
+Podemos usar essas propriedades para expandir o elemento até sua largura/altura total.
-Like this:
+Assim:
```js
-// expand the element to the full content height
+// expande o elemento até a altura completa do conteúdo
element.style.height = `${element.scrollHeight}px`;
```
```online
-Click the button to expand the element:
+Clique no botão para expandir o elemento:
text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text
@@ -194,47 +194,47 @@ Click the button to expand the element:
## scrollLeft/scrollTop
-Properties `scrollLeft/scrollTop` are the width/height of the hidden, scrolled out part of the element.
+As propriedades `scrollLeft/scrollTop` são a largura/altura da parte oculta e rolada para fora do elemento.
-On the picture below we can see `scrollHeight` and `scrollTop` for a block with a vertical scroll.
+Na imagem abaixo podemos ver `scrollHeight` e `scrollTop` para um bloco com rolagem vertical.

-In other words, `scrollTop` is "how much is scrolled up".
+Em outras palavras, `scrollTop` é "quanto foi rolado para cima".
-````smart header="`scrollLeft/scrollTop` can be modified"
-Most of the geometry properties here are read-only, but `scrollLeft/scrollTop` can be changed, and the browser will scroll the element.
+````smart header="`scrollLeft/scrollTop` podem ser modificados"
+A maioria das propriedades de geometria aqui são apenas leitura, mas `scrollLeft/scrollTop` podem ser alteradas, e o navegador vai rolar o elemento.
```online
-If you click the element below, the code `elem.scrollTop += 10` executes. That makes the element content scroll `10px` down.
+Se você clicar no elemento abaixo, o código `elem.scrollTop += 10` é executado. Isso faz o conteúdo do elemento rolar `10px` para baixo.
-
Click
Me
1
2
3
4
5
6
7
8
9
+
Clique
Em
Mim
1
2
3
4
5
6
7
8
9
```
-Setting `scrollTop` to `0` or a big value, such as `1e9` will make the element scroll to the very top/bottom respectively.
+Definir `scrollTop` como `0` ou um valor grande, como `1e9`, fará o elemento rolar até o topo/fundo, respectivamente.
````
-## Don't take width/height from CSS
+## Não obtenha width/height a partir do CSS
-We've just covered geometry properties of DOM elements, that can be used to get widths, heights and calculate distances.
+Acabamos de abordar as propriedades de geometria dos elementos do DOM, que podem ser usadas para obter larguras, alturas e calcular distâncias.
-But as we know from the chapter
, we can read CSS-height and width using `getComputedStyle`.
+Mas, como sabemos pelo capítulo , podemos ler a altura e a largura CSS usando `getComputedStyle`.
-So why not to read the width of an element with `getComputedStyle`, like this?
+Então por que não ler a largura de um elemento com `getComputedStyle`, assim?
```js run
let elem = document.body;
-alert( getComputedStyle(elem).width ); // show CSS width for elem
+alert( getComputedStyle(elem).width ); // mostra a largura CSS de elem
```
-Why should we use geometry properties instead? There are two reasons:
+Por que deveríamos usar as propriedades de geometria em vez disso? Há duas razões:
-1. First, CSS `width/height` depend on another property: `box-sizing` that defines "what is" CSS width and height. A change in `box-sizing` for CSS purposes may break such JavaScript.
-2. Second, CSS `width/height` may be `auto`, for instance for an inline element:
+1. Primeiro, `width/height` do CSS dependem de outra propriedade: `box-sizing`, que define "o que é" a largura e a altura CSS. Uma mudança em `box-sizing` para fins de CSS pode quebrar esse JavaScript.
+2. Segundo, `width/height` do CSS podem ser `auto`, por exemplo para um elemento inline:
```html run
- Hello!
+ Olá!
```
- From the CSS standpoint, `width:auto` is perfectly normal, but in JavaScript we need an exact size in `px` that we can use in calculations. So here CSS width is useless.
+ Do ponto de vista do CSS, `width:auto` é perfeitamente normal, mas em JavaScript precisamos de um tamanho exato em `px` que possamos usar em cálculos. Então aqui a largura CSS é inútil.
-And there's one more reason: a scrollbar. Sometimes the code that works fine without a scrollbar becomes buggy with it, because a scrollbar takes the space from the content in some browsers. So the real width available for the content is *less* than CSS width. And `clientWidth/clientHeight` take that into account.
+E há mais uma razão: a barra de rolagem. Às vezes, um código que funciona bem sem uma barra de rolagem fica com bugs quando ela aparece, porque a barra de rolagem toma espaço do conteúdo em alguns navegadores. Então a largura real disponível para o conteúdo é *menor* que a largura CSS. E `clientWidth/clientHeight` levam isso em conta.
-...But with `getComputedStyle(elem).width` the situation is different. Some browsers (e.g. Chrome) return the real inner width, minus the scrollbar, and some of them (e.g. Firefox) -- CSS width (ignore the scrollbar). Such cross-browser differences is the reason not to use `getComputedStyle`, but rather rely on geometry properties.
+...Mas com `getComputedStyle(elem).width` a situação é diferente. Alguns navegadores (por exemplo, Chrome) retornam a largura interna real, menos a barra de rolagem, e alguns deles (por exemplo, Firefox) -- a largura CSS (ignorando a barra de rolagem). Essas diferenças entre navegadores são a razão para não usar `getComputedStyle`, mas sim confiar nas propriedades de geometria.
```online
-If your browser reserves the space for a scrollbar (most browsers for Windows do), then you can test it below.
+Se seu navegador reserva o espaço para uma barra de rolagem (a maioria dos navegadores para Windows faz isso), então você pode testar abaixo.
[iframe src="cssWidthScroll" link border=1]
-The element with text has CSS `width:300px`.
+O elemento com texto tem `width:300px` no CSS.
-On a Desktop Windows OS, Firefox, Chrome, Edge all reserve the space for the scrollbar. But Firefox shows `300px`, while Chrome and Edge show less. That's because Firefox returns the CSS width and other browsers return the "real" width.
+Em um Desktop com Windows, Firefox, Chrome e Edge todos reservam o espaço para a barra de rolagem. Mas o Firefox mostra `300px`, enquanto Chrome e Edge mostram menos. Isso ocorre porque o Firefox retorna a largura CSS e os outros navegadores retornam a largura "real".
```
-Please note that the described difference is only about reading `getComputedStyle(...).width` from JavaScript, visually everything is correct.
+Note que a diferença descrita é apenas sobre ler `getComputedStyle(...).width` a partir do JavaScript, visualmente tudo está correto.
-## Summary
+## Resumo
-Elements have the following geometry properties:
+Os elementos têm as seguintes propriedades de geometria:
-- `offsetParent` -- is the nearest positioned ancestor or `td`, `th`, `table`, `body`.
-- `offsetLeft/offsetTop` -- coordinates relative to the upper-left edge of `offsetParent`.
-- `offsetWidth/offsetHeight` -- "outer" width/height of an element including borders.
-- `clientLeft/clientTop` -- the distances from the upper-left outer corner to the upper-left inner (content + padding) corner. For left-to-right OS they are always the widths of left/top borders. For right-to-left OS the vertical scrollbar is on the left so `clientLeft` includes its width too.
-- `clientWidth/clientHeight` -- the width/height of the content including paddings, but without the scrollbar.
-- `scrollWidth/scrollHeight` -- the width/height of the content, just like `clientWidth/clientHeight`, but also include scrolled-out, invisible part of the element.
-- `scrollLeft/scrollTop` -- width/height of the scrolled out upper part of the element, starting from its upper-left corner.
+- `offsetParent` -- é o ancestral posicionado mais próximo, ou `td`, `th`, `table`, `body`.
+- `offsetLeft/offsetTop` -- coordenadas relativas à borda superior-esquerda do `offsetParent`.
+- `offsetWidth/offsetHeight` -- largura/altura "externa" de um elemento, incluindo as bordas.
+- `clientLeft/clientTop` -- as distâncias do canto externo superior-esquerdo até o canto interno (conteúdo + preenchimento) superior-esquerdo. Para sistemas operacionais da esquerda para a direita, elas são sempre as larguras das bordas esquerda/superior. Para sistemas operacionais da direita para a esquerda, a barra de rolagem vertical fica à esquerda, então `clientLeft` também inclui sua largura.
+- `clientWidth/clientHeight` -- a largura/altura do conteúdo incluindo os preenchimentos, mas sem a barra de rolagem.
+- `scrollWidth/scrollHeight` -- a largura/altura do conteúdo, assim como `clientWidth/clientHeight`, mas também incluem a parte rolada para fora, invisível, do elemento.
+- `scrollLeft/scrollTop` -- largura/altura da parte superior rolada para fora do elemento, a partir do seu canto superior-esquerdo.
-All properties are read-only except `scrollLeft/scrollTop` that make the browser scroll the element if changed.
+Todas as propriedades são apenas leitura, exceto `scrollLeft/scrollTop`, que fazem o navegador rolar o elemento se forem alteradas.
diff --git a/2-ui/1-document/09-size-and-scroll/cssWidthScroll.view/index.html b/2-ui/1-document/09-size-and-scroll/cssWidthScroll.view/index.html
index 2869c7ed9..c799c3122 100755
--- a/2-ui/1-document/09-size-and-scroll/cssWidthScroll.view/index.html
+++ b/2-ui/1-document/09-size-and-scroll/cssWidthScroll.view/index.html
@@ -7,7 +7,7 @@
text text text text text text text text text text text text text text text text text text text text text text text text text text
- The element has