Foros del Web » Creando para Internet » Diseño web »

Hacer un submenú

Estas en el tema de Hacer un submenú en el foro de Diseño web en Foros del Web. Hola Buenos dias… Solo quiero poner en la pestaña "Social" los submenues de "Investigación Social" y "Comunicación Pública" Este es mi codigo html: Cita: <nav ...
  #1 (permalink)  
Antiguo 20/03/2013, 06:22
 
Fecha de Ingreso: enero-2008
Mensajes: 29
Antigüedad: 16 años, 3 meses
Puntos: 0
Hacer un submenú

Hola Buenos dias… Solo quiero poner en la pestaña "Social" los submenues de "Investigación Social" y "Comunicación Pública"

Este es mi codigo html:

Cita:
<nav id="navigation">
<a href="#" class="nav-btn">Home<span></span></a>
<ul>
<li><a href="quienes somos.html">Quienes somos</a></li>
<li><a href="#">Que hacemos</a></li>
<li class="active home"><a href="social.html">Social</a></li>
<li><a href="http://vab-consulting.blogspot.com.es/" target="_blank">Blog</a></li>
<li><a href="contacto.html">Contacto</a></li> </ul>

y acá esta mi hoja de estilos:

[QUOTE]
@font-face {
font-family: 'pt-sans';
src: url('fonts/ptc75f-webfont.eot');
src: url('fonts/ptc75f-webfont.eot?#iefix') format('embedded-opentype'),
url('fonts/ptc75f-webfont.woff') format('woff'),
url('fonts/ptc75f-webfont.ttf') format('truetype'),
url('fonts/ptc75f-webfont.svg#pt_sans_captionbold') format('svg');
font-weight: normal;
font-style: normal;
}

* {
margin: 0;
padding: 0;
outline: 0;
}

body, html { height: 100%; }

body {
font-size: 12px;
line-height: 22px;
font-family: arial, sans-serif;
color: #828282;
background: url(images/body.png) repeat 0 0;
}

a {
color: #3d6f92;
text-decoration: none;
cursor: pointer;
}
a:hover { text-decoration: underline; }
a img {
border: 0;
}
a.more {
background: url(images/green-arr.png) no-repeat 0 5px;
padding-left: 11px;
color: #3d6f92;
text-decoration: none;
font-size: 12px;
}
a.more:hover { text-decoration: none; }

/*font-family: 'Coda', cursive;*/
/*font-family: 'Jura', sans-serif;*/

article, aside, details, footer, header, menu, nav, section { display: block; }
input, textarea, select { font-size: 12px; font-family: arial, sans-serif; }
textarea { overflow: auto; }

.cl { display: block; height: 0; font-size: 0; line-height: 0; text-indent: -4000px; clear: both; }
.notext { font-size: 0; line-height: 0; text-indent: -4000px; }
.left, .alignleft { float: left; display: inline; }
.right, .alignright { float: right; display: inline; }

.shell { width: 980px; margin: 0 auto; }

.header { background: url(images/header.png) repeat 0 0; }
.header .shell { padding: 21px 32px 0; width: 918px; background: url(images/header-shell2.png) no-repeat center 0; box-shadow: 0px -10px 9px rgba(0,0,0,0.7); -moz-box-shadow: 0px -10px 9px rgba(0,0,0,0.7); -webkit-box-shadow: 0px -10px 9px rgba(0,0,0,0.7); -o-box-shadow: 0px -3px 10px 9rgba(0,0,0,0.7) }
.header-top {
height: 68px;

}

#logo { width: 142px; font-size: 0; line-height: 0; float: left; }
#logo a { height: 57px; display: block; background: url() no-repeat 0 0; text-indent: -4000px; }

#navigation { float: right; padding-top: 27px; }
#navigation ul { list-style: none; list-style-position: outside; font-size: 12px; font-family: 'Coda', cursive; font-weight: 400; }
#navigation ul li { display: inline; padding-left: 34px; }
#navigation ul li a { color: #d5d4d4; }
#navigation ul li a:hover,
#navigation ul li.active a { color: #fff; text-decoration: none; }
.slider { height: 436px; }
[QUOTE]

Que tengo que poner en el html y en el CSS para que me aparezca abajo como este ejemplo que les subo?

http://subefotos.com/ver/?4907000a90e9ddf4587711bc31f64d11o.jpg

Pd: envio acortados el html y el css porque no me deja subirlo entero.


  #2 (permalink)  
Antiguo 20/03/2013, 13:18
Avatar de Mariano_Floyd  
Fecha de Ingreso: marzo-2013
Ubicación: Córdoba
Mensajes: 155
Antigüedad: 11 años, 2 meses
Puntos: 14
Respuesta: Hacer un submenú

Hay un montón de ejemplos en google, en tu html tienes que agregar otra lista, algo así:

Código HTML:
<nav id="navigation">
<a href="#" class="nav-btn">Home<span></span></a>
<ul>
<li><a href="quienes somos.html">Quienes somos</a></li>
<li><a href="#">Que hacemos</a></li> 
<li class="active home"><a href="social.html">Social</a>
<ul class="children">
<li><a href="#"> Investigación Social</a></li>
<li><a href="#"> Comunicación Publica</a></li>
</ul></li>
<li><a href="http://vab-consulting.blogspot.com.es/" target="_blank">Blog</a></li>
<li><a href="contacto.html">Contacto</a></li> </ul> 
En el css, lo maquetas como mas te guste, le puedes añadir transiciones o lo que desees. Una vez lo tengas maquetado, le pones la opacidad en 0 o el display:none, y lo harás visible con el :hover, es decir

