Propiedad CSS font-weight
Ejemplo
Establezca un peso de fuente diferente para tres párrafos:
p.normal {
font-weight: normal;
}
p.thick {
font-weight: bold;
}
p.thicker {
font-weight: 900;
}
Definición y uso
La font-weight
propiedad establece qué tan gruesos o delgados deben mostrarse los caracteres en el texto.
Valor por defecto: | normal |
---|---|
Heredado: | sí |
Animable: | si. Leer sobre animable |
Versión: | CSS1 |
Sintaxis de JavaScript: | objeto .style.fontWeight="negrita" |
Compatibilidad con navegador
Los números de la tabla especifican la primera versión del navegador que es totalmente compatible con la propiedad.
Property | |||||
---|---|---|---|---|---|
font-weight | 2.0 | 4.0 | 1.0 | 1.3 | 3.5 |
Sintaxis CSS
font-weight: normal|bold|bolder|lighter|number|initial|inherit;
Valores de propiedad
Value | Description | Play it |
---|---|---|
normal | Defines normal characters. This is default | |
bold | Defines thick characters | |
bolder | Defines thicker characters | |
lighter | Defines lighter characters | |
100 200 300 400 500 600 700 800 900 |
Defines from thin to thick characters. 400 is the same as normal, and 700 is the same as bold | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
páginas relacionadas
Tutorial de CSS: fuente CSS
Referencia CSS: propiedad de fuente
Referencia HTML DOM: propiedad fontWeight