|
<html> <head> <script type="text/javascript">
function LimparSaida ()
{ Paragrafo.innerHTML= ''; }
function EnviarSaida (Linha)
{ Paragrafo.innerHTML+= Linha + '<br>'; }
function Listar (Objeto)
{ LimparSaida (); EnviarSaida ('Id: ' + Objeto.id); EnviarSaida ('Style.Color: ' + Objeto.style.color); EnviarSaida ('Style.BackgroundColor: ' + Objeto.style.backgroundColor); EnviarSaida ('Style.FontFamily: ' + Objeto.style.fontFamily); EnviarSaida ('Style.FontSize: ' + Objeto.style.fontSize); EnviarSaida ('Style.FontWeight: ' + Objeto.style.fontWeight); EnviarSaida ('Style.TextAlign: ' + Objeto.style.textAlign); EnviarSaida ('Style.TextDecoration: ' + Objeto.style.textDecoration); }
function Atribuir (Objeto)
</script>{ var Estilo, Indice; Indice = Selecao.selectedIndex; Estilo = Selecao.options.item (Indice).innerHTML; Objeto.style.cssText= Estilo; Listar (Objeto); } </head> <body onload="javascript: Listar (Paragrafo);"> <p id="Paragrafo" style="color: Red; background-color: Yellow; font-family: Arial; font-size: medium; font-weight: normal; text-align: left; text-decoration: underline;"></p> <br> Escolha um estilo: <select id= "Selecao" onchange="javascript: Atribuir (Paragrafo);"> <option value="0">color: Red; background-color: Yellow; font-family: Arial; font-size: medium; font-weight: normal; text-align: left; text-decoration: underline;</option> <option value="1">color: Blue; background-color: Gray; font-family: Comic Sans MS; font-size: large; font-weight: bold; text-align: center; text-decoration: none;</option> <option value="1">color: Yellow; background-color: Black; font-family: Courier New; font-size: small; font-weight: lighter; text-align: right; text-decoration: none;</option> </select> </body> </html> |
| Clique aqui pra abrir no navegador |
|
<html> <head> <link id="Estilo" rel="stylesheet" type="text/css" href="estilo_exemplo_estilo1.css"> <script type="text/javascript">
function Atribuir (Opcao)
</script>{ Estilo.href= Opcao.value; } </head> <body> <p id="Paragrafo" class="Paragrafo">Digite qualquer m*:</p> <input id="Campo" class="Campo" type="text" value="LMNOP"><br><br><br><br> Escolha um estilo:<br> <input class="Opcao1" id="Opcao1" name="Grupo" type="radio" value="estilo_exemplo_estilo1.css" onclick="javascript: Atribuir (Opcao1);" checked="checked">Estilo 1 <br> <input class="Opcao2" id="Opcao2" name="Grupo" type="radio" value="estilo_exemplo_estilo2.css" onclick="javascript: Atribuir (Opcao2);">Estilo 2 </body> </html> |
| Clique aqui pra abrir no navegador |
| Clique aqui pra baixar Estilo 1 |
| Clique aqui pra baixar Estilo 2 |
