2012-04-03 13 views
6

Para esta línea de código:IE frameBorder alternativa

<iframe width="600" height="400" frameBorder="0" src="http://stackoverflow.com"></iframe>​ 

me dio este error: (validator.w3.org: XHTML 1.0 Transicional)

there is no attribute "frameBorder" 

estoy usando frameBorder porque crea IE8 algún tipo de borde en iframes. En los últimos Chrome/Firefox está bien.

¿Hay alguna otra forma W3C válida para eliminar el borde iframe en IE8?

+0

posible duplicado de [IE 8 iframe border problem] (http://stackoverflow.com/questions/1625835/ie-8-iframe-border- problema) – Ben

Respuesta

-1

Todos los atributos en xhtml están en minúscula. Prueba esto:

<iframe width="600" height="400" frameborder="0" src="http://stackoverflow.com"></iframe>​ 
+2

'frameborder' tampoco está permitido por el validador. –

0

Desde W3C no se excecuting Javascript, se podría añadir el atributo más tarde con Javascript.

Ejemplo utilizando jQuery:

$('iframe').attr("frameBorder", 0); 
4

Simplemente utilizar CSS:

<iframe width="600" height="400" style="border:none;" src="http://www.google.com"></iframe> 

P.S. Supongo que utilizó stackoverflow en su etiqueta iFrame como ejemplo. Debido a que el sitio no permite ser i-Framed, parece ...