--- title: font-weight slug: Web/CSS/font-weight tags: - CSS - Propiedad de CSS - Referencia - Tipos de letra de CSS translation_of: Web/CSS/font-weight --- <div>{{CSSRef}}</div> <h2 id="Resumen">Resumen</h2> <p>La propiedad <strong><code>font-weight</code></strong> de <a href="/en-US/docs/CSS" title="CSS">CSS</a> especifica el peso o grueso de la letra. Algunos tipos de letra sólo están disponibles en <code>normal</code> y <code>bold</code>.</p> <p>{{cssinfo}}</p> <h2 id="Sintaxis">Sintaxis</h2> <pre class="brush:css notranslate">font-weight: normal; font-weight: bold; /* Relativo al padre */ font-weight: lighter; font-weight: bolder; font-weight: 100; font-weight: 200; font-weight: 300; font-weight: 400; font-weight: 500; font-weight: 600; font-weight: 700; font-weight: 800; font-weight: 900; /* Valores globales */ font-weight: inherit; font-weight: initial; font-weight: unset; </pre> <h3 id="Valores">Valores</h3> <dl> <dt>normal </dt> <dd>Peso/grueso normal de la fuente. Igual que 400.</dd> <dt>bold </dt> <dd>Grueso ancho (<em>negrita</em>). Igual que 700.</dd> <dt>lighter </dt> <dd>Corresponde a un tipo de fuente menos grueso que el tipo del elemento padre (dentro de los valores disponibles).</dd> <dt>bolder </dt> <dd>Corresponde a un tipo de fuente más grueso que el tipo del elemento padre (dentro de los valores disponibles).</dd> <dt>100, 200, 300, 400, 500, 600, 700, 800, 900 </dt> <dd>Pesos numéricos para los tipos de fuente que nos permiten más flexibilidad que <code>normal - bold</code>. Si el peso especificado no existe en el tipo de fuente escogido, un valor entre 600 y 900 se presentará con el valor más próximo disponible para dar una letra más oscura. De igual forma, un valor entre 100 y 500 se presentará con el valor más próximo disponible para dar una letra más clara. Esto significa que para los tipos de letra que sólo dispongan de normal y bold, cualquier valor entre 100 y 500 será normal y entre 600 y 900, será bold.</dd> </dl> <h2 id="Examples" name="Examples">Ejemplos</h2> <h3 id="HTML">HTML</h3> <pre class="brush: html notranslate"><p> Alice was beginning to get very tired of sitting by her sister on the bank, and of having nothing to do: once or twice she had peeped into the book her sister was reading, but it had no pictures or conversations in it, 'and what is the use of a book,' thought Alice 'without pictures or conversations?' </p> <div>I'm heavy<br/> <span>I'm lighter</span> </div> </pre> <h3 id="CSS">CSS</h3> <pre class="brush:css notranslate">/* Poner texto del párrafo en negrita. */ p { font-weight: bold; } /* Poner texto del div a dos pasos más oscuro que lo normal pero menos que una negrita estándar. */ div { font-weight: 600; } /* Sets text enclosed within span tag to be one step lighter than the parent. */ span { font-weight: lighter; }</pre> <h3 id="Resultado">Resultado</h3> <p>{{EmbedLiveSample("Examples","400","300")}}</p> <h2 id="Especificaciones">Especificaciones</h2> <table class="standard-table"> <thead> <tr> <th scope="col">Especificación</th> <th scope="col">Estado</th> <th scope="col">Comentario</th> </tr> </thead> <tbody> <tr> <td>{{SpecName('CSS3 Fonts', '#font-weight-prop', 'font-weight')}}</td> <td>{{Spec2('CSS3 Fonts')}}</td> <td>Sin cambio</td> </tr> <tr> <td>{{SpecName('CSS3 Transitions', '#animatable-css', 'font-weight')}}</td> <td>{{Spec2('CSS3 Transitions')}}</td> <td>Define <code>font-weight</code> como animable.</td> </tr> <tr> <td>{{SpecName('CSS2.1', 'fonts.html#propdef-font-weight', 'font-weight')}}</td> <td>{{Spec2('CSS2.1')}}</td> <td>Sin cambio</td> </tr> <tr> <td>{{SpecName('CSS1', '#font-weight', 'font-weight')}}</td> <td>{{Spec2('CSS1')}}</td> <td>Definición inicial</td> </tr> </tbody> </table> <h2 id="Compatibilidad_entre_navegadores">Compatibilidad entre navegadores</h2> {{Compat("css.properties.font-weight")}}