Código:
.activehome:hover > children{
opacity:1;
}
Espero haberme sabido explicar y que te haya sido de ayuda. Saludos
  #3 (permalink)  
Antiguo 21/03/2013, 03:23
 
Fecha de Ingreso: enero-2008
Mensajes: 29
Antigüedad: 16 años, 3 meses
Puntos: 0
Respuesta: Hacer un submenú

Hola… gracias por la pronta ayuda!!! Me sirvió mucho de verdad
Solo tengo una cuestión.
Al final el submenú me queda así:

http://subefotos.com/ver/?aec218eeaae01ef719f63790546ba92fo.jpg

Y yo la verdad es que lo quiero en vertical y que se active al pasar el Mouse por la pestaña social… Como en este ejemplo que subí anteriormente:

http://subefotos.com/ver/?4907000a90e9ddf4587711bc31f64d11o.jpg


Supongo que es algo referido a esto que me mencionas que debo maquetarlo en el CSs….
Pero es que no tengo ni idea que te refieres? Perdón por ser tan novato!!!
Como armo este maquetado y que me quede parejito?

Gracias de verdad!
  #4 (permalink)  
Antiguo 21/03/2013, 12:41
Avatar de Mariano_Floyd  
Fecha de Ingreso: marzo-2013
Ubicación: Córdoba
Mensajes: 155
Antigüedad: 11 años, 2 meses
Puntos: 14
Respuesta: Hacer un submenú

Sigue este tutorial y lo vas a lograr:

http://vagabundia.blogspot.com/2012/05/simple-menu-desplegable-con-css.html
  #5 (permalink)  
Antiguo 22/03/2013, 05:41
 
Fecha de Ingreso: enero-2008
Mensajes: 29
Antigüedad: 16 años, 3 meses
Puntos: 0
Respuesta: Hacer un submenú

Hola gracias por la ayuda... ya casi lo tengo... no se que hago mal, pero me faltan dos cosas:

1) No me marca la pestaña activa ( En este caso, "Que hacemos"
2) me quedan los submenues visibles y yo quiero que se vean solo cuando paso el mouse...

Este es el CSS:

Cita:
#navigation {float: right; padding-top: 17px;}
#navigation { line-height: 18px; font-family: "Georgia", "Lucida Sans", Sans-Serif; text-transform: uppercase; text-shadow: #000 1px 1px 0; }
#navigation .center { height: 45px; position: relative; z-index: 110; }
#navigation ul { float: right; display: inline; padding-top: 2px; }
#navigation ul li { float: left; display: inline; list-style-type: none; padding-left: 1px; background: url(images/list-elem.gif) no-repeat 0 center; position: relative; height: 100%; }
#navigation ul li.first { background: none; }
#navigation ul li a { color: #7b6b60; text-decoration: none; display: block; padding-left: 14px; padding-right: 12px; }
#navigation ul li a:hover { color: #ffffff; }
#navigation ul li a.active { color: #ffffff !important; }
#navigation ul li.hover { background-color: #0d0d0d; }
.activehome:hover > dd{ opacity:1;}
#navigation ul .dd { position: absolute; top: 14px; left: 0; width: auto; display: block; line-height: 14px; text-transform: none;}
#navigation ul .dd .dd { left: 100%; top: -5px; }
#navigation ul ul { float: none; display: block; padding: 5px; margin-left: 0; width: 178px; white-space: nowrap;}
#navigation ul ul li { float: none; display: block; padding-left: 0; margin-left: 0; padding: 0 5px; no-repeat 0 bottom; }
#navigation ul ul li.last { background: none; }
Asi me queda ahora....

http://subefotos.com/ver/?3f2440e46a2d01698662ef71ef6c66efo.jpg

Estoy seguro que es retocar algun display pero no doy con la tecla!!!
  #6 (permalink)  
Antiguo 24/03/2013, 18:31
 
Fecha de Ingreso: enero-2008
Mensajes: 29
Antigüedad: 16 años, 3 meses
Puntos: 0
Respuesta: Hacer un submenú

Lo he solucionado, comparto como quedo al final.
Cita:
#navigation {float: right; padding-top: 17px;}
#navigation { line-height: 18px; font-family: "Georgia", "Lucida Sans", Sans-Serif; text-transform: uppercase; text-shadow: #000 1px 1px 0; }
#navigation .center { height: 45px; position: relative; z-index: 110; }
#navigation ul { float: right; display: inline; padding-top: 2px; }
#navigation ul li { float: left; display: inline; list-style-type: none; padding-left: 1px; background: url(images/list-elem.gif) no-repeat 0 center; position: relative; height: 100%; }
#navigation ul li.first { background: none; }
#navigation ul li a { color: #959697; text-decoration: none; display: block; padding-left: 14px; padding-right: 12px; }
#navigation ul li a:hover { color: #ffffff; }
#navigation ul li a.active { color: #ffffff !important; }
#navigation ul li.hover { background-color: #0d0d0d; }
#navigation ul .dd { position: absolute; top: 14px; left: 0; width: auto; display: none; line-height: 14px; text-transform: none;}
#navigation ul .dd .dd { left: 100%; top: -5px; }
#navigation ul ul { float: none; display: none; padding: 5px; margin-left: 0; width: 178px; white-space: nowrap;}

#navigation ul li:hover ul { display: block; }
#navigation ul ul li.last { background: none; }

Etiquetas: css, html
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:31.