Foros del Web » Creando para Internet » CSS »

Problemas con Margin

Estas en el tema de Problemas con Margin en el foro de CSS en Foros del Web. Hola buenos dias. Verán tengo los siguientes scripts: Código HTML: <table border= "0" cellpadding= "0" cellspacing= "0" width= "100%" height= "100%" > <tr height= "130" ...
  #1 (permalink)  
Antiguo 26/11/2006, 12:58
jpeeri
Invitado
 
Mensajes: n/a
Puntos:
Problemas con Margin

Hola buenos dias. Verán tengo los siguientes scripts:
Código HTML:
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
  <tr height="130">
    <td width="100%" class="logo" colspan="2">
    <img src="themes/Default/images/logo.gif" alt="logo.gif" />
    </td>
  </tr>
  <tr>
    <td width="20%" class="menu">
    <ul>
      <li>
        Inicio
      </li>
    </ul>
    </td>
    <td width="80%" class="content">
    Hola buenos dias <a href="jose.gif">Jose</a>
    </td>
  </tr>
</table> 
y este es el CSS:
Código:
/* ETIQUETAS */
IMG {
	border:0px;
}
BODY {
 	margin-bottom: 0px;
	margin-left: 0px;
	margin-right: 0px;
	margin-top: 0px;
}
FONT {
 	font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
	color: black
}
TABLE {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
	color: black
}
H1 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 15px
}
H2 {
 	font-family: Arial, Helvetica, sans-serif;
	 font-size: 14px
}
H3 {
 	font-family: Arial, Helvetica, sans-serif;
	 font-size: 13px
}
H4 {
 	font-family: Arial, Helvetica, sans-serif;
	 font-size: 12px
}
H5 {
 	font-family: Arial, Helvetica, sans-serif;
	 font-size: 12px
}
H6 {
 	font-family: Arial, Helvetica, sans-serif;
	 font-size: 12px
}
H7 {
 	font-family: Arial, Helvetica, sans-serif;
	 font-size: 12px
}
H8 {
 	font-family: Arial, Helvetica, sans-serif;
	 font-size: 12px
}

A:link 	    { color:#000; FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-SIZE: 11px; text-decoration:underline }
A:active 	{ color:#000; FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-SIZE: 11px; text-decoration:underline }
A:visited 	{ color:#000; FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-SIZE: 11px; text-decoration:underline }
A:hover 	{ color:green; FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-SIZE: 11px; text-decoration:overline}

/* ESTILOS DEFINIDOS */
.logo {
	background-color: #153510;
	text-align: right;
}
.menu {
	background-color: #45b335;
	color: #FFF;
	vertical-align: top;
	margin: 10px 10px 10px 10px;
}
menu.A:link 	{ color:#000; FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-SIZE: 11px; text-decoration:underline }
menu.A:active 	{ color:#000; FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-SIZE: 11px; text-decoration:underline }
menu.A:visited 	{ color:#000; FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-SIZE: 11px; text-decoration:underline }
menu.A:hover 	{ color:green; FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-SIZE: 11px; text-decoration:overline}
.content {
	background-color: #D6FFC1;
	vertical-align: top;
	margin: 10px 10px 10px 10px
}
Pueden ver el resultado aquí: http://jpeeri.myftp.org/scripts/cjProjects/

El problema como habréis podido averiguar algunos. Es que los margenes que le digo a las dos celdas de debajo no me hacen ni caso. Intento que sean de 10 px entre cada extremo pero nada.

¿Alguna idea? Muchisimas gracias
  #2 (permalink)  
Antiguo 26/11/2006, 13:03
Avatar de SiR.CARAJ0DIDA  
Fecha de Ingreso: junio-2004
Ubicación: Acá
Mensajes: 1.166
Antigüedad: 19 años, 9 meses
Puntos: 4
las celdas no tienen margen, solo padding. el espacio que separa las celdas esta dada por la propiedad border-spacing de la tabla
__________________
Internet Explorer SuckS
Download FireFox
  #3 (permalink)  
Antiguo 26/11/2006, 13:31
jpeeri
Invitado
 
Mensajes: n/a
Puntos:
Oh Thanks!!

Se arreglo!!
  #4 (permalink)  
Antiguo 29/11/2006, 07:29
jpeeri
Invitado
 
Mensajes: n/a
Puntos:
Ahora tengo otro problema. Nose porque ahora el alto de la página no me lo reconoce bien...

Acabo de descubrir que si quito el DOCTYPE funciona. Si lo quito el height vuelve a estar mal...

Última edición por jpeeri; 29/11/2006 a las 07:44
  #5 (permalink)  
Antiguo 29/11/2006, 12:24
Avatar de SiR.CARAJ0DIDA  
Fecha de Ingreso: junio-2004
Ubicación: Acá
Mensajes: 1.166
Antigüedad: 19 años, 9 meses
Puntos: 4
porque el atributo "height" en la tabla es un invento de bill gates, tenes que hacer las cosas bien y poner el height dentro del atributo style.
la forma correcta sería <table style="height:100%"> y la tabla debe estar contenida en un elemento que tenga un alto mayor al de la tabla.
__________________
Internet Explorer SuckS
Download FireFox
  #6 (permalink)  
Antiguo 29/11/2006, 12:36
jpeeri
Invitado
 
Mensajes: n/a
Puntos:
MmM.

Ahora lo que tengo es esto:
Código HTML:
!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="description" content="Tus proyectos en red" />
<meta name="keywords" content="project, projects, site, creaciones-jpeeri, jpeeri" />
<link rel="stylesheet" href="themes/Default/style/style.css" type="text/css" />
<link rel="stylesheet" href="sections/projects/style/style.css" type="text/css" />
<title>cjProjects :: Tus proyectos en red</title>
</head><body>
<table style="height: 100%; width: 100%; border: 0px;" cellspacing="0">
  <tr height="130">
    <td width="100%" class="logo" colspan="2">
    <img src="themes/Default/images/logo.gif" alt="logo.gif" />

    </td>
  </tr>
  <tr>
    <td width="20%" class="menu">
    <ul>
      <li>
        Inicio
      </li>
    </ul>

    </td>
    <td width="80%" class="content">
      Aqui el codigo principal
    </td>
  </tr>
</table>
</body>
</html> 
Y nada no funciona...
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 15:38.