AJAX を使用して、データベースから特定のページのページ コンテンツを取得しています。それは完璧に機能しますが、今私の問題:
「連絡先」ページについては、データベースからフォーム (HTML のみ...) を取得しています。ただし、CSS は無視されます。ページの先頭にロードしました。フォーム パーツには ID とクラスがあります。
私の考えでは、CSS を読み込んだ後にコンテンツを挿入したことが原因だと思います。
注:私は JQuery を使用していないため、このプロジェクトでは使用したくありません。
フォームは次のようになります。
<form method="post" action="#">
<label id="CLabel" for="sendname">Name:<span class="required"></span></label><input type="text" class="contact" name="sendname" maxlength="30" required placeholder="Your Name..(Required)"><br>
<label id="CLabel" for="sendemail">Email:<span class="required"></span></label><input type="email" class="contact" name="sendemail" maxlength="100" placeholder="Your Email-address.."><br>
<label id="CLabel" for="reason">Contact reason:</label><input type="text" class="contact" name="sendreason" maxlength="30" required placeholder="Your Reason..(Required)"><br>
<label id="CLabel" for="sendmsg"></label><textarea id="cmsg" class="noResize" name="sendmsg" required placeholder="Your Message..(Required)" onfocus="this.value=\"\"; this.onfocus=null;"></textarea><br>
<label id="CLabel" for="contactbutton"></label><input class="contactbutton" type="submit" name="contactbutton" value="Send">
</form>
CSS または Javascript を確認するには、次のリンクを確認してください: philliprohde.bugs3.com/new_/
css は次のとおりです (id をクラスに変更):
label.CLabel{
display:inline-block;
width: 7em;
}
input.contact{
width:400px;
margin-top:5px;
}
/* Button of the contact form */
.contactbutton{
width: 100px;
background: #c1c1c1;
color: #8b0000;
text-transform: uppercase;
text-shadow: #000 1px 1px;
margin-top: 10px;
}
textarea.noResize { resize:none; }
textarea#cmsg {
width: 400px;
height: 120px;
margin-top:5px;
border:none;
font-family: Tahoma, sans-serif;
}
解決しました。ホスティング事業者は私の新しい css ファイルを受け入れませんでした (理由はわかりません)。古いものを削除して再度アップロードしたところ、動作するようになりました。
ご支援いただきありがとうございます。!