logo htlm 5

Ejemplo de margin con un valor en medidas y porcentaje

Código Resultado

<html>
<head>
<style type="text/css">
p.margin {margin: 2cm}
</style>
</head>

<body>
<p>Texto sin márgenes.</p>
<p class="margin">Este es un texto con 2 centímetros de margen alrededor.</p>
<p>Texto sin márgenes.</p>
</body>
</html>

<html>
<head>
<style type="text/css">
p.margin
{
margin-top:10%;
margin-left:50%
}
</style>
</head>

<body>
<p>Texto sin márgenes.</p>
<p class="margin">Este es un texto con un 10% de margen superior y un 50% de margen izquierdo.</p>
</body>
</html>