Foros del Web » Creando para Internet » CSS »

menu responsive se desarma en wordpress

Estas en el tema de menu responsive se desarma en wordpress en el foro de CSS en Foros del Web. Hola Tengo un problema con un menu responsive, resulta que los descarguemodifique el css acondicionado al diseño de mi pagina esta en html (ejemplo está ...
  #1 (permalink)  
Antiguo 16/10/2013, 10:11
 
Fecha de Ingreso: abril-2008
Mensajes: 8
Antigüedad: 16 años
Puntos: 0
menu responsive se desarma en wordpress

Hola

Tengo un problema con un menu responsive, resulta que los descarguemodifique el css acondicionado al diseño de mi pagina esta en html (ejemplo está en http://www.alkomex.com/), ahora bien quiero ponerlo en mi plantilla wordpress y este se me desarma en el header.php

Código PHP:
Ver original
  1. <h3><Div id="menu">
  2.  
  3. <nav id="nav" role="navigation"> Show navigation Hide navigation
  4. <ul class="clearfix">
  5.  
  6. <?php wp_list_pages( 'title_li=&depth=2' ); ?>
  7. </nav>
  8. </Div>
  9. </h3>

footer.php

Código PHP:
Ver original
  1. <script type="text/javascript" src="<?php bloginfo('template_url')?>/js/doubletaptogo.js"></script>
  2. <script type="text/javascript" src="<?php bloginfo('template_url')?>/js/doubletaptogo.min.js"></script>
  3. <?php wp_head();?>
  4. <script type="text/javascript" src="<?php bloginfo('template_url')?>http://code.jquery.com/jquery-latest.min.js"></script>

css:
Código CSS:
Ver original
  1. @charset "utf-8";
  2. /* CSS Document */
  3. a {
  4. text-decoration: none;
  5. }
  6. ul, li {
  7. list-style: none;
  8. margin: 0;
  9. padding: 0;
  10. }
  11. #nav {
  12. width: 920px; /* 1000 */
  13. font-family: muli, 'Open Sans', sans-serif;
  14. font-weight: 400;
  15. left: 50%;
  16. margin-left: auto; /* 30 480 */
  17. margin-right: auto;
  18. }
  19. #nav > a {
  20. display: none;
  21. }
  22. #nav li {
  23. position: relative;
  24. }
  25. #nav li a {
  26. color: #fff;
  27. display: block;
  28. }
  29. #nav li a:active {
  30. background-color: #09C !important;
  31. }
  32. #nav span:after {
  33. width: 0;
  34. height: 0;
  35. border: 0.313em solid transparent; /* 5 */
  36. border-bottom: none;
  37. border-top-color: #efa585;
  38. content: '';
  39. vertical-align: middle;
  40. display: inline-block;
  41. position: relative;
  42. right: -0.313em; /* 5 */
  43. }
  44. /* first level */
  45.  
  46. #nav > ul {
  47. height: 30px; /* 60 */
  48. background-color: rgb(44,174,201);
  49. }
  50. #nav > ul > li {
  51. width: 25%;
  52. height: 100%;
  53. float: left;
  54. }
  55. #nav > ul > li > a {
  56. height: 100%;
  57. font-size: 12px; /* 24 */
  58. line-height: 2.5em; /* 60 (24) */
  59. text-align: center;
  60. }
  61. #nav > ul > li:not( :last-child ) > a {
  62. border-right: 1px solid #069;
  63. }
  64. #nav > ul > li:hover > a, #nav > ul:not( :hover ) > li.active > a {
  65. background-color:#069;
  66. }
  67. /* second level */
  68.  
  69. #nav li ul {
  70. background-color: #069;
  71. display: none;
  72. position: absolute;
  73. top: 100%;
  74. }
  75. #nav li:hover ul {
  76. display: block;
  77. left: 0;
  78. right: 0;
  79. }
  80. #nav li:not( :first-child ):hover ul {
  81. left: -1px;
  82. }
  83. #nav li ul a {
  84. font-size: 12px; /* 20 */
  85. border-top: 1px solid #03F;
  86. padding: 0.75em; /* 15 (20) */
  87. }
  88. #nav li ul li a:hover, #nav li ul:not( :hover ) li.active a {
  89. background-color: #0066CC;
  90. }
  91. @media only screen and ( max-width: 62.5em ) /* 1000 */ {
  92. #nav {
  93. width: 100%;
  94. position: static;
  95. margin: 0;
  96. }
  97. }
  98. @media only screen and ( max-width: 40em ) /* 640 */ {
  99. html {
  100. font-size: 50%; /* 12 */
  101. }
  102. #nav {
  103. position: relative;
  104. top: auto;
  105. left: auto;
  106. }
  107. #nav > a {
  108. width: 3.125em; /* 50 */
  109. height: 3.125em; /* 50 */
  110. text-align: left;
  111. text-indent: -9999px;
  112. background-color: #00e;
  113. position: relative;
  114. }
  115. #nav > a:before, #nav > a:after {
  116. position: absolute;
  117. border: 2px solid #fff;
  118. top: 35%;
  119. left: 25%;
  120. right: 25%;
  121. content: '';
  122. }
  123. #nav > a:after {
  124. top: 60%;
  125. }
  126. #nav:not( :target ) > a:first-of-type, #nav:target > a:last-of-type {
  127. display: block;
  128. }
  129. /* first level */
  130.  
  131. #nav > ul {
  132. height: auto;
  133. display: none;
  134. position: absolute;
  135. left: 0;
  136. right: 0;
  137. }
  138. #nav:target > ul {
  139. display: block;
  140. }
  141. #nav > ul > li {
  142. width: 100%;
  143. float: none;
  144. }
  145. #nav > ul > li > a {
  146. height: auto;
  147. text-align: left;
  148. padding: 0 0.833em; /* 20 (24) */
  149. }
  150. #nav > ul > li:not( :last-child ) > a {
  151. border-right: none;
  152. border-bottom: 1px solid #09C;
  153. }
  154. /* second level */
  155.  
  156. #nav li ul {
  157. position: static;
  158. padding: 1.25em; /* 20 */
  159. padding-top: 0;
  160. }
  161. }
  162.  
  163. css div menu en header.php de wordpress:
  164. }
  165. #menu {
  166. clear: both;
  167. float: left;
  168. margin-left: 0;
  169. width: 100%;
  170. display: block;
  171. }

