aboutsummaryrefslogtreecommitdiff
path: root/files/pt-pt/web/css/width/index.html
blob: f865e76bedf7008764afbd00d99c8209f95d91ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
---
title: width
slug: Web/CSS/width
tags:
  - Referencia_CSS
translation_of: Web/CSS/width
---
<p>{{ CSSRef() }}</p>

<h3 id="Resumo" name="Resumo">Resumo</h3>

<p>A propriedade <code>width</code> é usada para configurar a largura dada a um elemento.</p>

<ul>
 <li>Valor inicial: auto</li>
 <li>Aplica-se a: o nível do bloco e elementos substituídos</li>
 <li>Herdado: não</li>
 <li>Percentagens: refere-se à largura do bloco que o contém</li>
 <li>Mídia: <a href="pt/CSS/Media/Visual">Visual</a></li>
</ul>

<h3 id="Sintaxe" name="Sintaxe">Sintaxe</h3>

<pre class="eval"> width: [ &lt;length&gt; || &lt;percentage&gt; ] auto | inherit
</pre>

<h3 id="Valores" name="Valores">Valores</h3>

<ul>
 <li><strong>length</strong> : pode ser em px, cm, in, em</li>
 <li><strong>percentage</strong> : % especificado como uma porcentagem da largura do elemento pai</li>
 <li><strong>auto</strong> : o navegador calculará e selecionará uma largura para o elemento especificado.</li>
</ul>

<h3 id="Exemplos" name="Exemplos">Exemplos</h3>

<p><a href="/samples/cssref/width.html">View Live Examples</a></p>

<pre>table{width: 100%;}

img{width: 200px;}

form{width: auto;}
</pre>

<p><span class="comment">== Notas ==</span></p>

<h3 id="Especifica.C3.A7.C3.B5es" name="Especifica.C3.A7.C3.B5es">Especificações</h3>

<ul>
 <li><a class="external" href="http://www.w3.org/TR/CSS1#width">CSS 1</a></li>
 <li><a class="external" href="http://www.w3.org/TR/CSS21/visudet.html#the-width-property">CSS 2.1</a></li>
</ul>

<h3 id="Compatibilidade_com_navegadores" name="Compatibilidade_com_navegadores">Compatibilidade com navegadores</h3>

<table class="standard-table">
 <tbody>
  <tr>
   <th>Navegador</th>
   <th>Versão mais antiga</th>
  </tr>
  <tr>
   <td>Internet Explorer</td>
   <td>4</td>
  </tr>
  <tr>
   <td>Netscape</td>
   <td>4</td>
  </tr>
  <tr>
   <td>Opera</td>
   <td>3.5</td>
  </tr>
 </tbody>
</table>

<h3 id="Veja_tamb.C3.A9m" name="Veja_tamb.C3.A9m">Veja também</h3>

<p><a href="pt/CSS/box_model">box model</a>, {{ Cssxref("height") }}, {{ Cssxref("-moz-box-sizing") }}</p>

<p><span class="comment">Categorias</span></p>

<p><span class="comment">Interwiki Language Links</span></p>

<p>{{ languages( { "en": "en/CSS/width", "fr": "fr/CSS/width" } ) }}</p>