フォームのonclickで画面遷移した時に、同じページなのにcssが無くなってしまうのですが、どうしたらいいか分からず質問させて頂きました。コンソールからみると、head内にあるはずの要素が全て消えてしまっています。REBOOTのボタンが出たときにもcssを適用さえるにはどうしたらいいのでしょうか?
html,javascript,css
1<!DOCTYPE html> 2<html lang="ja"> 3 <head> 4 <meta charset="utf-8" /> 5 <TITLE>test</TITLE> 6 7 <link rel="stylesheet" href="./css/style.css"> 8 9<style type=”text/css”> 10 11 12#main01{ 13 width: 100%; 14 border: solid 1px #F00; 15 text-align: center; 16} 17 18input#start{ 19 margin: 0 auto; 20 padding: 20px; 21 22 font-size: 40px; 23 /* background: #EEE;*/ 24 background: #FFF; 25 26 color: #00F; 27 width: 200px; 28 height: 100px; 29 30 31border: 8px solid #00F; 32} 33 34input#re01{ 35 font-size: 40px; 36 position:absolute; 37 left:200px; 38 top:200px; 39 /* background: #EEE;*/ 40 background: #FFF; 41 border-top: 3px solid #DDD; 42 border-left: 3px solid #DDD; 43 border-right: 3px solid #BBB; 44 border-bottom: 3px solid #BBB; 45 border-color:#F00; 46 color:#F00; 47 width: 200px; 48 height: 100px; 49 padding: 10px 0 50} 51 52.test{margin: 0 0 0 100; border:solid 2px #00F;} 53 54.cipher01{ 55 margin: 20px 10px; 56 boder:solid 1px #f00; 57 58} 59 60 61.reboot01{ 62 margin: 20px 10px; 63 boder:solid 1px #00f; 64 65 background: #00ff00; 66} 67</style> 68 69</head> 70 71<BODY> 72<main id="main01"> 73<input id="start" type="button" value="START" onClick="start()"> 74 75</main> 76 77<script> 78 function start(){ 79 80 angou = []; 81 count = 0; 82 hira = prompt("文字を入力して下さい"); 83 84 sp1(); 85 loop1(); 86 87 angou.reverse(); 88 document.write('<div class="cipher01">' + hira + '</div>' + '<div class="cipher01">' + angou.join("") + '</div>'); 89 document.write('<div class="reboot01">' + "<input id='re' type='button' value='REBOOT' onclick='location.reload();'> " + '</div>'); 90 91 } 92 93var d = 0; 94var x = 0; 95 96function sp1(){ 97 x = hira.length; 98 bunnkai = hira.split(""); 99 console.log(x); 100} 101 102 103function loop1(){ 104 while(count <= x){ 105 moji = bunnkai[count]; 106 change1(); 107 count = count + 1; 108 } 109} 110 111function change1(){ 112} 113 114 115</script> 116 </BODY> 117</HTML>
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/05/20 04:55
2017/05/20 04:56
2017/05/20 15:54
2017/05/20 20:38