Última edición por pzin; 17/10/2013 a las 01:19 Razón: formato código
  #2 (permalink)  
Antiguo 16/10/2013, 10:15
Avatar de Triby
Mod on free time
 
Fecha de Ingreso: agosto-2008
Ubicación: $MX->Gto['León'];
Mensajes: 10.106
Antigüedad: 15 años, 8 meses
Puntos: 2237
Respuesta: menu responsive se desarma en wordpress

El problema no es PHP, sino CSS, muevo tu tema al foro adecuado.
__________________
- León, Guanajuato
- GV-Foto
  #3 (permalink)  
Antiguo 16/10/2013, 15:20
 
Fecha de Ingreso: abril-2008
Mensajes: 8
Antigüedad: 16 años
Puntos: 0
Respuesta: menu responsive se desarma en wordpress

Pero el php que coloque en header.php esta bien

Código PHP:
Ver original
  1. <h3><Div id="menu">
  2.  
  3. <nav id="nav" role="navigation"> Show navigation Hide navigation
  4. <ul class="clearfix">
  5.  
  6. <?php wp_list_pages( 'title_li=&depth=2' ); ?>
  7. </nav>
  8. </Div>
  9. </h3>

Última edición por pzin; 17/10/2013 a las 01:19 Razón: formato código
  #4 (permalink)  
Antiguo 17/10/2013, 01:22
Avatar de pzin
Moderata 😈
 
Fecha de Ingreso: julio-2002
Ubicación: Islas Canarias
Mensajes: 10.488
Antigüedad: 21 años, 8 meses
Puntos: 2114
Respuesta: menu responsive se desarma en wordpress

Si publicas el código HTML generado sería mejor, hay gentes como yo que nunca hemos usado WordPress y no sabemos qué genera wp_list_pages().
Como ya te han dicho, al no ser un problema de PHP sino de CSS, lo suyo es publicar sólo código HTML y CSS.

Usa highlight cuando publiques código, para que quede bonito y legible.
  #5 (permalink)  
Antiguo 17/10/2013, 08:13
 
Fecha de Ingreso: abril-2008
Mensajes: 8
Antigüedad: 16 años
Puntos: 0
Respuesta: menu responsive se desarma en wordpress

esta es el codigo del ejemplo de la pagina html5 aqui funciona perfecto el tema es que se desarma al llevarla a header.php

<body>
<nav id="nav" role="navigation"> <a href="#nav" title="Show navigation">Show navigation</a> <a href="#" title="Hide navigation">Hide navigation</a>
<ul class="clearfix">
<li><a href="#">Home</a></li>
<li> <a href="#"><span>Categories</span></a>
<ul>
<li><a href="http://www.jqueryscript.net/jquery-plugins/" title="Latest &amp; Recent Update jQuery Plugins">Latest jQuery Plugins</a></li>
<li><a href="http://www.jqueryscript.net/popular/" title="Most popular jQuery Plugins">Most Popular Plugins</a></li>
<li><a href="http://www.jqueryscript.net/recommended/" title="Recommended jQuery Plugins">Recommended Plugins</a></li>
<li><a href="http://www.jqueryscript.net/submit/" rel="nofollow">Publishing Your Plugin</a></li>
<li><a href="http://www.jqueryscript.net/blog/" title="jQueryScript Blog">Blog</a></li>
</ul>
</li>
<li> <a href="?work"><span>Popular</span></a>
<ul>
<li><a href="http://www.jqueryscript.net/slider/">jQuery Slider Plugins</a></li>
<li><a href="http://www.jqueryscript.net/slideshow/">jQuery Slideshow Plugins</a></li>
<li><a href="http://www.jqueryscript.net/menu/">jQuery Menu Plugins</a></li>
<li><a href="http://www.jqueryscript.net/table/">jQuery Table Plugins</a></li>
<li><a href="http://www.jqueryscript.net/gallery/">jQuery Gallery Plugins</a></li>
</ul>
</li>
<li><a href="#">About</a></li>
</ul>
</nav>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="js/doubletaptogo.min.js"></script>
<script src="js/doubletaptogo.js"></script>
</body>


