Ver Mensaje Individual
  #1 (permalink)  
Antiguo 18/10/2008, 19:29
DMR
 
Fecha de Ingreso: noviembre-2003
Mensajes: 105
Antigüedad: 20 años, 5 meses
Puntos: 0
Pregunta Problema con el W3C

Hola,

Tengo el siguiente menu:

Código:
   <a href="#"><div id="opcMenu">INICIO</div></a>
    <a href="#"><div id="opcMenu">COCHES</div></a>
    <a href="#"><div id="opcMenu">PISOS</div></a>

Os pongo el CSS:

Código:
#menu {
	height:36px;
	width:526px;
	margin:0 auto;
	border:2px solid #3399ff;
	font-size:0.8em;
	
}

#opcMenu {
	cursor:hand;	
	font-weight:bold;
	float:left;
	padding:10px;
}
#opcMenu:hover {
	background-color:#333;
}

Vale, la cosa es que queda muy bonito, pero no me pasa la validacion W3C.

Me da el error:

Cita:
Line 281, Column 33: document type does not allow element "div" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag.

<a href="#"><div id="opcMenu">INICIO</div></a>

The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
Yo se porque da el error (*), pero no se me ocurre ahora como arreglarlo sin complicarme mucho la vida, pero que siga haciendo el mismo efecto.

Alguna sugerencia?

Gracias.


(*) Que pongo la etiqueta <a href... antes del div y ahi esta el fallo... pero al tenerlo asi cuando paso el raton por la "BARRA DE MENU DE LA PAGINA" se cambia el fondo de color y mola.

PD: Tb da error pq repito el nombre de la etiqueta ID... ¿?