方法-メールマガジン
CSSを使用してメールマガジンを作成する方法を学びます。
ニュースレターを購読する
ニュースレターblablaを購読する理由についてのLoremipsumテキスト。ニュースレターblablaを購読する理由についてのLoremipsumテキスト。ニュースレターblablaを購読する理由についてのLoremipsumテキスト。
ニュースレターの作成方法
ステップ1)HTMLを追加する
<form>要素を使用して入力を処理します。これについて詳しくは、 PHPチュートリアルをご覧ください。次に、「送信」ボタンとともに、各フィールドの入力を追加します。
例
<form action="action_page.php">
<div class="container">
<h2>Subscribe to our Newsletter</h2>
<p>Lorem ipsum..</p>
</div>
<div class="container" style="background-color:white">
<input type="text" placeholder="Name" name="name" required>
<input type="text" placeholder="Email address" name="mail" required>
<label>
<input type="checkbox" checked="checked"
name="subscribe"> Daily Newsletter
</label>
</div>
<div class="container">
<input type="submit"
value="Subscribe">
</div>
</form>
ステップ2)CSSを追加します。
例
/* Style the form element with a border
around it */
form {
border: 4px solid #f1f1f1;
}
/* Add some padding and a grey background color to containers */
.container {
padding: 20px;
background-color: #f1f1f1;
}
/* Style the input elements and the
submit button */
input[type=text], input[type=submit] {
width: 100%;
padding: 12px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
box-sizing: border-box;
}
/* Add margins to the checkbox */
input[type=checkbox] {
margin-top: 16px;
}
/* Style the submit button */
input[type=submit] {
background-color: #04AA6D;
color: white;
border: none;
}
input[type=submit]:hover {
opacity: 0.8;
}
ヒント: HTMLフォームの詳細については、 HTMLフォームチュートリアルにアクセスしてください。
ヒント:フォーム要素のスタイルを設定する方法の詳細については、 CSSフォームチュートリアルにアクセスしてください。