Listo (Ctrl + Enter para ejecutar) Bootcamp Fullstack »
index.html
Tab = 4 espacios
1
<!DOCTYPE html>
<html lang="es">
<head>
  <meta charset="UTF-8">
  <title>Márgenes y Bordes en CSS</title>
  <style>
    body {
      font-family: Arial, Helvetica, sans-serif;
      background-color: #f1f5f9;
      margin: 0;
      padding: 30px;
    }

    /* Contenedor principal centrado automáticamente */
    .tarjeta-usuario {
      max-width: 420px;
      margin: 0 auto; /* Centrado horizontal automático */
      background-color: #ffffff;
      padding: 24px;
      border: 1px solid #e2e8f0;
      border-radius: 16px;
      text-align: center;
      box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.07);
    }

    /* Avatar circular con border-radius al 50% */
    .avatar-circular {
      width: 80px;
      height: 80px;
      border-radius: 50%;
      background: linear-gradient(135deg, #0284c7, #2563eb);
      color: white;
      font-size: 2rem;
      font-weight: bold;
      line-height: 80px;
      margin: 0 auto 16px auto;
      border: 4px solid #e0f2fe;
    }

    .nombre {
      color: #0f172a;
      margin: 0 0 6px 0;
      font-size: 1.3rem;
    }

    .rol {
      color: #64748b;
      margin: 0 0 20px 0;
      font-size: 0.9rem;
    }

    /* Botón con outline accesible al hacer foco */
    .btn-perfil {
      background-color: #0f172a;
      color: white;
      border: none;
      padding: 10px 24px;
      border-radius: 8px;
      font-weight: 600;
      cursor: pointer;
    }

    .btn-perfil:focus {
      outline: 3px solid #38bdf8;
      outline-offset: 2px;
    }
  </style>
</head>
<body>

  <div class="tarjeta-usuario">
    <div class="avatar-circular">J</div>
    <h3 class="nombre">Juan Martínez</h3>
    <p class="rol">Desarrollador Frontend · Kilopolis</p>
    <button class="btn-perfil" onclick="alert('Perfil verificado con padding y bordes')">
      Ver Perfil Completo
    </button>
  </div>

</body>
</html>
Haz clic para editar este código
Vista Previa
Motor de Render CSS3