Centrar menú en tema Twenty Eleven

  • Autor Autor CarlosJG
  • Fecha de inicio Fecha de inicio
C

CarlosJG

Curioso
¡Usuario con pocos negocios! ¡Utiliza siempre saldo de Forobeta!
Hola de nuevo.

Me gustaría saber si hay alguna forma de centrar el menú de mi web, porque como veis en la foto que adjunto aparece a la izquierda, y no sé qué hacer para que se centre. Mi tema es Twenty Eleven.

Muchas gracias.

Sin título.webp
 
pues lo puedes hacer desde css en el archivo style.css del theme en la seccion del menu que lo vas a ver asi

/* =Menu
-------------------------------------------------------------- */
solo buscas lo que quieras cambiar en este caso seria el margin-left y pones los pixeles que necesites .
 
¿Tienes tu página alojada en un hosting o en wordpress.com?
 
Buenas, el menú seguramente sea un listado <li> y tenga en su clase de css la propiedad: "float: left;", deberías generar un div que sea el contenedor de este menú y centrar este último div, ya que en este caso no perderás los items alienados horizontalmente.

Por otro lado te consulto, ¿Este sitio lo hiciste tu o es un cms?
 
Hola,
Lo tienes en: wp-content/themes/twentyeleven/style.css de tu wordpress.
Esta en la parte que te ha comentado CrookedReyes y la modificación que te dijo indumentariaxxi.

Es la parte:
Insertar CODE, HTML o PHP:
<nav id="access" role="navigation">
del código de tu página.

Tu css:
Insertar CODE, HTML o PHP:
/* =Menu
-------------------------------------------------------------- */

#access {
	background: #222; /* Show a solid color for older browsers */
	background: -moz-linear-gradient(#252525, #0a0a0a);
	background: -o-linear-gradient(#252525, #0a0a0a);
	background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#252525), to(#0a0a0a)); /* older webkit syntax */
	background: -webkit-linear-gradient(#252525, #0a0a0a);
	-webkit-box-shadow: rgba(0, 0, 0, 0.4) 0px 1px 2px;
	-moz-box-shadow: rgba(0, 0, 0, 0.4) 0px 1px 2px;
	box-shadow: rgba(0, 0, 0, 0.4) 0px 1px 2px;
	clear: both;
	display: block;
	float: left;
	margin: 0 auto 6px;
	width: 100%;
}
#access ul {
	font-size: 13px;
	list-style: none;
	margin: 0 0 0 -0.8125em;
	padding-left: 0;
}
#access li {
	float: left;
	position: relative;
}
#access a {
	color: #eee;
	display: block;
	line-height: 3.333em;
	padding: 0 1.2125em;
	text-decoration: none;
}
#access ul ul {
	-moz-box-shadow: 0 3px 3px rgba(0,0,0,0.2);
	-webkit-box-shadow: 0 3px 3px rgba(0,0,0,0.2);
	box-shadow: 0 3px 3px rgba(0,0,0,0.2);
	display: none;
	float: left;
	margin: 0;
	position: absolute;
	top: 3.333em;
	left: 0;
 
Última edición:
Spaceking mi web la tengo alojada en un hosting. Y indumentariaxxi, el sitio lo he hexho yo a partir de la plantilla. Disculpad mi torpeza pero es que no doy con la tecla. Os voy a copiar la parte del Menu de mi style.css, y ya me decís qué tengo que hacer.

/* =Menu
-------------------------------------------------------------- */

<center><div id="navigation">
#access {
background: #222; /* Show a solid color for older browsers */
background: -moz-linear-gradient(#252525, #0a0a0a);
background: -o-linear-gradient(#252525, #0a0a0a);
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#252525), to(#0a0a0a)); /* older webkit syntax */
background: -webkit-linear-gradient(#252525, #0a0a0a);
-webkit-box-shadow: rgba(0, 0, 0, 0.4) 0px 1px 2px;
-moz-box-shadow: rgba(0, 0, 0, 0.4) 0px 1px 2px;
box-shadow: rgba(0, 0, 0, 0.4) 0px 1px 2px;
clear: both;
display: block;
float: left;
margin: 0 auto 6px;
width: 100%;
}
#access ul {
font-size: 13px;
list-style: none;
margin: 0 0 0 -0.8125em;
padding-left: 0;
}
#access li {
float: left;
position: relative;
}
#access a {
color: #eee;
display: block;
line-height: 3.333em;
padding: 0 1.2125em;
text-decoration: none;
}
#access ul ul {
-moz-box-shadow: 0 3px 3px rgba(0,0,0,0.2);
-webkit-box-shadow: 0 3px 3px rgba(0,0,0,0.2);
box-shadow: 0 3px 3px rgba(0,0,0,0.2);
display: none;
float: left;
margin: 0;
position: absolute;
top: 3.333em;
left: 0;
width: 188px;
z-index: 99999;
}
#access ul ul ul {
left: 100%;
top: 0;
}
#access ul ul a {
background: #f9f9f9;
border-bottom: 1px dotted #ddd;
color: #444;
font-size: 13px;
font-weight: normal;
height: auto;
line-height: 1.4em;
padding: 10px 10px;
width: 168px;
}
#access li:hover > a,
#access ul ul :hover > a,
#access a:focus {
background: #efefef;
}
#access li:hover > a,
#access a:focus {
background: #f9f9f9; /* Show a solid color for older browsers */
background: -moz-linear-gradient(#f9f9f9, #e5e5e5);
background: -o-linear-gradient(#f9f9f9, #e5e5e5);
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#f9f9f9), to(#e5e5e5)); /* Older webkit syntax */
background: -webkit-linear-gradient(#f9f9f9, #e5e5e5);
color: #373737;
}
#access ul li:hover > ul {
display: block;
}
#access .current-menu-item > a,
#access .current-menu-ancestor > a,
#access .current_page_item > a,
#access .current_page_ancestor > a {
font-weight: bold;
}

/* Search Form */
#branding #searchform {
position: absolute;
top: 3.8em;
right: 7.6%;
text-align: right;
}
#branding #searchform div {
margin: 0;
}
#branding #s {
float: right;
-webkit-transition-duration: 400ms;
-webkit-transition-property: width, background;
-webkit-transition-timing-function: ease;
-moz-transition-duration: 400ms;
-moz-transition-property: width, background;
-moz-transition-timing-function: ease;
-o-transition-duration: 400ms;
-o-transition-property: width, background;
-o-transition-timing-function: ease;
width: 72px;
}
#branding #s:focus {
background-color: #f9f9f9;
width: 196px;
}
#branding #searchsubmit {
display: none;
}
#branding .only-search #searchform {
top: 5px;
z-index: 1;
}
#branding .only-search #s {
background-color: #666;
border-color: #000;
color: #222;
}
#branding .only-search #s,
#branding .only-search #s:focus {
width: 85%;
}
#branding .only-search #s:focus {
background-color: #bbb;
}
#branding .with-image #searchform {
top: auto;
bottom: -27px;
max-width: 195px;
}
#branding .only-search + #access div {
padding-right: 205px;
}
</div></center>
 
Solo copia y pega esto en la sección apariencia » editar css:

Insertar CODE, HTML o PHP:
#access a { color: #EEEEEE; display: block; line-height: 3.333; margin-left: 40px; padding: 0 1.2125em; text-decoration: none; }

Saludos.
 
Atrás
Arriba