Tengo el siguiente codigo eh html: pagina.html
Código HTML:
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Documento sin título</title> <script language="javascript" src="funciones.js" type="text/javascript"></script> <link rel="StyleSheet" href="estilo_dhtml1.css" type="text/css"> </head> <body> <h1 id="titulo">Hola Este es un parrafo dinámico, que puede cambiar entre tres tamaños de letra (10px, 13px, 20px).</h1> <input type="button" value="Tamaño 10px" onclick="cambiarTamanoA(10)" /> <input type="button" value="Tamaño 13px" onclick="cambiarTamanoA(13)" /> <input type="button" value="Tamaño 20px" onclick="cambiarTamanoA(20)" /> </body> </html>
Código:
y una Hoja de Estilo: estilo_dhtml1.css// JavaScript Document function cambiarColor(idName) { var tit=document.getElementById('titulo'); tit.style.color="#0FF"; } function cambiarTamanoA(size) { var tit=document.getElementById('titulo'); tit.style.fontSize=size; } function cambiarTamanoFuente() { var tit=document.getElementById('titulo'); tit.style.fontSize=60; }
Código:
Y el caso es que todo funciona bien... pero si cambio al html agregandole las etiquetas de DOCTYPE antes de < html >: #titulo { text-align:center; } #boton1,#boton2 { text-align:center; width:200px; }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Ya no funciona....
solo funciona el procedimiento de cambio de Color...
Si alguien puede ayudarme se lo agradecería...
![Aplauso](http://static.forosdelweb.com/fdwtheme/images/smilies/aplausos.gif)
Gracias!!