aboutsummaryrefslogtreecommitdiff
path: root/files/ca/web/css/height/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/ca/web/css/height/index.html')
-rw-r--r--files/ca/web/css/height/index.html236
1 files changed, 236 insertions, 0 deletions
diff --git a/files/ca/web/css/height/index.html b/files/ca/web/css/height/index.html
new file mode 100644
index 0000000000..062d09c1fb
--- /dev/null
+++ b/files/ca/web/css/height/index.html
@@ -0,0 +1,236 @@
+---
+title: height
+slug: Web/CSS/height
+tags:
+ - CSS
+ - CSS Property
+ - Reference
+translation_of: Web/CSS/height
+---
+<div>{{CSSRef}}</div>
+
+<p>La propietat CSS <strong><code>height</code></strong> especifica l'alçada d'un element. Per defecte, la propietat defineix l'alçada de l'<a href="/en-US/docs/Web/CSS/CSS_Box_Model/Introduction_to_the_CSS_box_model#content-area">àrea de contingut</a>. Si {{cssxref("box-sizing")}} s'estableix a <code>border-box</code>, aquest determina l'alçada de l'<a href="/en-US/docs/Web/CSS/CSS_Box_Model/Introduction_to_the_CSS_box_model#border-area">àrea de vora</a>.</p>
+
+<pre class="brush:css no-line-numbers">/* Keyword value */
+height: auto;
+
+/* &lt;length&gt; values */
+height: 120px;
+height: 10em;
+
+/* &lt;percentage&gt; value */
+height: 75%;
+
+/* Global values */
+height: inherit;
+height: initial;
+height: unset;
+</pre>
+
+<p>Les propietats {{cssxref("min-height")}} i {{cssxref("max-height")}} anul·la {{Cssxref("height")}}.</p>
+
+<p>{{cssinfo}}</p>
+
+<h2 id="Sintaxi">Sintaxi</h2>
+
+<h3 id="Valors">Valors</h3>
+
+<dl>
+ <dt>{{cssxref("&lt;length&gt;")}}</dt>
+ <dd><span class="short_text" id="result_box" lang="ca"><span>Defineix l'alçada com un valor absolut</span></span>.</dd>
+ <dt>{{cssxref("&lt;percentage&gt;")}}</dt>
+ <dd><span id="result_box" lang="ca"><span>Defineix l'alçada com un percentatge de l'alçada del bloc contenidor.</span></span></dd>
+ <dt><code>border-box </code>{{experimental_inline}}</dt>
+ <dd>Si està present, s'aplica abans {{cssxref("&lt;length&gt;")}} o {{cssxref("&lt;percentage&gt;")}} a la caixa de vora de l'element.</dd>
+ <dt><code>content-box</code> {{experimental_inline}}</dt>
+ <dd>Si està present, s'aplica abans {{cssxref("&lt;length&gt;")}} o {{cssxref("&lt;percentage&gt;")}} a la caixa de contingut de l'element.</dd>
+ <dt><code>auto</code></dt>
+ <dd><span id="result_box" lang="ca"><span>El navegador calcularà i seleccionarà una alçada per a l'element especificat</span></span> .</dd>
+ <dt>fill {{experimental_inline}}</dt>
+ <dd>Utilitzeu la grandària <code>fill-available</code> en línia o la grandària <code>fill-available</code> del bloc, segons correspongui a la modalitat d'escriptura.</dd>
+ <dt><code>max-content</code> {{experimental_inline}}</dt>
+ <dd><span id="result_box" lang="ca"><span>L'alçada preferida intrínseca.</span></span></dd>
+ <dt><code>min-content</code> {{experimental_inline}}</dt>
+ <dd><span id="result_box" lang="ca"><span>L'alçada mínima intrínseca.</span></span></dd>
+ <dt><code>available</code> {{experimental_inline}}</dt>
+ <dd>L'alçada del bloc contenidor menys el marge vertical, la vora i el farciment.</dd>
+ <dt><code>fit-content</code> {{experimental_inline}}</dt>
+ <dd><span id="result_box" lang="ca"><span>El més gran de:</span></span>
+ <ul>
+ <li><span id="result_box" lang="ca"><span>l'alçada mínima intrínseca.</span></span></li>
+ <li>la menor de l'alçada intrínseca preferida i l'alçada disponible.</li>
+ </ul>
+ </dd>
+</dl>
+
+<h3 id="Sintaxi_formal">Sintaxi formal</h3>
+
+<pre class="syntaxbox">{{csssyntax}}</pre>
+
+<h2 id="Exemple">Exemple</h2>
+
+<h3 id="HTML">HTML</h3>
+
+<pre class="brush: html">&lt;div id="red"&gt;
+ &lt;span&gt;I'm 50 pixels tall.&lt;/span&gt;
+&lt;/div&gt;
+&lt;div id="green"&gt;
+ &lt;span&gt;I'm 25 pixels tall.&lt;/span&gt;
+&lt;/div&gt;
+&lt;div id="parent"&gt;
+ &lt;div id="child"&gt;
+ &lt;span&gt;I'm half the height of my parent.&lt;/span&gt;
+ &lt;/div&gt;
+&lt;/div&gt;
+</pre>
+
+<h3 id="CSS">CSS</h3>
+
+<pre class="brush: css">div {
+ width: 250px;
+ margin-bottom: 5px;
+ border: 3px solid #999999;
+}
+
+#red {
+ height: 50px;
+}
+
+#green {
+ height: 25px;
+}
+
+#parent {
+ height: 100px;
+}
+
+#child {
+ height: 50%;
+ width: 75%;
+}
+</pre>
+
+<p>{{EmbedLiveSample('Example')}}</p>
+
+<h2 id="Especificacions">Especificacions</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Especificació</th>
+ <th scope="col">Estat</th>
+ <th scope="col">Comentari</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('CSS3 Box', '#the-width-and-height-properties', 'height')}}</td>
+ <td>{{Spec2('CSS3 Box')}}</td>
+ <td><span id="result_box" lang="ca"><span>S'han afegit les paraules clau</span></span> <code>max-content</code>, <code>min-content</code>, <code>available</code>, <code>fit-content</code>, <code>border-box</code>, <code>content-box</code></td>
+ </tr>
+ <tr>
+ <td>{{SpecName('CSS3 Transitions', '#animatable-css', 'height')}}</td>
+ <td>{{Spec2('CSS3 Transitions')}}</td>
+ <td>Mostra <code>height</code> <span class="short_text" id="result_box" lang="ca"><span>com a animable</span></span>.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('CSS2.1', 'visudet.html#the-height-property', 'height')}}</td>
+ <td>{{Spec2('CSS2.1')}}</td>
+ <td>Afegeix suport per als valors {{cssxref("&lt;length&gt;")}} i especifica en quin element s'aplica.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('CSS1', '#height', 'height')}}</td>
+ <td>{{Spec2('CSS1')}}</td>
+ <td>Definició inicial</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('CSS3 Sizing', '#width-height-keywords', 'width')}}</td>
+ <td>{{Spec2('CSS3 Sizing')}}</td>
+ <td>Afegeix noves paraules clau de grandària per width i height.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Navegadors_compatibles">Navegadors compatibles</h2>
+
+<p>{{CompatibilityTable}}</p>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Descripció</th>
+ <th>Chrome</th>
+ <th>Edge</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari</th>
+ </tr>
+ <tr>
+ <td>Suport bàsic</td>
+ <td>1.0</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatGeckoDesktop("1")}}</td>
+ <td>4.0</td>
+ <td>7.0</td>
+ <td>1.0</td>
+ </tr>
+ <tr>
+ <td><code>fill</code>, <code>fit-content</code>, <code>min-content</code>, <code>max-content</code></td>
+ <td>{{CompatChrome(46.0)}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td> </td>
+ <td> </td>
+ <td> </td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Descripció</th>
+ <th>Android</th>
+ <th>Android Webview</th>
+ <th>Edge</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Phone</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ <th>Chrome for Android</th>
+ </tr>
+ <tr>
+ <td>Suport bàsic</td>
+ <td>1.0</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatGeckoMobile("1")}}</td>
+ <td>6.0</td>
+ <td>6.0</td>
+ <td>1.0</td>
+ <td>{{CompatVersionUnknown}}</td>
+ </tr>
+ <tr>
+ <td><code>fill</code>, <code>fit-content</code>, <code>min-content</code>, <code>max-content</code></td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatChrome(46.0)}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td> </td>
+ <td> </td>
+ <td> </td>
+ <td> </td>
+ <td>{{CompatChrome(46.0)}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<h2 id="Vegeu_també">Vegeu també</h2>
+
+<ul>
+ <li><a href="/en-US/docs/CSS/box_model">model de caixa</a>, {{cssxref("width")}}, {{cssxref("box-sizing")}}, {{cssxref("min-height")}}, {{cssxref("max-height")}}</li>
+</ul>