LoginSignup
0
0

More than 3 years have passed since last update.

本で学んだこと(HTML , CSS編)

Posted at

HTMLとCSSで苦手なところを本で調べて学習し、記録しています。

表を作りたい

表を作る時はtableタグを使用する。

trタグは行を表すもので、今回は、4つあるので4行の表が完成する。
tdタグは、列を表すもの。それぞれ行の中に2つずつあるので2列できる。

<table border=1>
<tr><td>品物</td><td>金額</td></tr>
<tr><td>りんご</td><td>300円</td></tr>
<tr><td>もも</td><td>400円</td></tr>
<tr><td>メロン</td><td>900円</td></tr>
</table>
品物 金額
りんご 300円
もも 400円
メロン 900円

フォームを作りたい

フォーム記入欄を作る時はformタグを使用する。

text欄を作る時

<input type="text" name="">

e-mail欄を作る時は type は text となる。

<input type="text" name="email">

password欄を作る時

<input type="password" name="pass">

ラジオボタンを作る時
2つ以上作る場合、typeやnameを同じにしておく。

<input type="tadio" name="名前" value="値1">
<input type="tadio" name="名前" value="値2">

チェックボックスを作る時

2つ以上作る場合、typeやnameを同じにしておく。

<input type="checkbox" name="名前" value="値1">
<input type="checkbox" name="名前" value="値1">

選択欄を作る時


<select name="furuits">
<option name="apple">りんご</option>
<option name="peach">もも</option>
<option name="melon">メロン</option>
</select>

送信ボタンを作る時

<input type="submit" name="submit">
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0