La propiedad font-style
se usa principalmente para especificar texto en cursiva.
Esta propiedad tiene tres valores:
normal: el texto se muestra normalmente
cursiva: el texto se muestra en cursiva
oblicuo: el texto está "inclinado" (oblicuo es muy similar a cursiva, pero menos compatible)
p.normal {
font-style: normal;
}
p.italic {
font-style: italic;
}
p.oblique {
font-style: oblique;
}
Pruébelo usted mismo →
<!DOCTYPE html>
<html>
<head>
<style>
p.normal {
font-style: normal;
}
p.italic {
font-style: italic;
}
p.oblique {
font-style: oblique;
}
</style>
</head>
<body>
<h1>The font-style property</h1>
<p class="normal">This is a paragraph in normal style.</p>
<p class="italic">This is a paragraph in italic style.</p>
<p class="oblique">This is a paragraph in oblique style.</p>
</body>
</html>
La propiedad font-weight
especifica el peso de una fuente:
p.normal {
font-weight: normal;
}
p.thick {
font-weight: bold;
}
Pruébelo usted mismo →
<!DOCTYPE html>
<html>
<head>
<style>
p.normal {
font-weight: normal;
}
p.light {
font-weight: lighter;
}
p.thick {
font-weight: bold;
}
p.thicker {
font-weight: 900;
}
</style>
</head>
<body>
<h1>The font-weight property</h1>
<p class="normal">This is a paragraph.</p>
<p class="light">This is a paragraph.</p>
<p class="thick">This is a paragraph.</p>
<p class="thicker">This is a paragraph.</p>
</body>
</html>
La propiedad font-variant
especifica si un texto debe o no mostrarse en letra de versales.
En una fuente de versales, todas las letras minúsculas se convierten a mayúsculas. letras. Sin embargo, las letras mayúsculas convertidas aparecen en un tamaño de fuente más pequeño. que las letras mayúsculas originales del texto.
p.normal {
font-variant: normal;
}
p.small {
font-variant: small-caps;
}
Pruébelo usted mismo →
<!DOCTYPE html>
<html>
<head>
<style>
p.normal {
font-variant: normal;
}
p.small {
font-variant: small-caps;
}
</style>
</head>
<body>
<h1>The font-variant property</h1>
<p class="normal">My name is Hege Refsnes.</p>
<p class="small">My name is Hege Refsnes.</p>
</body>
</html>