Ver Mensaje Individual
  #4 (permalink)  
Antiguo 18/05/2013, 09:13
alzacon
 
Fecha de Ingreso: mayo-2013
Mensajes: 207
Antigüedad: 11 años
Puntos: 31
Respuesta: Html5: Header - footer

Cita:
Iniciado por pitufoweb Ver Mensaje
Los elementos(de bloque) automáticamente se ajustan al ancho de la pantalla...no tienes que hacer nada mas.
No es así, se ajustan automáticamente al ancho del elemento padre.

Código HTML:
<!DOCTYPE html>
<html>
<head>
<style> 
div
{
  display: block;
  position: relative;
  height:200px;
  background: orange;
}

.a{
  width: 50%;
  height:400px;
  background: greenyellow ;
  border: solid 1px black;
}
</style>
</head>
<body>

<div></div>
<br>
<div class="a">
  <div></div>
</div>

</body>
</html>