Foros del Web » Creando para Internet » CSS »

alinear horizontal lista en div

Estas en el tema de alinear horizontal lista en div en el foro de CSS en Foros del Web. hola amigos tengo este código y me gustaría que me ayudarais a alinear la lista de forma horizontal. Se que es con display:inline pero no ...
  #1 (permalink)  
Antiguo 29/08/2010, 16:54
 
Fecha de Ingreso: agosto-2008
Mensajes: 606
Antigüedad: 15 años, 8 meses
Puntos: 11
alinear horizontal lista en div

hola amigos tengo este código y me gustaría que me ayudarais a alinear la lista de forma horizontal. Se que es con display:inline pero no se donde aplicarlo os dejo código.

Código HTML:
 <style type="text/css">

#logo
{
margin-left:150px;
width: 900px;
height: 200px;
background:  url(la.JPG) no-repeat;
}
#menu
{
margin:auto;

text-align:center;
width: 900px;
height: 200px;
margin-left:230px;
background:  url(menu.JPG) no-repeat;
}

</style>
</head>

<body>
<div id="logo"></div>
<div id="menu">
<ul>
<li >home</li>
<li >home</li>
<li >home</li>
<li >home</li>
</ul>
</div>
</body>
</html> 
tendria que quedar la lista dentro del menú, gracias.
  #2 (permalink)  
Antiguo 29/08/2010, 19:46
Avatar de deirdre  
Fecha de Ingreso: mayo-2009
Mensajes: 690
Antigüedad: 14 años, 11 meses
Puntos: 45
Respuesta: alinear horizontal lista en div

Hola trevol

Mira si algo así, ajustándolo a tus medidas, te puede servir:

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 content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Menu lista centrada</title>
 <style type="text/css">
* {
	margin: 0; padding: 0;
}
#menu {
	margin: auto;
	width: 900px;
	height: 200px;
	background:  url(menu.JPG) no-repeat;
	border: 1px solid #444;
	text-align: center
}
ul {
	padding: 50px;
}
li {
	list-style: none;
	display: inline; 
	margin: 0 40px 0 40px;
}
</style>

</head>

<body>
<div id="menu">
	<ul>
		<li>home</li>
		<li>home</li>
		<li>home</li>
		<li>home</li>
	</ul>
</div>

</body>
</html> 
Saludos
  #3 (permalink)  
Antiguo 30/08/2010, 04:49
 
Fecha de Ingreso: agosto-2008
Mensajes: 606
Antigüedad: 15 años, 8 meses
Puntos: 11
Respuesta: alinear horizontal lista en div

Muchísmas gracias, Deirdre me vale ajustándolo un poco.

Etiquetas: alinear, horizontal, lista
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 03:51.