Foros del Web » Creando para Internet » CSS »

porque no me funciona el margin top

Estas en el tema de porque no me funciona el margin top en el foro de CSS en Foros del Web. amigos porq el margin top no separa la caja interior de la exterios Código HTML: <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content= "text/html; charset=utf-8" /> ...
  #1 (permalink)  
Antiguo 07/12/2011, 23:03
 
Fecha de Ingreso: diciembre-2010
Mensajes: 83
Antigüedad: 13 años, 3 meses
Puntos: 0
porque no me funciona el margin top

amigos porq el margin top no separa la caja interior de la exterios

Código HTML:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Musica Actual</title>
<style type="text/css">
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  font-size: 100%;
  background: transparent;
}
section ,header ,article ,footer{margin:0; padding:0; display:block;}
#cp{width:200px; height:300px; background:#00FF00;}
article{width:190px; height:200px; background:#FF0000; margin-top:5px;}
</style>
<body>
<header>

</header>
<section id="cp">
 <article></article>
 </section>
</body>
</html> 
  #2 (permalink)  
Antiguo 08/12/2011, 00:28
Avatar de Franz1628  
Fecha de Ingreso: marzo-2007
Ubicación: Lima - Perú
Mensajes: 145
Antigüedad: 17 años, 1 mes
Puntos: 26
Respuesta: porque no me funciona el margin top

mejor agregale un padding-top al #cp
__________________
En mi Blog puedes ver articulos javascript y más...
@Franz1628
  #3 (permalink)  
Antiguo 08/12/2011, 03:22
Avatar de agus__1987  
Fecha de Ingreso: septiembre-2011
Mensajes: 14
Antigüedad: 12 años, 7 meses
Puntos: 2
Respuesta: porque no me funciona el margin top

Tambien puedes darle: {float:left} a <article>
  #4 (permalink)  
Antiguo 08/12/2011, 06:48
Colaborador
 
Fecha de Ingreso: junio-2007
Mensajes: 5.798
Antigüedad: 16 años, 10 meses
Puntos: 539
Respuesta: porque no me funciona el margin top

En escasos días se ha planteado su mismo problema varias veces.
Muy breve.
Palabra clave: "border-collapse"
Sugerencia: Uso de "overflow" en la caja padre. En su etiquetado "#cp"

Etiquetas: html, margin, top, fondo
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 07:38.