Esto esta en header.php

<div id="logo"><a href="<?php bloginfo('url')?>"><img src="<?php bloginfo('template_url')?>/images/logo.png" alt="logo"/></a></div>
<!--fin logo-->
<!--comienzo menu-->



<h3><Div id="menu">

<nav id="nav" role="navigation"> <a href="#nav" title="Show navigation">Show navigation</a> <a href="#" title="Hide navigation">Hide navigation</a>
<ul class="clearfix"><LI><?php wp_list_pages( 'title_li=&depth=2' ); ?>
</LI>
</ul>
</nav>
</Div>
</h3>


<!--fin menu-->
  #6 (permalink)  
Antiguo 17/10/2013, 21:07
 
Fecha de Ingreso: abril-2008
Mensajes: 8
Antigüedad: 16 años
Puntos: 0
Respuesta: menu responsive se desarma en wordpress

hola descubri que en el codigo css:

#nav > ul > li {
width: 15%;
height: 100%;
float: left;
}

aqui al ir bajando el ancho van entrando horizontalmente mas item, lo que quiero es que cada seccion quede del ancho de las letras y no de igual ancho todo asi entraran todos los item de las pagina

codigo css entero


@charset "utf-8";
/* CSS Document */
a {
text-decoration: none;
}
ul, li {
list-style: none;
margin: 0;
padding: 0;
}
#nav {
width: 920px; /* 1000 */
font-family: muli, 'Open Sans', sans-serif;
font-weight: 400;
left: 50%;
margin-left: auto; /* 30 480 */
margin-right: auto;
}
#nav > a {
display: none;
}
#nav li {
position: relative;
}
#nav li a {
color: #fff;
display: block;
}
#nav li a:active {
background-color: #09C !important;
}
#nav span:after {
width: 0;
height: 0;
border: 0.313em solid transparent; /* 5 */
border-bottom: none;
border-top-color: #efa585;
content: '';
vertical-align: middle;
display: inline-block;
position: relative;
right: -0.313em; /* 5 */
}
/* first level */

#nav > ul {
height: 30px; /* 60 */
background-color: rgb(44,174,201);
}
#nav > ul > li {
width: 15%;
height: 100%;
float: left;
}
#nav > ul > li > a {
height: 100%;
font-size: 12px; /* 24 */
line-height: 2.5em; /* 60 (24) */
text-align: center;
}
#nav > ul > li:not( :last-child ) > a {
border-right: 1px solid #069;
}
#nav > ul > li:hover > a, #nav > ul:not( :hover ) > li.active > a {
background-color:#069;
}
/* second level */

#nav li ul {
background-color: #069;
display: none;
position: absolute;
top: 100%;
}
#nav li:hover ul {
display: block;
left: 0;
right: 0;
}
#nav li:not( :first-child ):hover ul {
left: -1px;
}
#nav li ul a {
font-size: 12px; /* 20 */
border-top: 1px solid #03F;
padding: 0.75em; /* 15 (20) */
}
#nav li ul li a:hover, #nav li ul:not( :hover ) li.active a {
background-color: #0066CC;
}
@media only screen and ( max-width: 62.5em ) /* 1000 */ {
#nav {
width: 100%;
position: static;
margin: 0;
}
}
@media only screen and ( max-width: 40em ) /* 640 */ {
html {
font-size: 50%; /* 12 */
}
#nav {
position: relative;
top: auto;
left: auto;
}
#nav > a {
width: 3.125em; /* 50 */
height: 3.125em; /* 50 */
text-align: left;
text-indent: -9999px;
background-color: #00e;
position: relative;
}
#nav > a:before, #nav > a:after {
position: absolute;
border: 2px solid #fff;
top: 35%;
left: 25%;
right: 25%;
content: '';
}
#nav > a:after {
top: 60%;
}
#nav:not( :target ) > a:first-of-type, #nav:target > a:last-of-type {
display: block;
}
/* first level */

#nav > ul {
height: auto;
display: none;
position: absolute;
left: 0;
right: 0;
}
#nav:target > ul {
display: block;
}
#nav > ul > li {
width: 100%;
float: none;
}
#nav > ul > li > a {
height: auto;
text-align: left;
padding: 0 0.833em; /* 20 (24) */
}
#nav > ul > li:not( :last-child ) > a {
border-right: none;
border-bottom: 1px solid #09C;
}
/* second level */

#nav li ul {
position: static;
padding: 1.25em; /* 20 */
padding-top: 0;
}
}

Etiquetas: html, php, responsive, wordpress
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 09:38.