初心者向けHTML入門の決定版:タグHTML

span要素・spanタグとは

Facebook にシェア
このエントリーをはてなブックマークに追加
Tweet

HTML要素のグループ化(インラインレベル)を行うspan要素

自分はブロック要素かインライン要素か インライン
含むことができる要素型 インライン要素
名称の由来 範囲を示す単語 span

span要素は文章中の内容をまとめ、id属性やclass属性と併用することで意味づけを行う。
インラインレベルでグルーピングを行うために利用される。
ブロックレベルでグルーピングを行いたい場合はdiv要素を利用します。

spanは一般的なインライン要素で、スクリプトの利用やスタイルの設定において多く用いられる。

HTMLソースコード例

<div id="info">
  <p>
    <span class="month">6月</span>
    <span class="day">15日</span>
  </p>
</div>

HTML要素(タグ)一覧

a  abbr  acronym  address  applet  area  b  base  basefont  bdo  big  blockquote  body  br  button  caption  center  cite  code  col  colgroup  dd  del  dfn  dir  div  dl  dt  em  fieldset  font  form  frame  frameset  h1 - h6  head  hr  html  i  iframe  img  input  ins  isindex  kbd  label  legend  li  link  map  menu  meta  noframes  noscript  object  ol  optgroup  option  p  param  pre  q  s  samp  script  select  small  span  strike  strong  style  sub  sup  table  tbody  td  textarea  tfoot  th  thead  title  tr  tt  u  ul  var  <!-- --> 

ブロックレベル要素一覧

p  h1-h6  ul  ol  dir  menu  pre  dl  div  center  noscript  noframes  blockquote  form  isindex  hr  table  fieldset  address 

インライン(テキストレベル)要素一覧

フォントスタイルに関するもの
tt  i  b  big  small
フレーズ・句に関するもの
em  strong  dfn  code  samp  kbd  var  cite  abbr  acronym
特別なもの
a  img  object  br  script  map  q  sub  sup  span  bdo
フォームに関するもの
input  select  textarea  label  button 

  • sitemap
  • 運営者情報
  • 免責事項
designed by ホームページ制作のササエル
Copyright © tagHTML All Rights Reserved.