<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>たねっぱ！ &#187; yanoppa!</title>
	<atom:link href="https://taneppa.net/author/futappa_yano/feed/" rel="self" type="application/rss+xml" />
	<link>https://taneppa.net</link>
	<description>コツコツあつめるWeb作りのためのたね　たねっぱ！Web系情報ブログ　Webのお役立ちネタ配信中！</description>
	<lastBuildDate>Tue, 09 May 2023 00:02:06 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>【JQueryライブラリ】簡単に高さを揃えられるjquery.tile.jsを使ってみよう。</title>
		<link>https://taneppa.net/tilejs/</link>
		<comments>https://taneppa.net/tilejs/#comments</comments>
		<pubDate>Thu, 30 Apr 2015 02:12:31 +0000</pubDate>
		<dc:creator>yanoppa!</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[初心者向け]]></category>

		<guid isPermaLink="false">https://taneppa.net/?p=2508</guid>
		<description><![CDATA[【JQueryライブラリ】簡単に高さを揃えられるjquery.tile.jsを使ってみよう。 こんばんちわ、や [...]]]></description>
				<content:encoded><![CDATA[<div style="line-height:2;">
<h2>【JQueryライブラリ】簡単に高さを揃えられる<span class="fB">jquery.tile.js</span>を使ってみよう。</h2>
<p>こんばんちわ、やのっぱです(´・ω・｀)v</p>
<p>今回は良く利用するJQueryライブラリ、tile.jsの使い方をお話していきます。<br />
それではやっていきましょう。</p>
<h3>まずは設置から</h3>
<p>まずはダウンロードし、設置をしていきます。</p>
<p>配布元の<a href="http://urin.github.io/jquery.tile.js/" target="_blank">jquery.tile.js Demos</a>から【Download compressed】(compressedはmin化、uncompressedは展開された状態です)を右クリックで保存、またはクリックして出てきたソースを保存またはコピペしてjquery.tile.jsの名前で保存し任意のフォルダに格納します。</p>
<p>次に、jQueryとjquery.tile.jsをhead内に<span class="fB">読み込み</span>、使用出来るようにします。</p>
<pre class="brush: xml; title: ; notranslate">
&lt;script src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;格納場所のパスをいれます/jquery.tile.js&quot;&gt;&lt;/script&gt;
</pre>
<p>これでとりあえず読み込まれ使用出来る状態です。</p>
<p>このようなHTMLを用意してみました。<br />
画像とテキストの入ったliですね。<br />
これにtileを適応すると、一番高さがあるものに揃います。</p>
<pre class="brush: xml; title: ; notranslate">
&lt;ul class=&quot;testList clearfix&quot;&gt;
	&lt;li class=&quot;testBox&quot;&gt;
		&lt;p class=&quot;img&quot;&gt;&lt;img src=&quot;http://placehold.jp/150x150.png&quot;&gt;&lt;/p&gt;
		&lt;p class=&quot;text&quot;&gt;テキストテキストテキストテキストテキスト&lt;/p&gt;
	&lt;/li&gt;
	&lt;li class=&quot;testBox&quot;&gt;
		&lt;p class=&quot;img&quot;&gt;&lt;img src=&quot;http://placehold.jp/150x150.png&quot;&gt;&lt;/p&gt;
		&lt;p class=&quot;text&quot;&gt;テキストテキストテキストテキストテキストテキストテキストテキスト&lt;/p&gt;
	&lt;/li&gt;
	&lt;li class=&quot;testBox&quot;&gt;
		&lt;p class=&quot;img&quot;&gt;&lt;img src=&quot;http://placehold.jp/150x150.png&quot;&gt;&lt;/p&gt;
		&lt;p class=&quot;text&quot;&gt;テキストテキストテキストテキスト&lt;/p&gt;
	&lt;/li&gt;
	&lt;li class=&quot;testBox&quot;&gt;
		&lt;p class=&quot;img&quot;&gt;&lt;img src=&quot;http://placehold.jp/150x150.png&quot;&gt;&lt;/p&gt;
		&lt;p class=&quot;text&quot;&gt;テキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト&lt;/p&gt;
	&lt;/li&gt;
	&lt;li class=&quot;testBox&quot;&gt;
		&lt;p class=&quot;img&quot;&gt;&lt;img src=&quot;http://placehold.jp/150x150.png&quot;&gt;&lt;/p&gt;
		&lt;p class=&quot;text&quot;&gt;テキストテキストテキストテキストテキストテキストテキスト&lt;/p&gt;
	&lt;/li&gt;
	&lt;li class=&quot;testBox&quot;&gt;
		&lt;p class=&quot;img&quot;&gt;&lt;img src=&quot;http://placehold.jp/150x150.png&quot;&gt;&lt;/p&gt;
		&lt;p class=&quot;text&quot;&gt;テキストテキストテキストテキストテキスト&lt;/p&gt;
	&lt;/li&gt;
	&lt;li class=&quot;testBox&quot;&gt;
		&lt;p class=&quot;img&quot;&gt;&lt;img src=&quot;http://placehold.jp/150x150.png&quot;&gt;&lt;/p&gt;
		&lt;p class=&quot;text&quot;&gt;テキストテキストテキスト&lt;/p&gt;
	&lt;/li&gt;
	&lt;li class=&quot;testBox&quot;&gt;
		&lt;p class=&quot;img&quot;&gt;&lt;img src=&quot;http://placehold.jp/150x150.png&quot;&gt;&lt;/p&gt;
		&lt;p class=&quot;text&quot;&gt;テキストテキストテキストテキストテキストテキストテキストテキストテキスト&lt;/p&gt;
	&lt;/li&gt;
&lt;/ul&gt;
</pre>
<h3>指定class全てに適用</h3>
<p>使用方法は至って簡単です。<br />
head内にこちらを記述します</p>
<pre class="brush: xml; title: ; notranslate">
&lt;script type=&quot;application/javascript&quot;&gt;
  $(function(){
    $(&quot;.testBox&quot;).tile();
  });
&lt;/script&gt;
</pre>
<p>これで、class .testBoxがついている要素全てが一番高い要素の高さになります。<br />
しかし、これだと具合がわるいこともしばしばです。<br />
なので、グループ分けをすることもできます。</p>
<h3>個数を指定して適用</h3>
<pre class="brush: xml; title: ; notranslate">
&lt;script type=&quot;application/javascript&quot;&gt;
  $(function(){
    $(&quot;.testBox&quot;).tile(4);  
  });
&lt;/script&gt;
</pre>
<p>このように.tile();の()の中に数字をいれることで数字の数ごとで揃わせることができます。<br />
4であるならば、.testBox4つずつ揃うようになります。</p>
<p>テキストのみの場合はこれでOKです。<br />
上記のHTMLのように画像が入っているとなると、多少付け足しが必要になってきます。<br />
画像が入っていると、画像を読み込む前にtile.jsが実行されてしまうからです。<br />
付け足したのがこちらです</p>
<h3>画像を含む場合の記述</h3>
<pre class="brush: xml; title: ; notranslate">
&lt;script type=&quot;application/javascript&quot;&gt;
  $(window).load(function(){
    $(&quot;.testBox&quot;).tile(4);
  });
&lt;/script&gt;
</pre>
<p>$(function～のところを$(window).load(function～とつけたすことで、画像を読み込んでから実行となります。<br />
これで、画像を含んだ場合でも崩れることはなくなります。<br />
簡単な記述で実装でき、とても便利なのでぜひ使用してみてください。それではっ</p>
</div>]]></content:encoded>
			<wfw:commentRss>https://taneppa.net/tilejs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSSの【display table編】プロパティでよく使うものをあつめてみた。(第二回)</title>
		<link>https://taneppa.net/display_other02/</link>
		<comments>https://taneppa.net/display_other02/#comments</comments>
		<pubDate>Tue, 14 Apr 2015 02:51:46 +0000</pubDate>
		<dc:creator>yanoppa!</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[コーディング]]></category>

		<guid isPermaLink="false">https://taneppa.net/?p=2387</guid>
		<description><![CDATA[CSSの【display:table;】とそれに付随する【display:table-cell;】などもあわせて一挙にご紹介します。]]></description>
				<content:encoded><![CDATA[<style><!--
/* clearfix 
----------------------------------------------------------------------*/
.clearfix:after {
	content: " ";
	display: block;
	visibility: hidden;
	height: 0;
	clear: both;
}
/* WinIE7 only */
*:first-child+html .clearfix {
	height: 1%;
}
/* WinIE6 and below */
/* hide \*/
* html .clearfix {
	height: 1%;
}	

.kijiWrap {
  position:relative;
}
.kijiWrap .mokuji {
  position: fixed;
  right: 0;
  bottom: 15%;
}
.kijiWrap .mokuji a{
  display: block;
  padding: 8px;
  background: #9F8666;
  border-radius: 8px;
  box-shadow: 1px 1px 2px #513B1F,inset 1px 1px 2px #C7BA97;
  color: #FFFFFF;
  text-shadow: -1px -1px 1px rgba(68, 56, 46, 1);
  text-decoration: none;
  font-weight: bold;
  line-height: 1;
}
.menuBlock,.kijiBlock {
  padding-top:80px;
}
.kijiWrap .fB {
font-weight:bold;
}
.kijiWrap .tblStyle {
  width:100%;
  border-collapse:collapse;
}
.kijiWrap .tblStyle th,
.kijiWrap .tblStyle td {
  border:1px solid #B06715;
}
--></style>
<div class="kijiWrap" style="line-height: 2;">
<p class="mokuji"><a href="#kijiIndex">目<br />次<br />へ<br />戻<br />る</a></p>
<h2>CSSの<strong>【display】</strong>プロパティでよく使うものをあつめてみた【第二回 table編】</h2>
<p>前回の続きでございます。(´・ω・｀)v</p>
<p>今回は前回でやり残した、tableやinline-table関係を掘り下げてみます。</p>
<p>flexなど掘り下げた<a href="https://taneppa.net/?p=2338" target="_blank">第一回はこちら</a><br /> おなじく目次でページ移動しますのでお気をつけください。</p>
<p>では順番に見て行きましょう！</p>
<div class="menuBlock" id="kijiIndex">
<h3 class="blockTit">もくじ</h3>
<div class="blockMain">
<table class="blockTbl tblStyle">
<thead>
<tr>
<th>値</th>
<th>Internet Explorer</th>
<th>Chrome</th>
<th>Firefox</th>
<th>Safari</th>
<th>Opera</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="https://taneppa.net/display_other01/#none">none<br />(第一回へ移動します)</a></td>
<td>○</td>
<td>○</td>
<td>○</td>
<td>○</td>
<td>○</td>
</tr>
<tr>
<td><a href="https://taneppa.net/display_other01/#block">block<br />(第一回へ移動します)</a></td>
<td>○</td>
<td>○</td>
<td>○</td>
<td>○</td>
<td>○</td>
</tr>
<tr>
<td><a href="https://taneppa.net/display_other01/#inline">inline<br />(第一回へ移動します)</a></td>
<td>○</td>
<td>○</td>
<td>○</td>
<td>○</td>
<td>○</td>
</tr>
<tr>
<td><a href="https://taneppa.net/display_other01/#inline_block">inline-block<br />(第一回へ移動します)</a></td>
<td>8～</td>
<td>○</td>
<td>3～</td>
<td>○</td>
<td>○</td>
</tr>
<tr>
<td><a href="https://taneppa.net/display_other01/#list-item">list-item<br />(第一回へ移動します)</a></td>
<td>6～</td>
<td>○</td>
<td>○</td>
<td>○</td>
<td>○</td>
</tr>
<tr>
<td><a href="https://taneppa.net/display_other01/#flex">flex<br />(第一回へ移動します)</a></td>
<td>×</td>
<td>21～<br /> （ﾍﾞﾝﾀﾞｰﾌﾟﾚﾌｨｯｸｽ）</td>
<td>18～</td>
<td>×</td>
<td>12.50～</td>
</tr>
<tr>
<td>inline-flex</td>
<td>×</td>
<td>21～<br /> （ﾍﾞﾝﾀﾞｰﾌﾟﾚﾌｨｯｸｽ）</td>
<td>18～</td>
<td>×</td>
<td>12.50～</td>
</tr>
<tr>
<td><a href="#table01">table</a></td>
<td>8～</td>
<td>○</td>
<td>○</td>
<td>○</td>
<td>○</td>
</tr>
<tr>
<td><a href="#table02">inline-table</a></td>
<td>8～</td>
<td>○</td>
<td>3～</td>
<td>○</td>
<td>○</td>
</tr>
<tr>
<td>table-header-group</td>
<td>8～</td>
<td>○</td>
<td>○</td>
<td>○</td>
<td>○</td>
</tr>
<tr>
<td>table-row-group</td>
<td>8～</td>
<td>○</td>
<td>○</td>
<td>○</td>
<td>○</td>
</tr>
<tr>
<td>table-footer-group</td>
<td>8～</td>
<td>○</td>
<td>○</td>
<td>○</td>
<td>○</td>
</tr>
<tr>
<td>table-row</td>
<td>8～</td>
<td>○</td>
<td>○</td>
<td>○</td>
<td>○</td>
</tr>
<tr>
<td>table-cell</td>
<td>8～</td>
<td>○</td>
<td>○</td>
<td>○</td>
<td>○</td>
</tr>
<tr>
<td>table-caption</td>
<td>8～</td>
<td>○</td>
<td>○</td>
<td>○</td>
<td>○</td>
</tr>
</tbody></table>
</div>
<!-- / .blockMain --></div>
<!-- / .menuBlock -->
<div class="kijiBlock" id="table01">
<h3>table</h3>
<p>さて、今回はこちら<span class="fB">【display:table;】</span>です<br /> ここでは<span class="fB">【display:table;】</span>とそれに付随する<span class="fB">【display:table-cell;】</span>などもあわせて一挙にご紹介します。</p>
<p>前回での流れ通り、この値を与えると強制的に<span class="fB">table要素のように</span>かわります。<br /> tableとその中のcellをdivなどを使ってつくるのですが、その前にtableの利点を考えてみましょう。<br /> ほぼtableで組まないと出来ないこと、まずはフレキシブルな枠組みですね。<br /> たとえばfloatで3カラムをつくった場合、高さはそれぞれのカラムで違ってしまいますが、tableであれば一番長いカラムに合わせて3カラムが均等な高さにそろいます。<br /> それに、borderの繋ぎ目が簡単ですね。floatだと:first-childやclassをつかってborderが重ならない様にしなければいけませんが、tableだとその手間がありません。<br /> それでは、floatとtableの違いを見てみましょう</p>
<p><span class="fB">例</span></p>
<p>HTML</p>
<pre class="brush: xml; title: ; notranslate">
      &lt;h4 class=&quot;testTit&quot;&gt;floatの場合&lt;/h4&gt;
      &lt;div class=&quot;reiBox clearfix&quot;&gt;
        &lt;div class=&quot;inBox&quot;&gt;&lt;h5 class=&quot;tit&quot;&gt;カラムその１&lt;/h5&gt;&lt;p&gt;テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト&lt;/p&gt;&lt;/div&gt;
        &lt;div class=&quot;inBox&quot;&gt;&lt;h5 class=&quot;tit&quot;&gt;カラムその２&lt;/h5&gt;&lt;p&gt;テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト&lt;/p&gt;&lt;/div&gt;
        &lt;div class=&quot;inBox last&quot;&gt;&lt;h5 class=&quot;tit&quot;&gt;カラムその３&lt;/h5&gt;&lt;p&gt;テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト&lt;/p&gt;&lt;/div&gt;
      &lt;/div&gt;
      &lt;h4 class=&quot;testTit&quot;&gt;tableの場合&lt;/h4&gt;
      &lt;table class=&quot;reiTbl&quot;&gt;
        &lt;tbody&gt;
          &lt;tr&gt;
            &lt;td&gt;&lt;h5 class=&quot;tit&quot;&gt;カラムその１&lt;/h5&gt;&lt;p&gt;テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト&lt;/p&gt;&lt;/td&gt;
            &lt;td&gt;&lt;h5 class=&quot;tit&quot;&gt;カラムその２&lt;/h5&gt;&lt;p&gt;テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト&lt;/p&gt;&lt;/td&gt;
            &lt;td&gt;&lt;h5 class=&quot;tit&quot;&gt;カラムその３&lt;/h5&gt;&lt;p&gt;テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト&lt;/p&gt;&lt;/td&gt;
          &lt;/tr&gt;
        &lt;/tbody&gt;
      &lt;/table&gt;
    </pre><br /><br /><br /><br />
<p>CSS</p>
<pre class="brush: xml; title: ; notranslate">
      &lt;style&gt;
        .testTit {
          text-align:center;
        }
        .reiBox {
          max-width: 600px;
          margin:0 auto;
        }
        .reiBox .inBox {
          float:left;
          max-width:196px;
          border:solid #B06715;
          border-width: 2px 0 2px 2px;
        }
        .reiBox .inBox.last {
          border:2px solid #B06715;
        }
        .reiTbl {
          max-width:600px;
          margin:0 auto;
          border-collapse:collapse;
        }
        .reiTbl td {
          max-width:196px;
          border:2px solid #B06715;
          vertical-align:top;
        }
      &lt;/style&gt;
    </pre><br /><br /><br /><br /><style><!--
.testTit {
        text-align:center;
      }
      .reiBox {
        max-width: 600px;
        margin:0 auto;
      }
      .reiBox .inBox {
        float:left;
        max-width:196px;
        border:solid #B06715;
        border-width: 2px 0 2px 2px;
      }
      .reiBox .inBox.last {
        border:2px solid #B06715;
      }
      .reiTbl {
        max-width:600px;
        margin:0 auto;
        border-collapse:collapse;
      }
      .reiTbl td {
        max-width:196px;
        border:2px solid #B06715;
        vertical-align:top;
      }
--></style>
<h4 class="testTit">floatの場合</h4>
<div class="reiBox clearfix">
<div class="inBox">
<h5 class="tit">カラムその１</h5>
<p>テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト</p>
</div>
<div class="inBox">
<h5 class="tit">カラムその２</h5>
<p>テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト</p>
</div>
<div class="inBox last">
<h5 class="tit">カラムその３</h5>
<p>テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト</p>
</div>
</div>
<h4 class="testTit">tableの場合</h4>
<table class="reiTbl">
<tbody>
<tr>
<td>
<h5 class="tit">カラムその１</h5>
<p>テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト</p></td>
<td>
<h5 class="tit">カラムその２</h5>
<p>テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト</p></td>
<td>
<h5 class="tit">カラムその３</h5>
<p>テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト</p></td>
</tr>
</tbody></table>
<p>tableの利点としてもう一つ、上下の中央揃えが容易にできるようになります。<br /> <span class="fB">vertical-align:middle;</span>がtableのcellに内包されるインライン要素に適応されるからですね。<br /> たとえば、見出しの頭に大きなアイコン画像を置いた状態や、他の見出し文が改行されたときも上下中央基準にしたいときは、vertical-alignを使いたいです。でも、<span class="fB">通常のブロック要素には適応されません。</span><br /> 特性として、<span class="fB">インライン要素とテーブルセルにしか適応されないからです。</span><br /> しかし、このdisplayプロパティを使うことで、通常のブロック要素でも容易に出来るようになります。(*´ω｀*)ﾍﾞﾝﾘ</p>
<p>ですが、ここで注意点<br /> <span class="fB">display:table;は【IE7以下は対応していません】</span><br /> 近年、IE7への対応が減っていきいるとはいえ、まだまだ現役なIE7以下のIEシリーズちゃん達。。。<br /> 対応ブラウザがIE8以上で良いのであればじゃんじゃん使ってよいとおもいます。</p>
<p>では、先ほどのfloatで作った3カラムをそのままtableレイアウトにしてみましょう</p>
</div>
<h4 class="testTit">float組だったモデルをdisplay:table;とdisplay:table-cell;でtable化してみます</h4>
<p>HTML</p>
<pre class="brush: xml; title: ; notranslate">
    &lt;div class=&quot;reiBox02 clearfix&quot;&gt;
        &lt;div class=&quot;inBox&quot;&gt;&lt;h5 class=&quot;tit&quot;&gt;カラムその１&lt;/h5&gt;&lt;p&gt;テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト&lt;/p&gt;&lt;/div&gt;
        &lt;div class=&quot;inBox&quot;&gt;&lt;h5 class=&quot;tit&quot;&gt;カラムその２&lt;/h5&gt;&lt;p&gt;テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト&lt;/p&gt;&lt;/div&gt;
        &lt;div class=&quot;inBox last&quot;&gt;&lt;h5 class=&quot;tit&quot;&gt;カラムその３&lt;/h5&gt;&lt;p&gt;テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト&lt;/p&gt;&lt;/div&gt;
    &lt;/div&gt;
  </pre><br /><br /><br /><br />
<p>CSS</p>
<pre class="brush: xml; title: ; notranslate">
    &lt;style&gt;
        .reiBox02 {
          display:table;
          max-width: 600px;
          margin:0 auto;
          border-collapse:collapse;/* 重複するborderを合体させます */
        }
        .reiBox02 .inBox {
          display:table-cell;
          max-width:196px;
          border:2px solid #B06715;
        }
    &lt;/style&gt;
  </pre><br /><br /><br /><br /><style><!--
.reiBox02 {
        display:table;
        max-width: 600px;
        margin:0 auto;
        border-collapse:collapse;/* 重複するborderを合体させます */
      }
      .reiBox02 .inBox {
        display:table-cell;
        max-width:196px;
        border:2px solid #B06715;
      }
--></style>
<div class="reiBox02 clearfix">
<div class="inBox">
<h5 class="tit">カラムその１</h5>
<p>テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト</p>
</div>
<div class="inBox">
<h5 class="tit">カラムその２</h5>
<p>テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト</p>
</div>
<div class="inBox last">
<h5 class="tit">カラムその３</h5>
<p>テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト</p>
</div>
</div>
<p>このように、tableレイアウトと同じ様になります。<br /> なので、ここにvertical-align:middle;をいれると全体が上下中央揃えになります。</p>
<p>HTML</p>
<pre class="brush: xml; title: ; notranslate">
    &lt;div class=&quot;reiBox02 clearfix&quot;&gt;
        &lt;div class=&quot;inBox middle&quot;&gt;&lt;h5 class=&quot;tit&quot;&gt;カラムその１&lt;/h5&gt;&lt;p&gt;テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト&lt;/p&gt;&lt;/div&gt;
        &lt;div class=&quot;inBox middle&quot;&gt;&lt;h5 class=&quot;tit&quot;&gt;カラムその２&lt;/h5&gt;&lt;p&gt;テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト&lt;/p&gt;&lt;/div&gt;
        &lt;div class=&quot;inBox middle last&quot;&gt;&lt;h5 class=&quot;tit&quot;&gt;カラムその３&lt;/h5&gt;&lt;p&gt;テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト&lt;/p&gt;&lt;/div&gt;
    &lt;/div&gt;
  </pre><br /><br /><br /><br />
<p>CSS</p>
<pre class="brush: xml; title: ; notranslate">
    &lt;style&gt;
        .reiBox02 .inBox.middle {
          vertical-align:middle;
        }
    &lt;/style&gt;
  </pre><br /><br /><br /><br /><style><!--
.reiBox02 .inBox.middle {
        vertical-align:middle;
      }
--></style>
<div class="reiBox02 clearfix">
<div class="inBox middle">
<h5 class="tit">カラムその１</h5>
<p>テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト</p>
</div>
<div class="inBox middle">
<h5 class="tit">カラムその２</h5>
<p>テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト</p>
</div>
<div class="inBox middle last">
<h5 class="tit">カラムその３</h5>
<p>テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト</p>
</div>
</div>
<p>上下中央揃えになりましたね。しかし、下記ようなtableレイアウトも再現することはできますがわざわざする必要がないので、この場合はtableで組むほうがいいと思います。</p>
<p>HTML</p>
<pre class="brush: xml; title: ; notranslate">
    &lt;table class=&quot;reiTbl02&quot;&gt;
      &lt;tr&gt;
        &lt;th&gt;カラムその１&lt;/th&gt;
        &lt;th&gt;カラムその２&lt;/th&gt;
        &lt;th&gt;カラムその３&lt;/th&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト&lt;/td&gt;
        &lt;td&gt;テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト&lt;/td&gt;
        &lt;td&gt;テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt;
  </pre><br /><br /><br /><br />
<p>CSS</p>
<pre class="brush: xml; title: ; notranslate">
    &lt;style&gt;
      .reiTbl02 {
          max-width:600px;
          margin:0 auto;
          border-collapse:collapse;
      }
      .reiTbl02 tr th {
          max-width:196px;
          border:2px solid #B06715;
          vertical-align:middle;
          text-align:center;
      }
      .reiTbl02 tr td {
          border:2px solid #B06715;
          vertical-align:top;
      }
    &lt;/style&gt;
  </pre><br /><br /><br /><br /><style><!--
.reiTbl02 {
        max-width:600px;
        margin:0 auto;
        border-collapse:collapse;
    }
    .reiTbl02 tr th {
        max-width:196px;
        border:2px solid #B06715;
        vertical-align:middle;
        text-align:center;
    }
    .reiTbl02 tr td {
        border:2px solid #B06715;
        vertical-align:top;
    }
--></style>
<table class="reiTbl02">
<tbody>
<tr>
<th>カラムその１</th>
<th>カラムその２</th>
<th>カラムその３</th>
</tr>
<tr>
<td>テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト</td>
<td>テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト</td>
<td>テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト</td>
</tr>
</tbody></table>
<p>display:table;で簡易再現</p>
<p>HTML</p>
<pre class="brush: xml; title: ; notranslate">
      &lt;div class=&quot;reiBox03&quot;&gt;
      	&lt;div class=&quot;reiBox03_1&quot;&gt;
      	  &lt;h5 class=&quot;tit&quot;&gt;カラムその１&lt;/h5&gt;
      	  &lt;h5 class=&quot;tit&quot;&gt;カラムその２&lt;/h5&gt;
      	  &lt;h5 class=&quot;tit&quot;&gt;カラムその３&lt;/h5&gt;
      	&lt;/div&gt;
      	&lt;div class=&quot;reiBox03_2&quot;&gt;
      	  &lt;p class=&quot;txt&quot;&gt;テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト&lt;/p&gt;
      	  &lt;p class=&quot;txt&quot;&gt;テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト&lt;/p&gt;
      	  &lt;p class=&quot;txt&quot;&gt;テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト&lt;/p&gt;
      	&lt;/div&gt;
      &lt;/div&gt;
    </pre><br /><br /><br /><br />
<p>CSS</p>
<pre class="brush: xml; title: ; notranslate">
      &lt;style&gt;
        .reiBox03 {
          display: table;
          max-width: 600px;
          margin: 0 auto;
          border-collapse: collapse;
        }
        .reiBox03_1 {
          display: table-row; /* いわゆるtrです */
        }
        .reiBox03_1 .tit {
          display: table-cell;
          width: 33.33%;
          border: 2px solid #B06715;
          vertical-align: middle;
          text-align: center;
        }
        .reiBox03_2 {
          display: table-row; /* いわゆるtrです */
        }
        .reiBox03_2 .txt {
          display: table-cell;
          width: 33.33%;
          border: 2px solid #B06715;
        }
      &lt;/style&gt;
    </pre><br /><br /><br /><br /><style><!--
.reiBox03 {
        display: table;
        max-width: 600px;
        margin: 0 auto;
        border-collapse: collapse;
      }
      .reiBox03_1 {
        display: table-row; /* いわゆるtrです */
      }
      .reiBox03_1 .tit {
        display: table-cell;
        width: 33.33%;
        border: 2px solid #B06715;
        vertical-align: middle;
        text-align: center;
      }
      .reiBox03_2 {
        display: table-row; /* いわゆるtrです */
      }
      .reiBox03_2 .txt {
        display: table-cell;
        width: 33.33%;
        border: 2px solid #B06715;
      }
--></style>
<div class="reiBox03">
<div class="reiBox03_1">
<h5 class="tit">カラムその１</h5>
<h5 class="tit">カラムその２</h5>
<h5 class="tit">カラムその３</h5>
</div>
<div class="reiBox03_2">
<p class="txt">テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト</p>
<p class="txt">テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト</p>
<p class="txt">テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト</p>
</div>
</div>
<p>このように、trに該当するボックスを使わなければならないなど、とても面倒になります。<br /> このような場合はtableで組むほうがいいですね！</p>
<p>話は戻りまして、このdisplay:table;をつかって出来る有効な使用例をご紹介します。<br /> 先に言いましたが、見出しなどで高さが変わっても上下中央揃えにしたい場合などはとても有効です。</p>
<p>見出しなどで使える使用例</p>
<p>HTML</p>
<pre class="brush: xml; title: ; notranslate">
      &lt;div class=&quot;reiBox04 clearfix&quot;&gt;
        &lt;div class=&quot;inBox&quot;&gt;&lt;p class=&quot;titImg&quot;&gt;アイコン&lt;/p&gt;&lt;h5 class=&quot;tit&quot;&gt;見出し０１&lt;/h5&gt;&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class=&quot;reiBox04 clearfix&quot;&gt;
        &lt;div class=&quot;inBox&quot;&gt;&lt;p class=&quot;titImg02&quot;&gt;アイコン&lt;/p&gt;&lt;h5 class=&quot;tit&quot;&gt;見出しその２&lt;/h5&gt;&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class=&quot;reiBox04 clearfix&quot;&gt;
        &lt;div class=&quot;inBox&quot;&gt;&lt;p class=&quot;titImg&quot;&gt;アイコン&lt;/p&gt;&lt;h5 class=&quot;tit&quot;&gt;見出しその３&lt;br&gt;見出しその３見出しその３&lt;br&gt;見出しその３見出しその３見出しその３&lt;/h5&gt;&lt;/div&gt;
      &lt;/div&gt;
    </pre><br /><br /><br /><br />
<p>CSS</p>
<pre class="brush: xml; title: ; notranslate">
      &lt;style&gt;
        .reiBox04 {
          margin-bottom:10px;
        }
        .reiBox04 .inBox {
          display:table;
          vertical-align:middle;
        }
        .reiBox04 .inBox .titImg {
          display:table-cell;
          max-width:50px;
          height:50px;
          background:#C1FFE9;
          vertical-align: middle;
          text-align:center;
          font-size:12px;
        }
        .reiBox04 .inBox .titImg02 {
          display:table-cell;
          max-width:100px;
          height:100px;
          background:#C1FFE9;
          vertical-align: middle;
          text-align:center;
          font-size:12px;
        }
        .reiBox04 .inBox .tit {
          display:table-cell;
          padding-left:10px;
          vertical-align: middle;
          font-size:16px;
        }
      &lt;/style&gt;
    </pre><br /><br /><br /><br /><style><!--
.reiBox04 {
        margin-bottom:10px;
      }
      .reiBox04 .inBox {
        display:table;
        vertical-align:middle;
      }
      .reiBox04 .inBox .titImg {
        display:table-cell;
        max-width:50px;
        height:50px;
        background:#C1FFE9;
        vertical-align: middle;
        text-align:center;
        font-size:12px;
      }
      .reiBox04 .inBox .titImg02 {
        display:table-cell;
        max-width:100px;
        height:100px;
        background:#C1FFE9;
        vertical-align: middle;
        text-align:center;
        font-size:12px;
      }
      .reiBox04 .inBox .tit {
        display:table-cell;
        padding-left:10px;
        vertical-align: middle;
        font-size:16px;
      }
--></style>
<div class="reiBox04 clearfix">
<div class="inBox">
<p class="titImg">アイコン</p>
<h5 class="tit">見出し０１</h5>
</div>
</div>
<div class="reiBox04 clearfix">
<div class="inBox">
<p class="titImg02">アイコン</p>
<h5 class="tit">見出しその２</h5>
</div>
</div>
<div class="reiBox04 clearfix">
<div class="inBox">
<p class="titImg">アイコン</p>
<h5 class="tit">見出しその３<br />見出しその３見出しその３<br />見出しその３見出しその３見出しその３</h5>
</div>
</div>
<p>見出し０２はアイコンが大きくなった場合、見出し０３は見出し文が改行されて縦に伸びた場合を想定しています。<br /> アイコンの文字が画像の場合同じように中央にいきます。</p>
<p>あまりなさそうで結構あるケースですので、覚えておくと役に立ちます！(´・ω・｀)ｂ<br /> 注意点は、親要素にdisplay:table;を入れ、子要素にdisplay:table-cell;のみを設定した場合、table:cell;は全て横並びになってしまうことです。<br /> テーブルでいうとtrがひとつしか無い状態になるので、その仕組さえわかれば大丈夫とおもいます。<br /> グループ分けはこの後ご説明いたします。</p>
<div class="kijiBlock" id="table02">
<h3>inline-table</h3>
<p>次はinline-tableです。<br /> その名の通り、文章の文節と同じよう行内での扱いとなるtable要素が生成されます。<br /> display:inline-block;のtable版ですね。</p>
<p>それでは少し例を作ってみます。</p>
<p>例</p>
<p>HTML</p>
<pre class="brush: xml; title: ; notranslate">
      &lt;div class=&quot;reiBox05&quot;&gt;
        あいうえお
        &lt;table class=&quot;reiTbl03&quot;&gt;
          &lt;tr&gt;
            &lt;td&gt;か&lt;/td&gt;
            &lt;td&gt;き&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
            &lt;td&gt;く&lt;/td&gt;
            &lt;td&gt;け&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
            &lt;td colspan=&quot;2&quot;&gt;こ&lt;/td&gt;
          &lt;/tr&gt;
        &lt;/table&gt;
        さしすせそ
      &lt;/div&gt;
      &lt;div class=&quot;reiBox05_2&quot;&gt;
        ほかにも&lt;p class=&quot;txt&quot;&gt;
        &lt;span class=&quot;frame&quot;&gt;こ&lt;br&gt;ん&lt;/span&gt;
        &lt;span class=&quot;frame&quot;&gt;な&lt;br&gt;こ&lt;/span&gt;
        &lt;span class=&quot;frame&quot;&gt;と&lt;br&gt;も&lt;/span&gt;
        &lt;span class=&quot;frame&quot;&gt;で&lt;br&gt;き&lt;/span&gt;
        &lt;span class=&quot;frame&quot;&gt;ま&lt;br&gt;す&lt;/span&gt;&lt;/p&gt;
      &lt;/div&gt;
    </pre><br /><br /><br /><br />
<p>CSS</p>
<pre class="brush: xml; title: ; notranslate">
      &lt;style&gt;
        .reiBox05 {
        }
        .reiBox05 .reiTbl03 {
          display:inline-table;
          max-width:100px;
          border-collapse:collapse;
        }
        .reiBox05 .reiTbl03 td{
          border:1px solid #B06715;
          text-align:center;
        }
        .reiBox05_2 {
        }
        .reiBox05_2 .txt {
          display:inline-table;
          border-collapse:separate;
          border-spacing:15px;
        }
        .reiBox05_2 .txt .frame {
          display:table-cell;
          padding:2px;
          border:1px solid #B06715;
          font-weight:bold;
        }
      &lt;/style&gt;
    </pre><br /><br /><br /><br /><style><!--
.reiBox05 {
      }
      .reiBox05 .reiTbl03 {
        display:inline-table;
        max-width:100px;
        border-collapse:collapse;
      }
      .reiBox05 .reiTbl03 td{
        border:1px solid #B06715;
        text-align:center;
      }
      .reiBox05_2 {
      }
      .reiBox05_2 .txt {
        display:inline-table;
        border-collapse:separate;
        border-spacing:15px;
      }
      .reiBox05_2 .txt .frame {
        display:table-cell;
        padding:2px;
        border:1px solid #B06715;
        font-weight:bold;
      }
--></style>
<div class="reiBox05">あいうえお
<table class="reiTbl03">
<tbody>
<tr>
<td>か</td>
<td>き</td>
</tr>
<tr>
<td>く</td>
<td>け</td>
</tr>
<tr>
<td colspan="2">こ</td>
</tr>
</tbody></table>
さしすせそ</div>
<div class="reiBox05_2">ほかにも
<p class="txt"><span class="frame">こ<br />ん</span> <span class="frame">な<br />こ</span> <span class="frame">と<br />も</span> <span class="frame">で<br />き</span> <span class="frame">ま<br />す</span></p>
</div>
<p>使い方はその都度の案件のケースに合わせてですが、inlineとしてtableを扱うことができる。<br /> という程度の認識で良いと思います。</p>
</div>
<div class="kijiBlock" id="table03">
<h3>table-header-groupその他</h3>
<p>ここまでするケースはまず無いのですが、tableを使わずにtableとほぼ同じ挙動のものを作ることが出来ます。<br /> しかし、colspanなどが使用できないので、実用性はないです。 なのでこのへんは、知識としてちょっと知っておくくらいで良いと思います。</p>
<p>値表</p>
<table class="tblStyle">
<tbody>
<tr>
<th>table</th>
<td>table要素と同じ挙動に変更する</td>
</tr>
<tr>
<th>table-caption</th>
<td>caption要素と同じ挙動に変更する</td>
</tr>
<tr>
<th>table-header-group</th>
<td>thead要素と同じ挙動に変更する</td>
</tr>
<tr>
<th>table-row-group</th>
<td>tbody要素と同じ挙動に変更する</td>
</tr>
<tr>
<th>table-footer-group</th>
<td>tfoot要素と同じ挙動に変更する</td>
</tr>
<tr>
<th>table-row</th>
<td>tr要素と同じ挙動に変更する</td>
</tr>
<tr>
<th>table-cell</th>
<td>th要素、td要素と同じ挙動に変更する</td>
</tr>
</tbody></table>
<p>使うであろうものはこのくらいです。<br /> それではdivを使ってモデルをつくってみます。<br /> こちらのソースを参照していただくと、なんとなく構造のつくりがわかると思います。<br /> theadやtbodyってなんだっけ？というかたはtableの基本をもう一度見なおしてみましょう。</p>
<p>HTML</p>
<pre class="brush: xml; title: ; notranslate">
      &lt;div class=&quot;reiBox06&quot;&gt;
        &lt;div class=&quot;caption&quot;&gt;キャプションです&lt;/div&gt;
        &lt;div class=&quot;thead&quot;&gt;
          &lt;div class=&quot;headerBox&quot;&gt;
            &lt;h4 class=&quot;tit&quot;&gt;タイトル01&lt;/h4&gt;
            &lt;h4 class=&quot;tit&quot;&gt;タイトル02&lt;/h4&gt;
            &lt;h4 class=&quot;tit&quot;&gt;タイトル03&lt;/h4&gt;
            &lt;h4 class=&quot;tit&quot;&gt;タイトル04&lt;/h4&gt;
            &lt;h4 class=&quot;tit&quot;&gt;タイトル05&lt;/h4&gt;
          &lt;/div&gt;
        &lt;/div&gt;&lt;!-- / .thead --&gt;
        &lt;div class=&quot;tbody&quot;&gt;
          &lt;div class=&quot;txtBox&quot;&gt;
            &lt;p class=&quot;txt&quot;&gt;テキストテキストテキストテキストテキストテキストテキストテキストテキスト&lt;/p&gt;
            &lt;p class=&quot;txt&quot;&gt;テキストテキストテキストテキストテキストテキストテキストテキストテキスト&lt;/p&gt;
            &lt;p class=&quot;txt&quot;&gt;テキストテキストテキストテキストテキストテキストテキストテキストテキスト&lt;/p&gt;
            &lt;p class=&quot;txt&quot;&gt;テキストテキストテキストテキストテキストテキストテキストテキストテキスト&lt;/p&gt;
            &lt;p class=&quot;txt&quot;&gt;テキストテキストテキストテキストテキストテキストテキストテキストテキスト&lt;/p&gt;
          &lt;/div&gt;
          &lt;div class=&quot;txtBox&quot;&gt;
            &lt;p class=&quot;txt&quot;&gt;テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト&lt;/p&gt;
            &lt;p class=&quot;txt&quot;&gt;テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト&lt;/p&gt;
            &lt;p class=&quot;txt&quot;&gt;テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト&lt;/p&gt;
            &lt;p class=&quot;txt&quot;&gt;テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト&lt;/p&gt;
            &lt;p class=&quot;txt&quot;&gt;テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト&lt;/p&gt;
          &lt;/div&gt;
          &lt;div class=&quot;txtBox&quot;&gt;
            &lt;p class=&quot;txt&quot;&gt;テキストテキストテキストテキストテキスト&lt;/p&gt;
            &lt;p class=&quot;txt&quot;&gt;テキストテキストテキストテキストテキスト&lt;/p&gt;
            &lt;p class=&quot;txt&quot;&gt;テキストテキストテキストテキストテキスト&lt;/p&gt;
            &lt;p class=&quot;txt&quot;&gt;テキストテキストテキストテキストテキスト&lt;/p&gt;
            &lt;p class=&quot;txt&quot;&gt;テキストテキストテキストテキストテキスト&lt;/p&gt;
          &lt;/div&gt;
        &lt;/div&gt;&lt;!-- / .tbody --&gt;
        &lt;div class=&quot;tfoot&quot;&gt;
          &lt;div class=&quot;footerBox&quot;&gt;&lt;p class=&quot;txt&quot;&gt;&lt;/p&gt;&lt;p class=&quot;txt&quot;&gt;&lt;/p&gt;&lt;p class=&quot;txt&quot;&gt;フッターになります&lt;/p&gt;&lt;p class=&quot;txt&quot;&gt;&lt;/p&gt;&lt;p class=&quot;txt&quot;&gt;&lt;/p&gt;&lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    </pre><br /><br /><br /><br />
<p>CSS</p>
<pre class="brush: xml; title: ; notranslate">
      &lt;style&gt;
        .reiBox06 {
          display: table;
          border-collapse: collapse;
          max-width: 680px;
          margin: 0 auto;
        }
        
        .reiBox06 .caption {
          display: table-caption;
          padding: 6px 0;
          text-align: center;
          font-size: 18px;
          font-weight: bold;
        }
        
        .reiBox06 .thead {
          display:table-header-group;
        }
  
        .reiBox06 .thead .headerBox {
          display:table-row;
        }
        
        .reiBox06 .thead .headerBox .tit {
          display: table-cell;
          padding: 6px 0;
          border: 1px solid #B06715;
          text-align: center;
        }
        
        .reiBox06 .tbody {
          display:table-row-group;
        }
        
        .reiBox06 .tbody .txtBox {
          display:table-row;
        }
        
        .reiBox06 .tbody .txtBox .txt {
          display:table-cell;
          padding: 8px;
          border:1px solid #B06715;
        }
        
        .reiBox06 .tfoot {
          display:table-footer-group;
        }
        
        .reiBox06 .tfoot .footerBox {
          display:table-row;
          border:1px solid #B06715;
  
        }
        
        .reiBox06 .tfoot .footerBox .txt {
          display:table-cell;
          padding: 6px 0;
        }
      &lt;/style&gt;
    </pre><br /><br /><br /><br /><style><!--
.reiBox06 {
        display: table;
        border-collapse: collapse;
        max-width: 680px;
        margin: 0 auto;
      }
      
      .reiBox06 .caption {
        display: table-caption;
        padding: 6px 0;
        text-align: center;
        font-size: 18px;
        font-weight: bold;
      }
      
      .reiBox06 .thead {
        display:table-header-group;
      }

      .reiBox06 .thead .headerBox {
        display:table-row;
      }
      
      .reiBox06 .thead .headerBox .tit {
        display: table-cell;
        padding: 6px 0;
        border: 1px solid #B06715;
        text-align: center;
      }
      
      .reiBox06 .tbody {
        display:table-row-group;
      }
      
      .reiBox06 .tbody .txtBox {
        display:table-row;
      }
      
      .reiBox06 .tbody .txtBox .txt {
        display:table-cell;
        padding: 8px;
        border:1px solid #B06715;
      }
      
      .reiBox06 .tfoot {
        display:table-footer-group;
      }
      
      .reiBox06 .tfoot .footerBox {
        display:table-row;
        border:1px solid #B06715;

      }
      
      .reiBox06 .tfoot .footerBox .txt {
        display:table-cell;
        padding: 6px 0;
      }
--></style>
<div class="reiBox06">
<div class="caption">キャプションです</div>
<div class="thead">
<div class="headerBox">
<h4 class="tit">タイトル01</h4>
<h4 class="tit">タイトル02</h4>
<h4 class="tit">タイトル03</h4>
<h4 class="tit">タイトル04</h4>
<h4 class="tit">タイトル05</h4>
</div>
</div>
<!-- / .thead -->
<div class="tbody">
<div class="txtBox">
<p class="txt">テキストテキストテキストテキストテキストテキストテキストテキストテキスト</p>
<p class="txt">テキストテキストテキストテキストテキストテキストテキストテキストテキスト</p>
<p class="txt">テキストテキストテキストテキストテキストテキストテキストテキストテキスト</p>
<p class="txt">テキストテキストテキストテキストテキストテキストテキストテキストテキスト</p>
<p class="txt">テキストテキストテキストテキストテキストテキストテキストテキストテキスト</p>
</div>
<div class="txtBox">
<p class="txt">テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト</p>
<p class="txt">テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト</p>
<p class="txt">テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト</p>
<p class="txt">テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト</p>
<p class="txt">テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト</p>
</div>
<div class="txtBox">
<p class="txt">テキストテキストテキストテキストテキスト</p>
<p class="txt">テキストテキストテキストテキストテキスト</p>
<p class="txt">テキストテキストテキストテキストテキスト</p>
<p class="txt">テキストテキストテキストテキストテキスト</p>
<p class="txt">テキストテキストテキストテキストテキスト</p>
</div>
</div>
<!-- / .tbody -->
<div class="tfoot">
<div class="footerBox">
<p class="txt"></p>
<p class="txt"></p>
<p class="txt">フッターになります</p>
<p class="txt"></p>
<p class="txt"></p>
</div>
</div>
</div>
<p>と言った感じで、tableもどきが作れます。<br /> 結合が出来ない（やり方あったら教えて下さい。）ので、実用で使う場面でいうとレスポンシブの時、もともと文章だったものを表にしたり、その逆をしたりといったケースのときでしょうか。<br /> そうそう無いですが、知っているといざというときにさっと対応出来て良いと思います(´・ω・｀)ｂ</p>
<p>これでこのシリーズは終わりです。<br /> おもったより、ボリューミーになりましたが、読んでくださった方に感謝です。<br /> それでは、良きコーディングライフを(´・ω・｀)ﾉｼ</p>
<p><a href="https://taneppa.net/?p=2338" target="_blank">第一回はこちら</a></p>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>https://taneppa.net/display_other02/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSSの【display list-item・flex・その他編】プロパティでよく使うものをあつめてみた(第一回)</title>
		<link>https://taneppa.net/display_other01/</link>
		<comments>https://taneppa.net/display_other01/#comments</comments>
		<pubDate>Sat, 04 Apr 2015 02:50:17 +0000</pubDate>
		<dc:creator>yanoppa!</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[コーディング]]></category>

		<guid isPermaLink="false">https://taneppa.net/?p=2338</guid>
		<description><![CDATA[今回はCSSの display: inline、display: block、display: inline-block をマスターしよう！で紹介していますdisplayプロパティの他の値を掘り下げてみようとおもいます。]]></description>
				<content:encoded><![CDATA[<style><!--
/* clearfix 
----------------------------------------------------------------------*/
.clearfix:after {
	content: " ";
	display: block;
	visibility: hidden;
	height: 0;
	clear: both;
}
/* WinIE7 only */
*:first-child+html .clearfix {
	height: 1%;
}
/* WinIE6 and below */
/* hide \*/
* html .clearfix {
	height: 1%;
}	

.kijiWrap {
  position:relative;
  text-align:left;
}
.kijiWrap .mokuji {
  position: fixed;
  right: 0;
  bottom: 15%;
}
.kijiWrap .mokuji a{
  display: block;
  padding: 8px;
  background: #9F8666;
  border-radius: 8px;
  box-shadow: 1px 1px 2px #513B1F,inset 1px 1px 2px #C7BA97;
  color: #FFFFFF;
  text-shadow: -1px -1px 1px rgba(68, 56, 46, 1);
  text-decoration: none;
  font-weight: bold;
  line-height: 1;
}
.kijiWrap h3 {
  font-size:18px;
  font-weight:bold;
}
.menuBlock,.kijiBlock {
  padding-top:80px;
}
.kijiWrap .fB {
font-weight:bold;
}
.menuBlock .blockTbl,.kijiBlock .flexTbl {
  width:100%;
  border-collapse:collapse;
}
.menuBlock .blockTbl th,
.menuBlock .blockTbl td,
.kijiBlock .flexTbl th,
.kijiBlock .flexTbl td {
  border:1px solid #B06715;
}
--></style>
<div class="kijiWrap" style="line-height: 2;">
<p class="mokuji"><a href="#kijiIndex">目<br />次<br />へ<br />戻<br />る</a></p>
<h2>CSSの<strong>【display】</strong>プロパティでよく使うものをあつめてみた。【第一回 list-item・flex・その他編】</h2>
<p>みなさま、お久しぶりでございます。やのっぱでございます(´・ω・｀)ﾌﾞﾋｰ</p>
<p>今回は<a href="https://taneppa.net/display-inline-block/" target="_blank">CSSの display: inline、display: block、display: inline-block をマスターしよう！</a>で紹介しています<span class="fB">displayプロパティ</span>の他の値を掘り下げてみようとおもいます。</p>
<p><span class="fB">display</span>はよく<span class="fB">inline</span>や<span class="fB">block</span>,<span class="fB">inline-block</span>,<span class="fB">none</span>を使用しますが、他にもたくさんの値が用意されています。<br /> たくさんありすぎるので、使用しなさそうな<span class="fB">compact、ran-in</span>やテスト段階の<span class="fB">grid</span>などは省いていますが、参考になれば幸いです。</p>
<p>ボリュームが大きくなったので、二回に分けて投稿しました。<br /> <a href="https://taneppa.net/?p=2387" target="_blank">第二回はこちら</a><br /> 目次からも移動できるようにしています。</p>
<p>では順番に見て行きましょう！</p>
<div class="menuBlock" id="kijiIndex">
<h3 class="blockTit">もくじ</h3>
<div class="blockMain">
<table class="blockTbl">
<thead>
<tr>
<th>値</th>
<th>Internet Explorer</th>
<th>Chrome</th>
<th>Firefox</th>
<th>Safari</th>
<th>Opera</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="#none">none</a></td>
<td>○</td>
<td>○</td>
<td>○</td>
<td>○</td>
<td>○</td>
</tr>
<tr>
<td><a href="#block">block</a></td>
<td>○</td>
<td>○</td>
<td>○</td>
<td>○</td>
<td>○</td>
</tr>
<tr>
<td><a href="#inline">inline</a></td>
<td>○</td>
<td>○</td>
<td>○</td>
<td>○</td>
<td>○</td>
</tr>
<tr>
<td><a href="#inline_block">inline-block</a></td>
<td>8～</td>
<td>○</td>
<td>3～</td>
<td>○</td>
<td>○</td>
</tr>
<tr>
<td><a href="#list-item">list-item</a></td>
<td>6～</td>
<td>○</td>
<td>○</td>
<td>○</td>
<td>○</td>
</tr>
<tr>
<td><a href="#flex">flex</a></td>
<td>×</td>
<td>21～<br /> （ﾍﾞﾝﾀﾞｰﾌﾟﾚﾌｨｯｸｽ）</td>
<td>18～</td>
<td>×</td>
<td>12.50～</td>
</tr>
<tr>
<td>inline-flex</td>
<td>×</td>
<td>21～<br /> （ﾍﾞﾝﾀﾞｰﾌﾟﾚﾌｨｯｸｽ）</td>
<td>18～</td>
<td>×</td>
<td>12.50～</td>
</tr>
<tr>
<td><a href="https://taneppa.net/display_other02/#table01">table<br />(第二回へ移動します)</a></td>
<td>8～</td>
<td>○</td>
<td>○</td>
<td>○</td>
<td>○</td>
</tr>
<tr>
<td><a href="https://taneppa.net/display_other02/#table02">inline-table<br />(第二回へ移動します)</a></td>
<td>8～</td>
<td>○</td>
<td>3～</td>
<td>○</td>
<td>○</td>
</tr>
<tr>
<td>table-header-group</td>
<td>8～</td>
<td>○</td>
<td>○</td>
<td>○</td>
<td>○</td>
</tr>
<tr>
<td>table-row-group</td>
<td>8～</td>
<td>○</td>
<td>○</td>
<td>○</td>
<td>○</td>
</tr>
<tr>
<td>table-footer-group</td>
<td>8～</td>
<td>○</td>
<td>○</td>
<td>○</td>
<td>○</td>
</tr>
<tr>
<td>table-row</td>
<td>8～</td>
<td>○</td>
<td>○</td>
<td>○</td>
<td>○</td>
</tr>
<tr>
<td>table-cell</td>
<td>8～</td>
<td>○</td>
<td>○</td>
<td>○</td>
<td>○</td>
</tr>
<tr>
<td>table-caption</td>
<td>8～</td>
<td>○</td>
<td>○</td>
<td>○</td>
<td>○</td>
</tr>
</tbody></table>
</div>
<!-- / .blockMain --></div>
<!-- / .menuBlock -->
<div class="kijiBlock" id="none">
<h3>none</h3>
<p>おなじみの<span class="fB">display:none;</span>です。<br /> この値をあたえると、その要素の表示を非表示にします。<br /> レイアウトからも消えるので、表示上無かったことになります。</p>
<p>注意すべきは、与えた要素の<span class="fB">子要素全てが非表示</span>になることです。</p>
</div>
<div class="kijiBlock" id="block">
<h3>block</h3>
<p>こちらもおなじみの<span class="fB">display:block;</span>です。<br /> この値をあたえると、その要素は<span class="fB">ブロック要素</span>になります。</p>
<p>ブロック要素？なにそれ？おいしいの？っという方はこちら<a href="https://taneppa.net/display-inline-block/" target="_blank">CSSの display: inline、display: block、display: inline-block をマスターしよう！</a>で詳しく説明されてますので、覗いてみてください</p>
<p><span class="fB">例</span></p>
<br />
<p>HTML</p>
<pre class="brush: xml; title: ; notranslate">
    &lt;div class=&quot;test01&quot;&gt;
      &lt;p&gt;ここはインライン&lt;span class=&quot;block&quot;&gt;ここはspanでブロックに変換&lt;/span&gt;ここはインライン&lt;/p&gt;
    &lt;/div&gt;
    </pre><br /><br /><br /><br />
<p>CSS</p>
<pre class="brush: xml; title: ; notranslate">
    &lt;style&gt;
      .test01 .block { display:block;}
    &lt;/style&gt;
    </pre><br /><br /><br /><br /><style><!--
.pressArt .mainPressSect .test01 .block { display:block;}
--></style>
<div class="test01">
<p>ここはインライン<span class="block">ここはspanでブロックに変換</span>ここはインライン</p>
</div>
<br />
<p>このように元々inlineなどの要素を強制的にblockに変えることができます。<br /> ブロック要素なので、paddingの上下やheightが有効になってきます。<br /> よく使うのはaタグに<span class="fB">display:block;</span>を与えて、CSSでボタンをつくったりですね。</p>
<p>こんな感じです。</p>
<br />
<p>HTML</p>
<pre class="brush: xml; title: ; notranslate">
      &lt;p class=&quot;testBtn&quot;&gt;&lt;a href=&quot;#&quot;&gt;aタグでボタン&lt;/a&gt;&lt;/p&gt;
    </pre><br /><br /><br /><br />
<p>CSS</p>
<pre class="brush: xml; title: ; notranslate">
      &lt;style&gt;
      .testBtn a {
        display: block;
        max-width: 200px;
        padding: 10px;
        margin: 0 auto;
        background: #EC9608;
        border-radius: 4px;
        box-shadow: inset -2px -2px 2px #A26400, 1px 1px 2px #FFE6CC;
        text-align: center;
        text-decoration: none;
        font-size: 20px;
        font-weight: bold;
        color: #FFFFFF;
        text-shadow: -1px -1px #A07F1C;
        }
      .testBtn a:hover {
        box-shadow: inset 2px 2px 2px #A26400,1px 1px 3px #F9F0DA;
        background: #A07F1C;
        }
    &lt;/style&gt;
    </pre><br /><br /><br /><br /><style><!--
.pressArt .mainPressSect .testBtn a {
        display: block;
        max-width: 200px;
        padding: 10px;
        margin: 0 auto;
        background: #EC9608;
        border-radius: 4px;
        box-shadow: inset -2px -2px 2px #A26400, 1px 1px 2px #FFE6CC;
        text-align: center;
        text-decoration: none;
        font-size: 20px;
        font-weight: bold;
        color: #FFFFFF;
        text-shadow: -1px -1px #A07F1C;
        }
      .pressArt .mainPressSect .testBtn a:hover {
        box-shadow: inset 2px 2px 2px #A26400,1px 1px 3px #F9F0DA;
        background: #A07F1C;
        }
--></style>
<p class="testBtn"><a href="#">aタグでボタン</a></p>
</div>
<div class="kijiBlock" id="inline">
<h3>inline</h3>
<p>まいどおなじみの<span class="fB">display:inline;</span>さんです<br /> この値を与えると、強制的に<span class="fB">インライン要素</span>になります。<br /> こちらもなんぞや？っという方はこちら<a href="https://taneppa.net/display-inline-block/" target="_blank">CSSの display: inline、display: block、display: inline-block をマスターしよう！</a>で確認してみてください。</p>
<p>こちらはよくリストの横並びなど、連続するブロック要素を横に並べるときなどに使用しています。<br /> また、text-alignでブロック要素を左・右・中央に寄せる時などでも使用します。</p>
<p>注意なのは、inlineの場合<span class="fB">改行が半角の空白として認識されるため</span>(inlineは文章の文字扱いのため)、改行があると要素間に隙間ができることです。<br /> 解消法は改行をなくすか、要素と要素の間にコメントアウトを入れてあげると解消します。</p>
<p><span class="fB">例</span></p>
<br />
<p>HTML</p>
<pre class="brush: xml; title: ; notranslate">
    &lt;div class=&quot;test02&quot;&gt;
      &lt;p&gt;改行あり&lt;/p&gt;
      &lt;ul class=&quot;testList&quot;&gt;
        &lt;li&gt;リスト1&lt;/li&gt;
        &lt;li&gt;リスト2&lt;/li&gt;
        &lt;li&gt;リスト3&lt;/li&gt;
        &lt;li&gt;リスト4&lt;/li&gt;
        &lt;li&gt;リスト5&lt;/li&gt;
      &lt;/ul&gt;
      &lt;p&gt;改行なし&lt;/p&gt;
      &lt;ul class=&quot;testList&quot;&gt;
        &lt;li&gt;リスト1&lt;/li&gt;&lt;li&gt;リスト2&lt;/li&gt;&lt;li&gt;リスト3&lt;/li&gt;&lt;li&gt;リスト4&lt;/li&gt;&lt;li&gt;リスト5&lt;/li&gt;
      &lt;/ul&gt;
      &lt;p&gt;コメントアウト法&lt;/p&gt;
      &lt;ul class=&quot;testList&quot;&gt;
        &lt;li&gt;リスト1&lt;/li&gt;&lt;!--
     --&gt;&lt;li&gt;リスト2&lt;/li&gt;&lt;!--
     --&gt;&lt;li&gt;リスト3&lt;/li&gt;&lt;!--
     --&gt;&lt;li&gt;リスト4&lt;/li&gt;&lt;!--
     --&gt;&lt;li&gt;リスト5&lt;/li&gt;
      &lt;/ul&gt;
    &lt;/div&gt;
    </pre><br /><br /><br /><br />
<p>CSS</p>
<pre class="brush: xml; title: ; notranslate">
    &lt;style&gt;
      .test02 .testList li { 
        display:inline;
        border: 1px solid #FF9B00;
        padding: 8px;
        }
    &lt;/style&gt;
    </pre><br /><br /><br /><br /><style><!--
.pressArt .mainPressSect .test02 .testList li {
        display:inline;
        border: 1px solid #FF9B00;
        padding: 8px;
        background:none;
        }
--></style>
<div class="test02">
<p>改行あり</p>
<ul class="testList">
	<li>リスト1</li>
	<li>リスト2</li>
	<li>リスト3</li>
	<li>リスト4</li>
	<li>リスト5</li>
</ul>
<p>改行なし</p>
<ul class="testList">
	<li>リスト1</li><li>リスト2</li><li>リスト3</li><li>リスト4</li><li>リスト5</li>
</ul>
<p>コメントアウト法</p>
<ul class="testList">
	<li>リスト1</li><!--
     --><li>リスト2</li><!--
     --><li>リスト3</li><!--
     --><li>リスト4</li><!--
     --><li>リスト5</li>
</ul>
</div>
</div>
<div class="kijiBlock" id="inline_block">
<h3>inline-block</h3>
<p>個人的によく使用する<span class="fB">display:inline-block;</span>さんです<br /> この値を与えると<span class="fB">インラインだけどブロックな要素</span>になります。<br /> 詳しくはこちら<a href="https://taneppa.net/display-inline-block/" target="_blank">CSSの display: inline、display: block、display: inline-block をマスターしよう！</a>に記載されていますが、イメージとしてはimgタグのような挙動をします。<br /> ブロック要素と同じプロパティが適応されるinline要素です。<br /> たとえば、inlineにwidthやheight、上下のmarginなどが適応されませんが（ブロック、いわゆる箱として機能しないから）、inline-blockならばそれらが適応されます。</p>
<p>利点としてはinline扱いのblockなので、text-alignが適応される点などあります。<br /> また、先のinlineのように横並びになりますが<span class="fB">改行＝半角スペース</span>なので、隙間に注意が必要です。</p>
<p>使用時注意して頂きたいのは、IE7以下では使えません、ので下記の例にあるIE7ハックをセットで使用することをオススメします。</p>
<p>では、例をあげてみます。<br /> 今回は、全体を右寄せ、中のメニューは左揃えの形をdisplay:inline-block;をつかってつくってみます。</p>
<p><span class="fB">例</span></p>
<br />
<p>HTML</p>
<pre class="brush: xml; title: ; notranslate">
      &lt;div class=&quot;test03&quot;&gt;
        &lt;ul class=&quot;testList&quot;&gt;
          &lt;li&gt;メニュー01&lt;/li&gt;&lt;li&gt;メニュー02&lt;/li&gt;&lt;li&gt;メニュー03&lt;/li&gt;&lt;li&gt;メニュー04&lt;/li&gt;&lt;li&gt;メニュー05&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
    </pre><br /><br /><br /><br />
<p>CSS</p>
<pre class="brush: xml; title: ; notranslate">
      &lt;style&gt;
        .test03 { 
          max-width:700px;
          margin:0 auto; 
          border:2px solid #B06715; 
          text-align:right;
          }
        .test03 .testList {
          display:inline-block; 
          max-width:500px;
          background:#E7F0D4;
          text-align:left;
          }
        .test03 .testList li {
          display:inline-block;
         *display:inline; /* IE7ハック */
         *zoom:1; /* IE7ハック この２つがないとIE7では縦並びになってしまいます */
          max-width: 80px; 
          margin: 0 0 0 10px;
          background: #FFF5EC;
          text-decoration: underline; 
          text-align:center;
          }
       &lt;/style&gt;
    </pre><br /><br /><br /><br /><style><!--
.pressArt .mainPressSect .test03 { 
      max-width:700px;
      margin:0 auto; 
      border:2px solid #B06715; 
      text-align:right;
      }
    .pressArt .mainPressSect .test03 .testList {
      display:inline-block; 
      max-width:500px;
      background:#E7F0D4;
      text-align:left;
      }
    .pressArt .mainPressSect .test03 .testList li {
      display:inline-block;
     *display:inline; /* IE7ハック */
     *zoom:1; /* IE7ハック この２つがないとIE7では縦並びになってしまいます */
      max-width: 80px; 
      margin: 0 0 0 10px;
      padding:0;
      background: #FFF5EC;
      text-decoration: underline; 
      text-align:center;
      }
--></style>
<div class="test03">
<ul class="testList">
	<li>メニュー01</li>
	<li>メニュー02</li>
	<li>メニュー03</li>
	<li>メニュー04</li>
	<li>メニュー05</li>
</ul>
</div>
</div>
<div class="kijiBlock" id="list-item">
<h3>list-item</h3>
<p>未だ実際に使うことがまったくない<span class="fB">display:list-item;</span>さんです<br /> この値を与えると、liと同じ挙動になります。<br /> list-styleが適用され、リスト項目として使うことができます。<br /> 使い所はよくわかりませんが、javaScriptで一定条件下ではリストとして扱うといったときに使えるかもしれません。<br /> 今回はpタグの文章の途中を<span class="fB">インライン要素【span】</span>で囲って、リスト化してみたいとおもいます。</p>
<p>例</p>
<br />
<p>HTML</p>
<pre class="brush: xml; title: ; notranslate">
        &lt;div class=&quot;test04&quot;&gt;
          &lt;p class=&quot;testTxt&quot;&gt;普通のテキスト普通のテキスト普通のテキスト普通のテキスト&lt;span class=&quot;testList&quot;&gt;無理やりリスト化&lt;/span&gt;&lt;span class=&quot;testList&quot;&gt;無理やりリスト化&lt;/span&gt;&lt;span class=&quot;testList&quot;&gt;無理やりリスト化&lt;/span&gt;&lt;span class=&quot;testList&quot;&gt;無理やりリスト化&lt;/span&gt;普通のテキスト普通のテキスト普通のテキスト普通のテキスト普通のテキスト普通のテキスト普通のテキスト普通のテキスト&lt;/p&gt;
        &lt;/div&gt;
      </pre><br /><br /><br /><br />
<p>CSS</p>
<pre class="brush: xml; title: ; notranslate">
        &lt;style&gt;
          .test04 {
            max-width: 580px;
            padding:10px;
            border:2px solid #B06715;
          }
          .test04 .testTxt .testList {
            display:list-item;
            margin-left:2em;
          }
        &lt;/style&gt;
      </pre><br /><br /><br /><br /><style><!--
.pressArt .mainPressSect .test04 {
          max-width: 580px;
          padding:10px;
          border:2px solid #B06715;
        }
        .pressArt .mainPressSect .test04 .testTxt .testList {
          display:list-item;
          margin-left:2em;
        }
--></style>
<div class="test04">
<p class="testTxt">普通のテキスト普通のテキスト普通のテキスト普通のテキスト<span class="testList">無理やりリスト化</span><span class="testList">無理やりリスト化</span><span class="testList">無理やりリスト化</span><span class="testList">無理やりリスト化</span>普通のテキスト普通のテキスト普通のテキスト普通のテキスト普通のテキスト普通のテキスト普通のテキスト普通のテキスト</p>
</div>
<p>このような感じで、強制的にリスト項目として使うことができます。<br /> しかし、リストは文章構造的にulで組むのが良いので、特に理由がなければulでちゃんと作ることをおすすめします(´・ω・｀)ｂ</p>
</div>
<div class="kijiBlock" id="flex">
<h3>display:flex; or display:inline-flex;</h3>
<p>さて、長くなってきましたがdisplay:flex;をご説明します。<br /> これは、要素をフレキシブルなモデルに変えるという画期的なプロパティです。</p>
<p>まだ現在草案なので、仕様が変更されたり、ベンダープレフィックスが必要と色々面倒ですが、おもしろいので是非使ってみていただきたいです。<br /> さて、いやゆるフレックスボックスは専用のプロパティや値が多いので、まずはそこからざっと見て行きましょう。</p>
<table class="flexTbl">
<thead>
<tr>
<th>プロパティ</th>
<th>値</th>
<th>効果</th>
</tr>
</thead>
<tbody>
<tr>
<th>display</th>
<td>flex<br />inline-flex</td>
<td>Flexboxコンテナーを定義します。inline-flexはinline-blockと同じようにインラインボックスとして定義されます。</td>
</tr>
<tr>
<th rowspan="4">flex-direction<br />子要素の配置の指定</th>
<td>row</td>
<td>子要素を左から右へ配置する値です。基本HTMLの書いた順に並びます。（初期値）</td>
</tr>
<tr>
<td>column</td>
<td>子要素を上から下へ配置する値です。同じく書いた順に並びます。</td>
</tr>
<tr>
<td>row-reverse</td>
<td>子要素を右から左へ配置する値です。rowの逆になります。</td>
</tr>
<tr>
<td>column-reverse</td>
<td>子要素を下から上へ配置する値です。columnの逆になります。</td>
</tr>
<tr>
<th rowspan="3">flex-wrap<br />折り返し方の指定</th>
<td>nowrap</td>
<td>折り返しなし（初期値）</td>
</tr>
<tr>
<td>wrap</td>
<td>折り返しあり floatの時のように下に落ちます</td>
</tr>
<tr>
<td>wrap-reverse</td>
<td>折り返しあり 折り返し地点が逆になります。</td>
</tr>
<tr>
<th>flex-flow<br />まとめて記述</th>
<td>例 row wrap</td>
<td>flex-directionとflex-wrapの値をまとめて記述できます。</td>
</tr>
<tr>
<th rowspan="5">justify-content<br />水平方向の揃えの指定</th>
<td>flex-start</td>
<td>横方向は左、縦方向は上に揃えます。</td>
</tr>
<tr>
<td>flex-end</td>
<td>横方向は右、縦方向は下に揃えます。</td>
</tr>
<tr>
<td>center</td>
<td>中央揃えです</td>
</tr>
<tr>
<td>space-between</td>
<td>均等間隔です。</td>
</tr>
<tr>
<td>space-around</td>
<td>左右の端にも間隔がある均等間隔です</td>
</tr>
<tr>
<th rowspan="5">align-items<br />垂直方向の揃えの指定</th>
<td>flex-start</td>
<td>横配置の場合は上、縦配置の場合は左に揃えます。</td>
</tr>
<tr>
<td>flex-end</td>
<td>横配置の場合は下、縦配置の場合は右に揃えます。</td>
</tr>
<tr>
<td>center</td>
<td>中央揃えです</td>
</tr>
<tr>
<td>baseline</td>
<td>ベースラインです</td>
</tr>
<tr>
<td>stretch</td>
<td>自動で高さを合わせます</td>
</tr>
<tr>
<th rowspan="5">align-content<br />複数行の揃え方の指定</th>
<td>flex-start</td>
<td>複数行になったとき、横方向は上、縦方向は左</td>
</tr>
<tr>
<td>flex-end</td>
<td>複数行になったとき、横方向は下、縦方向は右</td>
</tr>
<tr>
<td>center</td>
<td>中央揃えです</td>
</tr>
<tr>
<td>space-between</td>
<td>均等間隔です</td>
</tr>
<tr>
<td>space-around</td>
<td>上下端にも間隔がある均等揃えです</td>
</tr>
<tr>
<th rowspan="4">flex<br />伸縮性の指定</th>
<td>flex-grow</td>
<td>伸びの倍率、余ったスペースをこのプロパティの値に従って自動的に埋めます</td>
</tr>
<tr>
<td>flex-shrink</td>
<td>縮みの倍率、コンテナに入りきらないアイテムを収まるように収縮する</td>
</tr>
<tr>
<td>flex-basis</td>
<td>元の長さを指定します。min-widthのような感じです。</td>
</tr>
<tr>
<td>補足</td>
<td>flexはflex: 1 1 auto;のように flex-grow flex-shrink flex-basisの順にまとめて記述できます</td>
</tr>
<tr>
<th>align-self<br />垂直方向の揃えを個別指定</th>
<td>align-itemsと同じ</td>
<td>align-itemsと同じですが、全体ではなく個別の指定となります。</td>
</tr>
<tr>
<th>order<br />順番の指定</th>
<td>数字</td>
<td>初期値は連番ですが、それを指定することで順番をかえることができます。</td>
</tr>
</tbody></table>
<p>こんな感じです。<br /> たくさん増えましたがそんなに難しくはないとおもいます。</p>
<p>基本は親要素にdisplay:flex;をあたえることで子要素がflexアイテムとして扱われます。<br /> あとは各プロパティをあたえることで、子要素がフレキシブルなBOXになっていきます。</p>
<p>それでは、実際に作っていきますが、ブログ自体が幅を固定されているのでご自身で色々試していただいて掴んでいただければとおもいます(´・ω・｀)ｂ</p>
<p>基本形（リスト横並び）</p>
<p>HTML</p>
<pre class="brush: xml; title: ; notranslate">
      &lt;div class=&quot;reiBox01&quot;&gt;
        &lt;ul class=&quot;boxList&quot;&gt;
          &lt;li&gt;1&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;2&lt;/li&gt;
          &lt;li&gt;3&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;4&lt;/li&gt;
          &lt;li&gt;5&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;6&lt;/li&gt;
          &lt;li&gt;7&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
    </pre><br /><br /><br /><br />
<p>CSS</p>
<pre class="brush: xml; title: ; notranslate">
      &lt;style&gt;
        .reiBox01 {
          max-width: 700px;
          padding: 10px;
          margin: 0 auto 10px;
          border: 1px solid #903813;
        }
        .reiBox01 .boxList {
          display: -webkit-flex;
          display: -moz-flex;
          display: -ms-flex;
          display: -o-flex;
          display: flex;
          padding:10px 0;
          background:#FFF4D1;
        }
        .reiBox01 .boxList li {
          flex: 1 0 60px;
          min-height: 40px;
          padding-top: 10px;
          background: #C5FEDD;
          list-style: none;
          font-size: 30px;
          text-align: center;
          line-height: 1;
        }
        .reiBox01 .boxList li.even {
          background:#F6D990;
        }
      &lt;/style&gt;
    </pre><br /><br /><br /><br /><style><!--
.pressArt .mainPressSect .reiBox01 {
        max-width: 700px;
        padding: 10px;
        margin: 0 auto 10px;
        border: 1px solid #903813;
      }
      .pressArt .mainPressSect .reiBox01 .boxList {
        display: -webkit-flex;
        display: -moz-flex;
        display: -ms-flex;
        display: -o-flex;
        display: flex;
        padding:10px 0;
        background:#FFF4D1;
      }
      .pressArt .mainPressSect .reiBox01 .boxList li {
        flex: 1 0 60px;
        min-height: 40px;
        padding: 10px 0 0;
        background: #C5FEDD;
        list-style: none;
        font-size: 30px;
        text-align: center;
        line-height: 1;
      }
      .pressArt .mainPressSect .reiBox01 .boxList li.even {
        background:#F6D990;
      }
--></style>
<div class="reiBox01">
<ul class="boxList">
	<li>1</li>
	<li class="even">2</li>
	<li>3</li>
	<li class="even">4</li>
	<li>5</li>
	<li class="even">6</li>
	<li>7</li>
</ul>
</div>
<p>固定されているとおもいますので、ブラウザの開発者ツールなどで、reiBox01のwidthを変えてみてください。(ブログ改修前に投稿しています)<br /> デフォルトは折り返し無しなのでどんなに縮めてもはみ出ないようflexを設定しています。</p>
<p>それでは、少しずつ変えていきます。<br /> まずは<span class="fB">direction</span>を変えてみます。初期値はrowです。<br /> directionでは、配置の指定ができます。　寄せではなく、並び方に関する指定です。</p>
<h3>flex-derection</h3>
<p>HTML</p>
<pre class="brush: xml; title: ; notranslate">
      &lt;div class=&quot;reiBox01&quot;&gt;
        &lt;p&gt;row：左を起点に左から右へ順に並びます。&lt;/p&gt;
        &lt;ul class=&quot;boxList direction row&quot;&gt;
          &lt;li&gt;1&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;2&lt;/li&gt;
          &lt;li&gt;3&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;4&lt;/li&gt;
          &lt;li&gt;5&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;6&lt;/li&gt;
          &lt;li&gt;7&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
      &lt;div class=&quot;reiBox01&quot;&gt;
        &lt;p&gt;column：上から下へ縦方向に順にならびます。&lt;/p&gt;
        &lt;ul class=&quot;boxList direction column&quot;&gt;
          &lt;li&gt;1&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;2&lt;/li&gt;
          &lt;li&gt;3&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;4&lt;/li&gt;
          &lt;li&gt;5&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;6&lt;/li&gt;
          &lt;li&gt;7&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
      &lt;div class=&quot;reiBox01&quot;&gt;
        &lt;p&gt;row-reverse：右を起点に右から左へ順に並びます。&lt;/p&gt;
        &lt;ul class=&quot;boxList direction row-reverse&quot;&gt;
          &lt;li&gt;1&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;2&lt;/li&gt;
          &lt;li&gt;3&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;4&lt;/li&gt;
          &lt;li&gt;5&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;6&lt;/li&gt;
          &lt;li&gt;7&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
      &lt;div class=&quot;reiBox01&quot;&gt;
        &lt;p&gt;culumn-reverse：下から上へ縦方向に順にならびます。&lt;/p&gt;
        &lt;ul class=&quot;boxList direction culumn-reverse&quot;&gt;
          &lt;li&gt;1&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;2&lt;/li&gt;
          &lt;li&gt;3&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;4&lt;/li&gt;
          &lt;li&gt;5&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;6&lt;/li&gt;
          &lt;li&gt;7&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
    </pre><br /><br /><br /><br />
<p>CSS</p>
<pre class="brush: xml; title: ; notranslate">
      &lt;style&gt;
        .reiBox01 .boxList.direction li {
          flex: 0 0 60px;
        }
        .reiBox01 .boxList.direction.row li {
          flex-direction: row ;
        }
        .reiBox01 .boxList.direction.column {
          flex-direction: column ;
        }
        .reiBox01 .boxList.direction.column li {
          max-width:60px;
        }
        .reiBox01 .boxList.direction.row-reverse {
          flex-direction:row-reverse;
        }
        .reiBox01 .boxList.direction.culumn-reverse {
          flex-direction:column-reverse;
        }
        .reiBox01 .boxList.direction.culumn-reverse li {
          max-width:60px;
        }
      &lt;/style&gt;
    </pre><br /><br /><br /><br /><style><!--
.pressArt .mainPressSect .reiBox01 .boxList.direction li {
        flex: 0 0 60px;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.direction.row li {
        flex-direction: row ;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.direction.column {
        flex-direction: column ;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.direction.column li {
        max-width:60px;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.direction.row-reverse {
        flex-direction:row-reverse;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.direction.culumn-reverse {
        flex-direction:column-reverse;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.direction.culumn-reverse li {
        max-width:60px;
      }
--></style>
<div class="reiBox01">
<p>row：左を起点に左から右へ順に並びます。</p>
<ul class="boxList direction row">
	<li>1</li>
	<li class="even">2</li>
	<li>3</li>
	<li class="even">4</li>
	<li>5</li>
	<li class="even">6</li>
	<li>7</li>
</ul>
</div>
<div class="reiBox01">
<p>column：上から下へ縦方向に順にならびます。</p>
<ul class="boxList direction column">
	<li>1</li>
	<li class="even">2</li>
	<li>3</li>
	<li class="even">4</li>
	<li>5</li>
	<li class="even">6</li>
	<li>7</li>
</ul>
</div>
<div class="reiBox01">
<p>row-reverse：右を起点に右から左へ順に並びます。</p>
<ul class="boxList direction row-reverse">
	<li>1</li>
	<li class="even">2</li>
	<li>3</li>
	<li class="even">4</li>
	<li>5</li>
	<li class="even">6</li>
	<li>7</li>
</ul>
</div>
<div class="reiBox01">
<p>culumn-reverse：下から上へ縦方向に順にならびます。</p>
<ul class="boxList direction culumn-reverse">
	<li>1</li>
	<li class="even">2</li>
	<li>3</li>
	<li class="even">4</li>
	<li>5</li>
	<li class="even">6</li>
	<li>7</li>
</ul>
</div>
<p>次は折り返しの指定をかえてみます。<br /> 初期値はnowrap 折り返し無しになっています。<br /> 有りにするとfloatと同じ動きになります。<br /> それぞれboxListのwidthを狭めて挙動をみていきます。liはwidthを80px以下には縮まないようにしておきます。</p>
<h3>flex-wrap</h3>
<p>HTML</p>
<pre class="brush: xml; title: ; notranslate">
      &lt;div class=&quot;reiBox01&quot;&gt;
        &lt;p&gt;nowrap：折り返し無しです。設定によっては子要素がフレックスコンテナをはみ出たり、無理やり収まるように伸縮したりします。&lt;/p&gt;
        &lt;ul class=&quot;boxList Fwrap nowrap&quot;&gt;
          &lt;li&gt;1&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;2&lt;/li&gt;
          &lt;li&gt;3&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;4&lt;/li&gt;
          &lt;li&gt;5&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;6&lt;/li&gt;
          &lt;li&gt;7&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
      &lt;div class=&quot;reiBox01&quot;&gt;
        &lt;p&gt;wrap：折り返しするようになります。 floatのような感じですが、伸縮設定をしているとそれぞれが隙間をきっちり埋める動きをします。(伸縮設定は後ほど触れます)&lt;/p&gt;
        &lt;ul class=&quot;boxList Fwrap wrap&quot;&gt;
          &lt;li&gt;1&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;2&lt;/li&gt;
          &lt;li&gt;3&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;4&lt;/li&gt;
          &lt;li&gt;5&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;6&lt;/li&gt;
          &lt;li&gt;7&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
      &lt;div class=&quot;reiBox01&quot;&gt;
        &lt;p&gt;wrap-reverse：同じく折り返しするようになりますが、折り返し地点が逆になります。&lt;/p&gt;
        &lt;ul class=&quot;boxList Fwrap wrap-reverse&quot;&gt;
          &lt;li&gt;1&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;2&lt;/li&gt;
          &lt;li&gt;3&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;4&lt;/li&gt;
          &lt;li&gt;5&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;6&lt;/li&gt;
          &lt;li&gt;7&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
    </pre><br /><br /><br /><br />
<p>CSS</p>
<pre class="brush: xml; title: ; notranslate">
      &lt;style&gt;
        .reiBox01 .boxList.Fwrap {
          width:60%;
          margin:0 auto;
        }
        .reiBox01 .boxList.Fwrap li {
          flex:0 0 80px;
        }
        .reiBox01 .boxList.Fwrap.nowrap {
          flex-wrap: nowrap;
        }
        .reiBox01 .boxList.Fwrap.nowrap li {
        }
        .reiBox01 .boxList.Fwrap.wrap {
          flex-wrap: wrap;
        }
        .reiBox01 .boxList.Fwrap.wrap-reverse {
          flex-wrap:wrap-reverse;
        }
      &lt;/style&gt;
    </pre><br /><br /><br /><br /><style><!--
.pressArt .mainPressSect .reiBox01 .boxList.Fwrap {
        width:60%;
        margin:0 auto;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.Fwrap li {
        flex:0 0 80px;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.Fwrap.nowrap {
        flex-wrap: nowrap;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.Fwrap.nowrap li {
      }
      .pressArt .mainPressSect .reiBox01 .boxList.Fwrap.wrap {
        flex-wrap: wrap;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.Fwrap.wrap-reverse {
        flex-wrap:wrap-reverse;
      }
--></style>
<div class="reiBox01">
<p>nowrap：折り返し無しです。設定によっては子要素がフレックスコンテナをはみ出たり、無理やり収まるように伸縮したりします。</p>
<ul class="boxList Fwrap nowrap">
	<li>1</li>
	<li class="even">2</li>
	<li>3</li>
	<li class="even">4</li>
	<li>5</li>
	<li class="even">6</li>
	<li>7</li>
</ul>
</div>
<div class="reiBox01">
<p>wrap：折り返しするようになります。 floatのような感じですが、伸縮設定をしているとそれぞれが隙間をきっちり埋める動きをします。(伸縮設定は後ほど触れます)</p>
<ul class="boxList Fwrap wrap">
	<li>1</li>
	<li class="even">2</li>
	<li>3</li>
	<li class="even">4</li>
	<li>5</li>
	<li class="even">6</li>
	<li>7</li>
</ul>
</div>
<div class="reiBox01">
<p>wrap-reverse：同じく折り返しするようになりますが、折り返し地点が逆になります。</p>
<ul class="boxList Fwrap wrap-reverse">
	<li>1</li>
	<li class="even">2</li>
	<li>3</li>
	<li class="even">4</li>
	<li>5</li>
	<li class="even">6</li>
	<li>7</li>
</ul>
</div>
<p>上記のflex-directionとflex-wrapはflex-flowを使うことでショートハンドで記入することができます</p>
<p>HTML</p>
<pre class="brush: xml; title: ; notranslate">
      &lt;div class=&quot;reiBox01&quot;&gt;
        &lt;p&gt;flow：flex-wrapとflex-flowを同時に設定します。今回はrow-reverseとwrap-reverseにしてみました。&lt;br&gt;右から始まって上へ折り返すようになってます。&lt;/p&gt;
        &lt;ul class=&quot;boxList flow&quot;&gt;
          &lt;li&gt;1&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;2&lt;/li&gt;
          &lt;li&gt;3&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;4&lt;/li&gt;
          &lt;li&gt;5&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;6&lt;/li&gt;
          &lt;li&gt;7&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
    </pre><br /><br /><br /><br />
<p>CSS</p>
<pre class="brush: xml; title: ; notranslate">
      &lt;style&gt;
        .reiBox01 .boxList.flow {
          width:60%;
          margin:0 auto;
          flex-flow:row-reverse wrap-reverse;
        }
        .reiBox01 .boxList.flow li {
          flex:0 0 80px;
        }
      &lt;/style&gt;
    </pre><br /><br /><br /><br /><style><!--
.pressArt .mainPressSect .reiBox01 .boxList.flow {
        width:60%;
        margin:0 auto;
        flex-flow:row-reverse wrap-reverse;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.flow li {
        flex:0 0 80px;
      }
--></style>
<div class="reiBox01">
<p>flow：flex-wrapとflex-flowを同時に設定します。今回はrow-reverseとwrap-reverseにしてみました。<br />右から始まって上へ折り返すようになってます。</p>
<ul class="boxList flow">
	<li>1</li>
	<li class="even">2</li>
	<li>3</li>
	<li class="even">4</li>
	<li>5</li>
	<li class="even">6</li>
	<li>7</li>
</ul>
</div>
<p>配置関係はこんなところです、組み合わせなどよく考えて使うといいと思います。<br /> これまでなかった逆折り返しなど、一度やってみると新しい概念ができるので試しにやってみるのもいいかもです。<br /> 知っていれば幅は広がりますからね(´・ω・｀)v<br /> 次は揃え関係を触っていきます。</p>
<p>注意すべきは、親要素より子要素（固定ブロック）が小さいことです。<br />隙間がなければ、揃えを使う意味がなくなりますのでご注意です。<br />今回は子要素を伸縮なしの50pxにしてあります。</p>
<h3>justify-content</h3>
<p>HTML</p>
<pre class="brush: xml; title: ; notranslate">
      &lt;div class=&quot;reiBox01&quot;&gt;
        &lt;p&gt;flex-start：通常の左上揃えです。子要素が左上に向かって寄って行ってます。&lt;/p&gt;
        &lt;ul class=&quot;boxList justify start&quot;&gt;
          &lt;li&gt;1&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;2&lt;/li&gt;
          &lt;li&gt;3&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;4&lt;/li&gt;
          &lt;li&gt;5&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;6&lt;/li&gt;
          &lt;li&gt;7&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
      &lt;div class=&quot;reiBox01&quot;&gt;
        &lt;p&gt;flex-end：右下揃えです。子要素が右下に向かって寄って行ってます。注意は右上ではないことです。&lt;/p&gt;
        &lt;ul class=&quot;boxList justify end&quot;&gt;
          &lt;li&gt;1&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;2&lt;/li&gt;
          &lt;li&gt;3&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;4&lt;/li&gt;
          &lt;li&gt;5&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;6&lt;/li&gt;
          &lt;li&gt;7&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
      &lt;div class=&quot;reiBox01&quot;&gt;
        &lt;p&gt;center：中央揃えです。中央に向かって寄っていきます。&lt;/p&gt;
        &lt;ul class=&quot;boxList justify center&quot;&gt;
          &lt;li&gt;1&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;2&lt;/li&gt;
          &lt;li&gt;3&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;4&lt;/li&gt;
          &lt;li&gt;5&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;6&lt;/li&gt;
          &lt;li&gt;7&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
      &lt;div class=&quot;reiBox01&quot;&gt;
        &lt;p&gt;space-between：子要素が両端を詰めた形での均等揃えです。このへんから、float組などでは若干手間なものが簡単に出来てきます。&lt;/p&gt;
        &lt;ul class=&quot;boxList justify between&quot;&gt;
          &lt;li&gt;1&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;2&lt;/li&gt;
          &lt;li&gt;3&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;4&lt;/li&gt;
          &lt;li&gt;5&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;6&lt;/li&gt;
          &lt;li&gt;7&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
      &lt;div class=&quot;reiBox01&quot;&gt;
        &lt;p&gt;space-around：両端にも均等に左右の隙間ができる均等揃えです。&lt;br&gt;フレキシブルなので親要素が伸びれば均等に離れていくすぐれものです。&lt;br&gt;floatやinline-blockでも同じようなことができますが、こちらは要素が増えても問題ないところが優れています。&lt;/p&gt;
        &lt;ul class=&quot;boxList justify around&quot;&gt;
          &lt;li&gt;1&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;2&lt;/li&gt;
          &lt;li&gt;3&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;4&lt;/li&gt;
          &lt;li&gt;5&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;6&lt;/li&gt;
          &lt;li&gt;7&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
    </pre><br /><br /><br /><br />
<p>CSS</p>
<pre class="brush: xml; title: ; notranslate">
      &lt;style&gt;
        .reiBox01 .boxList.justify li {
          flex:0 0 50px;
        }
        .reiBox01 .boxList.justify.start{
          justify-content: flex-start;
        }
        .reiBox01 .boxList.justify.end{
          justify-content: flex-end;
        }
        .reiBox01 .boxList.justify.center{
          justify-content: center;
        }
        .reiBox01 .boxList.justify.between{
          justify-content: space-between;
        }
        .reiBox01 .boxList.justify.around{
          justify-content: space-around;
        }
      &lt;/style&gt;
    </pre><br /><br /><br /><br /><style><!--
.pressArt .mainPressSect .reiBox01 .boxList.justify li {
        flex:0 0 50px;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.justify.start{
        justify-content: flex-start;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.justify.end{
        justify-content: flex-end;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.justify.center{
        justify-content: center;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.justify.between{
        justify-content: space-between;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.justify.around{
        justify-content: space-around;
      }
--></style>
<div class="reiBox01">
<p>flex-start：通常の左上揃えです。子要素が左上に向かって寄って行ってます。</p>
<ul class="boxList justify start">
	<li>1</li>
	<li class="even">2</li>
	<li>3</li>
	<li class="even">4</li>
	<li>5</li>
	<li class="even">6</li>
	<li>7</li>
</ul>
</div>
<div class="reiBox01">
<p>flex-end：右下揃えです。子要素が右下に向かって寄って行ってます。注意は右上ではないことです。</p>
<ul class="boxList justify end">
	<li>1</li>
	<li class="even">2</li>
	<li>3</li>
	<li class="even">4</li>
	<li>5</li>
	<li class="even">6</li>
	<li>7</li>
</ul>
</div>
<div class="reiBox01">
<p>center：中央揃えです。中央に向かって寄っていきます。</p>
<ul class="boxList justify center">
	<li>1</li>
	<li class="even">2</li>
	<li>3</li>
	<li class="even">4</li>
	<li>5</li>
	<li class="even">6</li>
	<li>7</li>
</ul>
</div>
<div class="reiBox01">
<p>space-between：子要素が両端を詰めた形での均等揃えです。このへんから、float組などでは若干手間なものが簡単に出来てきます。</p>
<ul class="boxList justify between">
	<li>1</li>
	<li class="even">2</li>
	<li>3</li>
	<li class="even">4</li>
	<li>5</li>
	<li class="even">6</li>
	<li>7</li>
</ul>
</div>
<div class="reiBox01">
<p>space-around：両端にも均等に左右の隙間ができる均等揃えです。<br />フレキシブルなので親要素が伸びれば均等に離れていくすぐれものです。<br />floatやinline-blockでも同じようなことができますが、こちらは要素が増えても問題ないところが優れています。</p>
<ul class="boxList justify around">
	<li>1</li>
	<li class="even">2</li>
	<li>3</li>
	<li class="even">4</li>
	<li>5</li>
	<li class="even">6</li>
	<li>7</li>
</ul>
</div>
<p>この時点でも、たまに悩んでしまうような配置がラクラクとできてます。<br />次は垂直方向の揃えです。<br /> このままだとわかりにくいので、evenのclassを振っている要素の高さをかえてやってみます。</p>
<h3>align-items</h3>
<p>HTML</p>
<pre class="brush: xml; title: ; notranslate">
      &lt;div class=&quot;reiBox01&quot;&gt;
        &lt;p&gt;flex-start：flex-directionが横配置の場合、上に揃います。&lt;br&gt;
  縦配置の場合は左へ揃います。&lt;/p&gt;
        &lt;ul class=&quot;boxList align start&quot;&gt;
          &lt;li&gt;1&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;2&lt;/li&gt;
          &lt;li&gt;3&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;4&lt;/li&gt;
          &lt;li&gt;5&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;6&lt;/li&gt;
          &lt;li&gt;7&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
      &lt;div class=&quot;reiBox01&quot;&gt;
        &lt;p&gt;flex-end：こちらは横配置の場合下揃え、縦配置だと右へ揃います&lt;/p&gt;
        &lt;ul class=&quot;boxList align end&quot;&gt;
          &lt;li&gt;1&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;2&lt;/li&gt;
          &lt;li&gt;3&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;4&lt;/li&gt;
          &lt;li&gt;5&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;6&lt;/li&gt;
          &lt;li&gt;7&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
      &lt;div class=&quot;reiBox01&quot;&gt;
        &lt;p&gt;center：上下中央揃えです。わかりやすいよう親要素にheightを入れました。&lt;br&gt;
  さて、お気づきになりましたでしょうか？・・・&lt;br&gt;
  そう、これを使うと、上下左右中央揃えが簡単にできちゃいます。　(´・ω・｀)ｽｺﾞｸﾅｲ?&lt;/p&gt;
        &lt;ul class=&quot;boxList align center&quot;&gt;
          &lt;li&gt;1&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;2&lt;/li&gt;
          &lt;li&gt;3&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;4&lt;/li&gt;
          &lt;li&gt;5&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;6&lt;/li&gt;
          &lt;li&gt;7&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
      &lt;div class=&quot;reiBox01&quot;&gt;
        &lt;p&gt;おまけ：上下中央揃え&lt;/p&gt;
        &lt;ul class=&quot;boxList align justify center&quot;&gt;
          &lt;li&gt;1&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;2&lt;/li&gt;
          &lt;li&gt;3&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;4&lt;/li&gt;
          &lt;li&gt;5&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;6&lt;/li&gt;
          &lt;li&gt;7&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
      &lt;div class=&quot;reiBox01&quot;&gt;
        &lt;p&gt;baseline：ベースライン揃えです。ベースラインとは、中の文字を基準に揃える方法です。&lt;/p&gt;
        &lt;ul class=&quot;boxList align base&quot;&gt;
          &lt;li&gt;1&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;2&lt;/li&gt;
          &lt;li&gt;3&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;4&lt;/li&gt;
          &lt;li&gt;5&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;6&lt;/li&gt;
          &lt;li&gt;7&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
      &lt;div class=&quot;reiBox01&quot;&gt;
        &lt;p&gt;stretch：自動で高さを合わせてくれます。&lt;br&gt;
  ようは、上下の隙間を埋めてくれる感じです。ためしに親要素の高さを200pxにしてみました。&lt;/p&gt;
        &lt;ul class=&quot;boxList align stretch&quot;&gt;
          &lt;li&gt;1&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;2&lt;/li&gt;
          &lt;li&gt;3&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;4&lt;/li&gt;
          &lt;li&gt;5&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;6&lt;/li&gt;
          &lt;li&gt;7&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
    </pre><br /><br /><br /><br />
<p>CSS</p>
<pre class="brush: xml; title: ; notranslate">
      &lt;style&gt;
        .reiBox01 .boxList.align {
        }
        .reiBox01 .boxList.align li {
          height:50px;
        }
        .reiBox01 .boxList.align li.even{
          height:100px;
        }
        .reiBox01 .boxList.align.start {
          align-items:flex-start;
        }
        .reiBox01 .boxList.align.end {
          align-items:flex-end;
        }
        .reiBox01 .boxList.align.center {
          height:200px;
          align-items:center;
        }
        .reiBox01 .boxList.align.base {
          align-items:baseline;
        }
        .reiBox01 .boxList.align.stretch {
          height:200px;
          align-items:stretch;
        }
        .reiBox01 .boxList.align.stretch li{
          height:auto;
        }
      &lt;/style&gt;
    </pre><br /><br /><br /><br /><style><!--
.pressArt .mainPressSect .reiBox01 .boxList.align {
      }
      .pressArt .mainPressSect .reiBox01 .boxList.align li {
        height:50px;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.align li.even{
        height:100px;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.align.start {
        align-items:flex-start;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.align.end {
        align-items:flex-end;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.align.center {
        height:200px;
        align-items:center;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.align.base {
        align-items:baseline;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.align.stretch {
        height:200px;
        align-items:stretch;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.align.stretch li{
        height:auto;
      }
--></style>
<div class="reiBox01">
<p>flex-start：flex-directionが横配置の場合、上に揃います。<br /> 縦配置の場合は左へ揃います。</p>
<ul class="boxList align start">
	<li>1</li>
	<li class="even">2</li>
	<li>3</li>
	<li class="even">4</li>
	<li>5</li>
	<li class="even">6</li>
	<li>7</li>
</ul>
</div>
<div class="reiBox01">
<p>flex-end：こちらは横配置の場合下揃え、縦配置だと右へ揃います</p>
<ul class="boxList align end">
	<li>1</li>
	<li class="even">2</li>
	<li>3</li>
	<li class="even">4</li>
	<li>5</li>
	<li class="even">6</li>
	<li>7</li>
</ul>
</div>
<div class="reiBox01">
<p>center：上下中央揃えです。わかりやすいよう親要素にheightを入れました。<br /> さて、お気づきになりましたでしょうか？・・・<br /> そう、これを使うと、上下左右中央揃えが簡単にできちゃいます。　(´・ω・｀)ｽｺﾞｸﾅｲ?</p>
<ul class="boxList align center">
	<li>1</li>
	<li class="even">2</li>
	<li>3</li>
	<li class="even">4</li>
	<li>5</li>
	<li class="even">6</li>
	<li>7</li>
</ul>
</div>
<div class="reiBox01">
<p>おまけ：上下中央揃え</p>
<ul class="boxList align justify center">
	<li>1</li>
	<li class="even">2</li>
	<li>3</li>
	<li class="even">4</li>
	<li>5</li>
	<li class="even">6</li>
	<li>7</li>
</ul>
</div>
<div class="reiBox01">
<p>baseline：ベースライン揃えです。ベースラインとは、中の文字を基準に揃える方法です。</p>
<ul class="boxList align base">
	<li>1</li>
	<li class="even">2</li>
	<li>3</li>
	<li class="even">4</li>
	<li>5</li>
	<li class="even">6</li>
	<li>7</li>
</ul>
</div>
<div class="reiBox01">
<p>stretch：自動で高さを合わせてくれます。<br /> ようは、上下の隙間を埋めてくれる感じです。ためしに親要素の高さを200pxにしてみました。</p>
<ul class="boxList align stretch">
	<li>1</li>
	<li class="even">2</li>
	<li>3</li>
	<li class="even">4</li>
	<li>5</li>
	<li class="even">6</li>
	<li>7</li>
</ul>
</div>
<p>と言った感じで、横にも縦にも臨機応変に設定可能です。<br /> では、改行され複数行になったときの設定をしてみます。</p>
<h3>align-content</h3>
<p>HTML</p>
<pre class="brush: xml; title: ; notranslate">
      &lt;div class=&quot;reiBox01&quot;&gt;
        &lt;p&gt;flex-start：複数行のときの揃い方を設定します。&lt;br&gt;
  flex-startはdirectionが横方向ならば上、縦ならば左揃えになります。&lt;/p&gt;
        &lt;ul class=&quot;boxList aContent start&quot;&gt;
          &lt;li&gt;1&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;2&lt;/li&gt;
          &lt;li&gt;3&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;4&lt;/li&gt;
          &lt;li&gt;5&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;6&lt;/li&gt;
          &lt;li&gt;7&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
      &lt;div class=&quot;reiBox01&quot;&gt;
        &lt;p&gt;flex-end：こちらは複数行のとき横方向ならば下、縦方向なら右に揃います。&lt;/p&gt;
        &lt;ul class=&quot;boxList aContent end&quot;&gt;
          &lt;li&gt;1&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;2&lt;/li&gt;
          &lt;li&gt;3&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;4&lt;/li&gt;
          &lt;li&gt;5&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;6&lt;/li&gt;
          &lt;li&gt;7&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
      &lt;div class=&quot;reiBox01&quot;&gt;
        &lt;p&gt;center：こちらは複数行のとき上下中央揃えになります。&lt;/p&gt;
        &lt;ul class=&quot;boxList aContent center&quot;&gt;
          &lt;li&gt;1&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;2&lt;/li&gt;
          &lt;li&gt;3&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;4&lt;/li&gt;
          &lt;li&gt;5&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;6&lt;/li&gt;
          &lt;li&gt;7&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
      &lt;div class=&quot;reiBox01&quot;&gt;
        &lt;p&gt;space-between：こちらは複数行のとき上下均等揃えになります。&lt;/p&gt;
        &lt;ul class=&quot;boxList aContent between&quot;&gt;
          &lt;li&gt;1&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;2&lt;/li&gt;
          &lt;li&gt;3&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;4&lt;/li&gt;
          &lt;li&gt;5&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;6&lt;/li&gt;
          &lt;li&gt;7&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
      &lt;div class=&quot;reiBox01&quot;&gt;
        &lt;p&gt;space-around：こちらは複数行のとき上下中央揃えになり、上下の端にも間隔がある均等揃えになります。&lt;/p&gt;
        &lt;ul class=&quot;boxList aContent around&quot;&gt;
          &lt;li&gt;1&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;2&lt;/li&gt;
          &lt;li&gt;3&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;4&lt;/li&gt;
          &lt;li&gt;5&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;6&lt;/li&gt;
          &lt;li&gt;7&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
    </pre><br /><br /><br /><br />
<p>CSS</p>
<pre class="brush: xml; title: ; notranslate">
      &lt;style&gt;
        .reiBox01 .boxList.aContent {
          flex-wrap:wrap;
        }
        .reiBox01 .boxList.aContent li {
          flex:0 0 120px;
        }
        .reiBox01 .boxList.aContent.start {
          align-content:flex-start;
        }
        .reiBox01 .boxList.aContent.end {
          height:200px;
          align-content:flex-end;
        }
        .reiBox01 .boxList.aContent.end li {
          height:40px;
        }
        .reiBox01 .boxList.aContent.center {
          height:200px;
          align-content:center;
        }
        .reiBox01 .boxList.aContent.between {
          height:300px;
          padding:0;
          align-content:space-between;
        }
        .reiBox01 .boxList.aContent.between li {
          flex:0 0 300px;
        }
        .reiBox01 .boxList.aContent.around {
          height:300px;
          padding:0;
          align-content:space-around;
        }
        .reiBox01 .boxList.aContent.around li {
          flex:0 0 300px;
        }
      &lt;/style&gt;
    </pre><br /><br /><br /><br /><style><!--
.pressArt .mainPressSect .reiBox01 .boxList.aContent {
        flex-wrap:wrap;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.aContent li {
        flex:0 0 120px;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.aContent.start {
        align-content:flex-start;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.aContent.end {
        height:200px;
        align-content:flex-end;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.aContent.end li {
        height:40px;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.aContent.center {
        height:200px;
        align-content:center;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.aContent.between {
        height:300px;
        padding:0;
        align-content:space-between;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.aContent.between li {
        flex:0 0 300px;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.aContent.around {
        height:300px;
        padding:0;
        align-content:space-around;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.aContent.around li {
        flex:0 0 300px;
      }
--></style>
<div class="reiBox01">
<p>flex-start：複数行のときの揃い方を設定します。<br /> flex-startはdirectionが横方向ならば上、縦ならば左揃えになります。</p>
<ul class="boxList aContent start">
	<li>1</li>
	<li class="even">2</li>
	<li>3</li>
	<li class="even">4</li>
	<li>5</li>
	<li class="even">6</li>
	<li>7</li>
</ul>
</div>
<div class="reiBox01">
<p>flex-end：こちらは複数行のとき横方向ならば下、縦方向なら右に揃います。</p>
<ul class="boxList aContent end">
	<li>1</li>
	<li class="even">2</li>
	<li>3</li>
	<li class="even">4</li>
	<li>5</li>
	<li class="even">6</li>
	<li>7</li>
</ul>
</div>
<div class="reiBox01">
<p>center：こちらは複数行のとき上下中央揃えになります。</p>
<ul class="boxList aContent center">
	<li>1</li>
	<li class="even">2</li>
	<li>3</li>
	<li class="even">4</li>
	<li>5</li>
	<li class="even">6</li>
	<li>7</li>
</ul>
</div>
<div class="reiBox01">
<p>space-between：こちらは複数行のとき上下均等揃えになります。</p>
<ul class="boxList aContent between">
	<li>1</li>
	<li class="even">2</li>
	<li>3</li>
	<li class="even">4</li>
	<li>5</li>
	<li class="even">6</li>
	<li>7</li>
</ul>
</div>
<div class="reiBox01">
<p>space-around：こちらは複数行のとき上下中央揃えになり、上下の端にも間隔がある均等揃えになります。</p>
<ul class="boxList aContent around">
	<li>1</li>
	<li class="even">2</li>
	<li>3</li>
	<li class="even">4</li>
	<li>5</li>
	<li class="even">6</li>
	<li>7</li>
</ul>
</div>
<p>これは複数行の時、という条件付きですがちゃんとつかえればレスポンシブなどのときに役立ちそうですね。<br /> 次は伸縮設定です。これがフレックスの大きな利点でしょうか。<br /> さっそくやっていきます。</p>
<h3>flex</h3>
<p>ここまでで、ちょいちょい使用していましたが、flexのご紹介です。<br /> こちらは今までのと違い、子要素へ設定するので気を付けてください。</p>
<p>HTML</p>
<pre class="brush: xml; title: ; notranslate">
      &lt;div class=&quot;reiBox01&quot;&gt;
        &lt;p&gt;flex-grow：伸びの倍率設定です、全てに1を設定すれば均等に割り振られます。&lt;br&gt;注意すべきは、余ったスペースを埋める性質なのをわすれずに&lt;/p&gt;
        &lt;ul class=&quot;boxList flex grow&quot;&gt;
          &lt;li&gt;1&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;2&lt;/li&gt;
          &lt;li&gt;3&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;4&lt;/li&gt;
          &lt;li&gt;5&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;6&lt;/li&gt;
          &lt;li&gt;7&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
      &lt;div class=&quot;reiBox01&quot;&gt;
        &lt;p&gt;flex-growその2：evenだけ倍率を変えてみます。&lt;/p&gt;
        &lt;ul class=&quot;boxList flex grow02&quot;&gt;
          &lt;li&gt;1&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;2&lt;/li&gt;
          &lt;li&gt;3&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;4&lt;/li&gt;
          &lt;li&gt;5&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;6&lt;/li&gt;
          &lt;li&gt;7&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
      &lt;div class=&quot;reiBox01&quot;&gt;
        &lt;p&gt;flex-shrink：縮みの倍率設定です。0だと縮まりませんので、折り返し設定をしてない場合コンテナからはみ出ます。1で均等に縮まります。&lt;br&gt;この場合元の長さが長く、子要素がの合計がコンテナより大きくないといけないので、次にご紹介するflex-basisも一緒に使用します。&lt;br&gt;
  元の長さは200pxにしてあります。&lt;/p&gt;
        &lt;ul class=&quot;boxList flex shrink&quot;&gt;
          &lt;li&gt;1&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;2&lt;/li&gt;
          &lt;li&gt;3&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;4&lt;/li&gt;
          &lt;li&gt;5&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;6&lt;/li&gt;
          &lt;li&gt;7&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
      &lt;div class=&quot;reiBox01&quot;&gt;
        &lt;p&gt;flex-basis：元の長さを設定します。&lt;br&gt;
  伸縮倍率がかかってない場合、これが基本のwidthとなります。&lt;br&gt;
  ためしに、倍率を0にして、40pxにしてみます。&lt;/p&gt;
        &lt;ul class=&quot;boxList flex basis&quot;&gt;
          &lt;li&gt;1&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;2&lt;/li&gt;
          &lt;li&gt;3&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;4&lt;/li&gt;
          &lt;li&gt;5&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;6&lt;/li&gt;
          &lt;li&gt;7&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
      &lt;div class=&quot;reiBox01&quot;&gt;
        &lt;p&gt;flex：flex-grow、flex-shrink、flex-basisをまとめてショートハンド記入できます。&lt;br&gt;記入順はgrow shrink basisです。&lt;/p&gt;
        &lt;ul class=&quot;boxList flex sHand&quot;&gt;
          &lt;li&gt;1&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;2&lt;/li&gt;
          &lt;li&gt;3&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;4&lt;/li&gt;
          &lt;li&gt;5&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;6&lt;/li&gt;
          &lt;li&gt;7&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
    </pre><br /><br /><br /><br />
<p>CSS</p>
<pre class="brush: xml; title: ; notranslate">
      &lt;style&gt;
        .reiBox01 .boxList.flex {
        }
        .reiBox01 .boxList.flex.grow {
        }
        .reiBox01 .boxList.flex.grow li {
          flex-grow: 1;
        }
        .reiBox01 .boxList.flex.grow02 li.even {
          flex-grow: 3;
        }
        .reiBox01 .boxList.flex.shrink li {
          flex-shrink: 1;
          flex-basis: 200px;
        }
        .reiBox01 .boxList.flex.basis li {
          flex-grow: 0;
          flex-shrink: 0;
          flex-basis:40px;
        }
        .reiBox01 .boxList.flex.sHand li {
          flex: 1 1 200px;
        }
      &lt;/style&gt;
    </pre><br /><br /><br /><br /><style><!--
.pressArt .mainPressSect .reiBox01 .boxList.flex {
      }
      .pressArt .mainPressSect .reiBox01 .boxList.flex.grow {
      }
      .pressArt .mainPressSect .reiBox01 .boxList.flex.grow li {
        flex-grow: 1;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.flex.grow02 li.even {
        flex-grow: 3;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.flex.shrink li {
        flex-shrink: 1;
        flex-basis: 200px;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.flex.basis li {
        flex-grow: 0;
        flex-shrink: 0;
        flex-basis:40px;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.flex.sHand li {
        flex: 1 1 200px;
      }
--></style>
<div class="reiBox01">
<p>flex-grow：伸びの倍率設定です、全てに1を設定すれば均等に割り振られます。<br />注意すべきは、余ったスペースを埋める性質なのをわすれずに</p>
<ul class="boxList flex grow">
	<li>1</li>
	<li class="even">2</li>
	<li>3</li>
	<li class="even">4</li>
	<li>5</li>
	<li class="even">6</li>
	<li>7</li>
</ul>
</div>
<div class="reiBox01">
<p>flex-growその2：evenだけ倍率を変えてみます。</p>
<ul class="boxList flex grow02">
	<li>1</li>
	<li class="even">2</li>
	<li>3</li>
	<li class="even">4</li>
	<li>5</li>
	<li class="even">6</li>
	<li>7</li>
</ul>
</div>
<div class="reiBox01">
<p>flex-shrink：縮みの倍率設定です。0だと縮まりませんので、折り返し設定をしてない場合コンテナからはみ出ます。1で均等に縮まります。<br />この場合元の長さが長く、子要素がの合計がコンテナより大きくないといけないので、次にご紹介するflex-basisも一緒に使用します。<br /> 元の長さは200pxにしてあります。</p>
<ul class="boxList flex shrink">
	<li>1</li>
	<li class="even">2</li>
	<li>3</li>
	<li class="even">4</li>
	<li>5</li>
	<li class="even">6</li>
	<li>7</li>
</ul>
</div>
<div class="reiBox01">
<p>flex-basis：元の長さを設定します。<br /> 伸縮倍率がかかってない場合、これが基本のwidthとなります。<br /> ためしに、倍率を0にして、40pxにしてみます。</p>
<ul class="boxList flex basis">
	<li>1</li>
	<li class="even">2</li>
	<li>3</li>
	<li class="even">4</li>
	<li>5</li>
	<li class="even">6</li>
	<li>7</li>
</ul>
</div>
<div class="reiBox01">
<p>flex：flex-grow、flex-shrink、flex-basisをまとめてショートハンド記入できます。<br />記入順はgrow shrink basisです。</p>
<ul class="boxList flex sHand">
	<li>1</li>
	<li class="even">2</li>
	<li>3</li>
	<li class="even">4</li>
	<li>5</li>
	<li class="even">6</li>
	<li>7</li>
</ul>
</div>
<p>最後におまけな値です。</p>
<h3>align-self or order</h3>
<p><span class="fB">alige-self</span></p>
<p>align-self：機能はalign-itemsと同じです。なのでプロパティも同じものを使います。ですが、こちらは個別指定です。<br /> 個別とはどういうことかといいますと、align-itemsは親要素（Flexコンテナ）に設定し全体を変えるのですが、align-selfは子要素（Flexアイテム）に直接効かせることができます。</p>
<p>HTML</p>
<pre class="brush: xml; title: ; notranslate">
      &lt;div class=&quot;reiBox01&quot;&gt;
        &lt;ul class=&quot;boxList self&quot;&gt;
          &lt;li&gt;1&lt;/li&gt;
          &lt;li class=&quot;even num02&quot;&gt;2&lt;/li&gt;
          &lt;li class=&quot;num03&quot;&gt;3&lt;/li&gt;
          &lt;li class=&quot;even num03&quot;&gt;4&lt;/li&gt;
          &lt;li class=&quot;num05&quot;&gt;5&lt;/li&gt;
          &lt;li class=&quot;even num06&quot;&gt;6&lt;/li&gt;
          &lt;li class=&quot;num07&quot;&gt;7&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
    </pre><br /><br /><br /><br />
<p>alige-self CSS</p>
<pre class="brush: xml; title: ; notranslate">
      &lt;style&gt;
        .reiBox01 .boxList.self {
          height:200px;
          flex-wrap: wrap;
          align-items: center;
        }
        .reiBox01 .boxList.self li{
          flex:1 1 auto;
        }
        .reiBox01 .boxList.self li.num02 {
          align-self:flex-start;
        }
        .reiBox01 .boxList.self li.num03 {
          align-self:flex-end;
        }
        .reiBox01 .boxList.self li.num04 {
          font-size:40px;
          align-self:baseline;
        }
        .reiBox01 .boxList.self li.num05 {
          align-self:stretch;
        }
        .reiBox01 .boxList.self li.num06 {
          align-self:baseline;
        }
        .reiBox01 .boxList.self li.num07 {
        }
  
      &lt;/style&gt;
    </pre><br /><br /><br /><br /><style><!--
.pressArt .mainPressSect .reiBox01 .boxList.self {
        height:200px;
        flex-wrap: wrap;
        align-items: center;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.self li{
        flex:1 1 auto;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.self li.num02 {
        align-self:flex-start;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.self li.num03 {
        align-self:flex-end;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.self li.num04 {
        font-size:40px;
        align-self:baseline;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.self li.num05 {
        align-self:stretch;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.self li.num06 {
        align-self:baseline;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.self li.num07 {
      }
--></style>
<div class="reiBox01">
<ul class="boxList self">
	<li>1</li>
	<li class="even num02">2</li>
	<li class="num03">3</li>
	<li class="even num03">4</li>
	<li class="num05">5</li>
	<li class="even num06">6</li>
	<li class="num07">7</li>
</ul>
</div>
<p><span class="fB">order</span></p>
<p>order：最後にこちらは順番を指定することができるプロパティです。<br /> 初期値は当然0からの連番ですが、こちらで順番を指定することができます。<br /> たとえば、レスポンシブでブレイクポイントに達した時並びを変えるなんてことが出来たりします。<br /> 今回nthを使っていますが、classを振るなど工夫して使用してみてください。</p>
<p>HTML</p>
<pre class="brush: xml; title: ; notranslate">
      &lt;div class=&quot;reiBox01&quot;&gt;
        
        &lt;ul class=&quot;boxList flex order&quot;&gt;
          &lt;li&gt;1&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;2&lt;/li&gt;
          &lt;li&gt;3&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;4&lt;/li&gt;
          &lt;li&gt;5&lt;/li&gt;
          &lt;li class=&quot;even&quot;&gt;6&lt;/li&gt;
          &lt;li&gt;7&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
    </pre><br /><br /><br /><br />
<p>CSS</p>
<pre class="brush: xml; title: ; notranslate">
      &lt;style&gt;
        .reiBox01 .boxList.flex.order {
          flex-wrap:wrap;
        }
        .reiBox01 .boxList.flex.order li {
          flex:1 1 200px;
          box-shadow: inset 0 0 5px rgba(27, 27, 27, 0.22);
        }
        .reiBox01 .boxList.flex.order li:nth-child(1) {
          order:2;
        }
        .reiBox01 .boxList.flex.order li:nth-child(2) {
          order:5;
        }
        .reiBox01 .boxList.flex.order li:nth-child(3) {
          order:1;
        }
        .reiBox01 .boxList.flex.order li:nth-child(4) {
          order:7;
        }
        .reiBox01 .boxList.flex.order li:nth-child(5) {
          order:3;
        }
        .reiBox01 .boxList.flex.order li:nth-child(6) {
          order:4;
        }
        .reiBox01 .boxList.flex.order li:nth-child(7) {
          order:6;
        }
      &lt;/style&gt;
    </pre><br /><br /><br /><br /><style><!--
.pressArt .mainPressSect .reiBox01 .boxList.flex.order {
        flex-wrap:wrap;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.flex.order li {
        flex:1 1 200px;
        box-shadow: inset 0 0 5px rgba(27, 27, 27, 0.22);
      }
      .pressArt .mainPressSect .reiBox01 .boxList.flex.order li:nth-child(1) {
        order:2;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.flex.order li:nth-child(2) {
        order:5;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.flex.order li:nth-child(3) {
        order:1;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.flex.order li:nth-child(4) {
        order:7;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.flex.order li:nth-child(5) {
        order:3;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.flex.order li:nth-child(6) {
        order:4;
      }
      .pressArt .mainPressSect .reiBox01 .boxList.flex.order li:nth-child(7) {
        order:6;
      }
--></style>
<div class="reiBox01">
<ul class="boxList flex order">
	<li>1</li>
	<li class="even">2</li>
	<li>3</li>
	<li class="even">4</li>
	<li>5</li>
	<li class="even">6</li>
	<li>7</li>
</ul>
</div>
<p>フレックスボックスは色々な可能性を秘めていますね。<br /> それぞれの使い方ばかりになりましたが、組み合わせるとフレキシブルな組み方がたくさんできます。<br /> IEとSafariが未対応なのと、ベンダープレフィックスが必要といろいろまだ制限がございますが、使える環境化ではとても有効で面白いプロパティです。<br /> ぜひ、試してみてください。(´・ω・｀)ｖ</p>
<p>お次は無理やりdisplay:table;をつかって、tableレイアウトを再現したりします。<br /> <a href="https://taneppa.net/?p=2387" target="_blank">第二回はこちら</a></p>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>https://taneppa.net/display_other01/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>【CSS3】で写真に色々装飾を加えてみた(hoverしたときのエフェクトを作る【IE9以前は非推奨】</title>
		<link>https://taneppa.net/css3_03/</link>
		<comments>https://taneppa.net/css3_03/#comments</comments>
		<pubDate>Mon, 02 Feb 2015 10:00:42 +0000</pubDate>
		<dc:creator>yanoppa!</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[コーディング]]></category>
		<category><![CDATA[初心者向け]]></category>

		<guid isPermaLink="false">https://taneppa.net/?p=2060</guid>
		<description><![CDATA[【CSS3】で写真をhoverしたときのエフェクトを作る【IE9以前は非推奨】 おはこんばんちわ、あなたのわた [...]]]></description>
				<content:encoded><![CDATA[<h2><strong>【CSS3】</strong>で写真を<strong>hover</strong>したときの<strong>エフェクトを作る</strong><strong>【IE9以前は非推奨】</strong></h2>
<p>おはこんばんちわ、あなたのわたしのやのっぱです(´・ω・｀)ﾉ</p>
<br />
<p>CSS3とかで写真に装飾つけるシリーズも第三回となりました。<br />
  今回はhover時のエフェクトを付けてみようとおもいます。</p>
<br />
<p>CSSで作るので、例のごとくレガシーブラウザ(IEとかIEとかIEのIE9以前)には未対応なのですが・・・<br />
  使う場面があることを信じて、作っていくのです。</p>
<br />
<p>それでは今回もブランケットに包まるさんにご登場していただきましょう。<br />
  widthは300pxにしてあり、box-sizingと枠を追加しています。<br />
  枠は今回paddingではなく、エフェクトの影響を避けるためborderで白枠をとっています。<br />
  境界線はbox-shadowで作っています。<br />
  また、今回はエフェクトがはみ出ないようoverflow:hidden;をかけています。</p>
<br />
<style>
	  .img01 {
      position:relative;
      overflow:hidden;/* はみ出し防止 */
	    width:300px;
	    margin:0 auto;
	    box-sizing:border-box;/* borderとpaddingをwidthに含める */
	    -moz-box-sizing:border-box;
	    -webkit-box-sizing:border-box;
	    -ms-box-sizing:border-box;
	  }
    .waku01{
      border:7px solid #fff;
      box-shadow: 0 0 1px 0 #aaa; /* 枠の外の境界線 */
	  }
	  .img01 img {
	    width:100%;
	    height:auto;
	    vertical-align:top;
	  }
</style>
<p class="img01 waku01"><img src="https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg" width="500" height="500" alt="ブランケットを羽織った女性" /></p>
<br />
<pre class="brush: xml; title: ; notranslate">
&lt;style&gt;
	  .img01 {
      position:relative;
      overflow:hidden;/* はみ出し防止 */
	    width:300px;
	    margin:0 auto;
	    box-sizing:border-box;/* borderとpaddingをwidthに含める */
	    -moz-box-sizing:border-box;
	    -webkit-box-sizing:border-box;
	    -ms-box-sizing:border-box;
	  }
    .waku01{
      border:7px solid #fff;
      box-shadow: 0 0 1px 0 #aaa; /* 枠の外の境界線 */
	  }
	  .img01 img {
	    width:100%;
	    height:auto;
	    vertical-align:top;
	  }
&lt;/style&gt;
&lt;p class=&quot;img01 waku01&quot;&gt;&lt;img src=&quot;https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg&quot; width=&quot;500&quot; height=&quot;500&quot; alt=&quot;ブランケットを羽織った女性&quot; /&gt;&lt;/p&gt;
</pre> <br />
<p>では、まずは簡単にマスクをかけたようなエフェクトを作ってみます。</p>
<br />
<style>
	  .anime01:before {
      content:" ";
      display:block;
      position:absolute;
      top:0;
      left:0;
      width:100%;
      height:100%;
      background:#000;
      opacity:0;
      cursor:pointer;
      -webkit-transition:all 0.3s linear;/* all(変化させたい要素) 0.3s(変化する早さ) linear(変化の動き:linearは一定の早さ) */
      -moz-transition:all 0.3s linear;
      -ms-transition:all 0.3s linear;
      transition:all 0.3s linear;
	  }
    .anime01:hover:before {
      opacity:0.3;
    }
</style>
<p class="img01 waku01 anime01"><img src="https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg" width="500" height="500" alt="ブランケットを羽織った女性" /></p>
<br />
<pre class="brush: xml; title: ; notranslate">
&lt;style&gt;
	  .anime01:before {
      content:&quot; &quot;;
      display:block;
      position:absolute;
      top:0;
      left:0;
      width:100%;
      height:100%;
      background:#000;
      opacity:0;
      cursor:pointer;
      -webkit-transition:all 0.3s linear;/* all(変化させたい要素) 0.3s(変化する早さ) linear(変化の動き:linearは一定の早さ) */
      -moz-transition:all 0.3s linear;
      -ms-transition:all 0.3s linear;
      transition:all 0.3s linear;
	  }
    .anime01:hover:before {
      opacity:0.3;
    }
&lt;/style&gt;
&lt;p class=&quot;img01 waku01 anime01&quot;&gt;&lt;img src=&quot;https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg&quot; width=&quot;500&quot; height=&quot;500&quot; alt=&quot;ブランケットを羽織った女性&quot; /&gt;&lt;/p&gt;
</pre> <br />
<p>次にふんわりとフォーカスしたようなエフェクトを作ってみます。</p>
<style>
	  .anime02:before {
      content:" ";
      display:block;
      position:absolute;
      top:0;
      left:0;
      width:100%;
      height:100%;
      box-shadow:inset 0 0 200px 30px rgba(0,0,0,0.6);
      opacity:0;
      cursor:pointer;
      -webkit-transition:all 0.3s linear;
      -moz-transition:all 0.3s linear;
      -ms-transition:all 0.3s linear;
      transition:all 0.3s linear;
	  }
    .anime02:hover:before {
      opacity:1;
    }
</style>
<p class="img01 waku01 anime02"><img src="https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg" width="500" height="500" alt="ブランケットを羽織った女性" /></p>
<br />
<pre class="brush: xml; title: ; notranslate">
&lt;style&gt;
	  .anime02:before {
      content:&quot; &quot;;
      display:block;
      position:absolute;
      top:0;
      left:0;
      width:100%;
      height:100%;
      box-shadow:inset 0 0 200px 30px rgba(0,0,0,0.6);
      opacity:0;
      cursor:pointer;
      -webkit-transition:all 0.3s linear;
      -moz-transition:all 0.3s linear;
      -ms-transition:all 0.3s linear;
      transition:all 0.3s linear;
	  }
    .anime02:hover:before {
      opacity:1;
    }
&lt;/style&gt;
&lt;p class=&quot;img01 waku01 anime02&quot;&gt;&lt;img src=&quot;https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg&quot; width=&quot;500&quot; height=&quot;500&quot; alt=&quot;ブランケットを羽織った女性&quot; /&gt;&lt;/p&gt;
</pre> <br />
<p>ベタのマスクを乗っけるよりも、こっちのほうがおしゃれにみえますね。</p>
<br />
<br />
<div style="border:2px solid #8A4E03; padding:10px; width:auto;">
  <p>※ やのっぱさんのちょっとした豆知識(´・ω・｀)ﾏﾒﾖｰ</p>
  <p>今回、ソースを見ていただくとわかるように、擬似要素に擬似クラスを振っています。</p>
  <p>擬似要素とは<strong>:before</strong>とか<strong>:after</strong>で、擬似クラスとは<strong>:hover</strong>とか<strong>:active</strong>とか<strong>:first-child</strong>とかですね。<br />
    で、こちらを組み合わせるときには順番に決まりがありますのでご注意です。<br />
    要素＋擬似クラス＋擬似要素の順番に記述しないと動作しません。<br />
    たとえば、<strong>.test:before:hover</strong>ではなく、<strong>.test:hover:before</strong>という順番で記述します。<br />
    擬似擬似コンビは使い勝手良いのですが、こういう決まり事があるので覚えておくと良いと思います(´・ω・｀)ｂ</p>
</div>
<br />
<br />
<p>次にちょっと余計な動きを入れてみました。<br />
  目にうるさいのでおすすめはしませんが、このような動きも付けることができます。</p>
<p style="text-align:center;"><strong>中央で回転</strong></p>
<style>
	  .anime03:before {
      content:" ";
      display:block;
      position:absolute;
      top:0;
      left:0;
      width:100%;
      height:100%;
      box-shadow:inset 0 0 200px 30px rgba(0,0,0,0.6);
      border-radius:100%;
      opacity:0;
      cursor:pointer;
      
      -webkit-transform: rotate(180deg) scale(0);
      transform: rotate(180deg) scale(0);
      
      -webkit-transition:all .3s linear;
      transition:all .3s linear;
	  }
    .anime03:hover:before {
      border-radius:0%;
      -webkit-transform: rotate(0deg) scale(1);
      transform: rotate(0deg) scale(1);
      
      opacity:1;
    }
</style>
<p class="img01 waku01 anime03"><img src="https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg" width="500" height="500" alt="ブランケットを羽織った女性" /></p>
<br />
<pre class="brush: xml; title: ; notranslate">
&lt;style&gt;
	  .anime03:before {
      content:&quot; &quot;;
      display:block;
      position:absolute;
      top:0;
      left:0;
      width:100%;
      height:100%;
      box-shadow:inset 0 0 200px 30px rgba(0,0,0,0.6);
      border-radius:100%;
      opacity:0;
      cursor:pointer;
      
      -webkit-transform: rotate(180deg) scale(0);/* 要素を回転表示させる scale：拡大縮小値 */
      transform: rotate(180deg) scale(0);
      
      -webkit-transition:all .3s linear;
      transition:all .3s linear;
	  }
    .anime03:hover:before {
      border-radius:0%;
      -webkit-transform: rotate(0deg) scale(1);
      transform: rotate(0deg) scale(1);
      
      opacity:1;
    }
&lt;/style&gt;
&lt;p class=&quot;img01 waku01 anime03&quot;&gt;&lt;img src=&quot;https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg&quot; width=&quot;500&quot; height=&quot;500&quot; alt=&quot;ブランケットを羽織った女性&quot; /&gt;&lt;/p&gt;
</pre> <br />
<p style="text-align:center;"><strong>横にくるっとする</strong></p>
<style>
	  .anime04:before {
      content:" ";
      display:block;
      position:absolute;
      top:0;
      left:0;
      width:100%;
      height:100%;
      background:rgba(0,0,0,0.3);
      opacity:0;
      cursor:pointer;
      
      -webkit-transform: rotateY(180deg);
      transform: rotateY(180deg);
      
      -webkit-transition:all .3s linear;
      transition:all .3s linear;
	  }
    .anime04:hover:before {
      -webkit-transform: rotateY(0deg);
      transform: rotateY(0deg);
      
      opacity:1;
    }
</style>
<p class="img01 waku01 anime04"><img src="https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg" width="500" height="500" alt="ブランケットを羽織った女性" /></p>
<br />
<pre class="brush: xml; title: ; notranslate">
&lt;style&gt;
	  .anime04:before {
      content:&quot; &quot;;
      display:block;
      position:absolute;
      top:0;
      left:0;
      width:100%;
      height:100%;
      background:rgba(0,0,0,0.3);
      opacity:0;
      cursor:pointer;
      
      -webkit-transform: rotateY(180deg);/* Y軸方向へ回転 */
      transform: rotateY(180deg);
      
      -webkit-transition:all .3s linear;
      transition:all .3s linear;
	  }
    .anime04:hover:before {
      -webkit-transform: rotateY(0deg);
      transform: rotateY(0deg);
      
      opacity:1;
    }
&lt;/style&gt;
&lt;p class=&quot;img01 waku01 anime04&quot;&gt;&lt;img src=&quot;https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg&quot; width=&quot;500&quot; height=&quot;500&quot; alt=&quot;ブランケットを羽織った女性&quot; /&gt;&lt;/p&gt;
</pre> <br />
<p style="text-align:center;"><strong>縦もできちゃう</strong></p>
<style>
	  .anime05:before {
      content:" ";
      display:block;
      position:absolute;
      top:0;
      left:0;
      width:100%;
      height:100%;
      background:rgba(0,0,0,0.3);
      opacity:0;
      cursor:pointer;
      
      -webkit-transform: rotateX(180deg);
      transform: rotateX(180deg);
      
      -webkit-transition:all .3s linear;
      transition:all .3s linear;
	  }
    .anime05:hover:before {
      -webkit-transform: rotateX(0deg);
      transform: rotateX(0deg);
      
      opacity:1;
    }
</style>
<p class="img01 waku01 anime05"><img src="https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg" width="500" height="500" alt="ブランケットを羽織った女性" /></p>
<br />
<pre class="brush: xml; title: ; notranslate">
&lt;style&gt;
	  .anime05:before {
      content:&quot; &quot;;
      display:block;
      position:absolute;
      top:0;
      left:0;
      width:100%;
      height:100%;
      background:rgba(0,0,0,0.3);
      opacity:0;
      cursor:pointer;
      
      -webkit-transform: rotateX(180deg);/* X軸方向へ回転 */
      transform: rotateX(180deg);
      
      -webkit-transition:all .3s linear;
      transition:all .3s linear;
	  }
    .anime05:hover:before {
      -webkit-transform: rotateX(0deg);
      transform: rotateX(0deg);
      
      opacity:1;
    }
&lt;/style&gt;
&lt;p class=&quot;img01 waku01 anime05&quot;&gt;&lt;img src=&quot;https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg&quot; width=&quot;500&quot; height=&quot;500&quot; alt=&quot;ブランケットを羽織った女性&quot; /&gt;&lt;/p&gt;
</pre> <br />
<p style="text-align:center;"><strong>外からふわっと</strong></p>
<style>
	  .anime06:before {
      content:" ";
      display:block;
      position:absolute;
      top:0;
      left:0;
      width:100%;
      height:100%;
      box-shadow:inset 0 0 200px 30px rgba(0,0,0,0.6);
      opacity:0;
      cursor:pointer;
      
      -webkit-transform: scale(5);
      transform: scale(5);
      
      -webkit-transition:all .4s ease;
      transition:all .4s ease;
      
      -webkit-transform: scale(1);
      transform: scale(1);
	  }
    .anime06:hover:before {
      -webkit-transform: scale(1);
      transform: scale(1);
      
      opacity:1;
    }
</style>
<p class="img01 waku01 anime06"><img src="https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg" width="500" height="500" alt="ブランケットを羽織った女性" /></p>
<pre class="brush: xml; title: ; notranslate">
&lt;style&gt;
	  .anime06:before {
      content:&quot; &quot;;
      display:block;
      position:absolute;
      top:0;
      left:0;
      width:100%;
      height:100%;
      box-shadow:inset 0 0 200px 30px rgba(0,0,0,0.6);
      opacity:0;
      cursor:pointer;
      
      -webkit-transform: scale(5);
      transform: scale(5);
      
      -webkit-transition:all .4s ease;
      transition:all .4s ease;
      
      -webkit-transform: scale(1);
      transform: scale(1);

	  }
    .anime06:hover:before {
      -webkit-transform: scale(1);
      transform: scale(1);
      
      opacity:1;
    }
&lt;/style&gt;
&lt;p class=&quot;img01 waku01 anime06&quot;&gt;&lt;img src=&quot;https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg&quot; width=&quot;500&quot; height=&quot;500&quot; alt=&quot;ブランケットを羽織った女性&quot; /&gt;&lt;/p&gt;
</pre>
<p>このように、擬似要素にtransitionやtransformを加えることで色々な動きを作ることができます。<br />
行き過ぎたエフェクトは目にうるさく、ごちゃっとした印象になってしまいますが、さり気なくつけると、おっ！おしゃれっ！と言った感じになりますね。<br />
ポイントはやり過ぎない、これです(´・ω・｀)ﾀﾞﾒﾖｰﾀﾞﾒﾀﾞﾒ<br />
ほとんどがtransitionとtransformの使い方のようになりましたが、hover時のエフェクトのお話でした(´・ω・｀)ﾉｼ</p>]]></content:encoded>
			<wfw:commentRss>https://taneppa.net/css3_03/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>【CSS3】で写真に色々装飾を加えてみた（box-shadow編【IE9以前は非推奨】</title>
		<link>https://taneppa.net/css3_02/</link>
		<comments>https://taneppa.net/css3_02/#comments</comments>
		<pubDate>Mon, 26 Jan 2015 06:26:27 +0000</pubDate>
		<dc:creator>yanoppa!</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[コーディング]]></category>
		<category><![CDATA[初心者向け]]></category>

		<guid isPermaLink="false">https://taneppa.net/?p=2043</guid>
		<description><![CDATA[どうもおはこんばんちわ、トメィトゥが大好きなやのっぱです(´・ω・｀) リコピン♪リコピン♪(*´ω｀*) 今 [...]]]></description>
				<content:encoded><![CDATA[
<p><span style="font-size: 13px;">どうもおはこんばんちわ、トメィトゥが大好きなやのっぱです(´・ω・｀)</span></p>
<p>リコピン♪リコピン♪(*´ω｀*)</p>
<p>今回もCSSで装飾するよ！<br /> 前回→<a href="https://taneppa.net/css3_01/"><strong>【CSS3】</strong>で写真に色々装飾を加えてみた(<strong>枠・写真加工編</strong>)<strong>【IE9以前は非推奨】</strong></a></p>
<p>さて、今回はbox-shadowを使って色々作ってみようと思います。<br /> <strong>box-shadow</strong>が実装されて、今までわざわざ画像にしたり、どこできったらいいのかわからなかったり、予定より画像がでかくなってこまっていた<br /> あのドロップシャドウをCSSで表現できるようになりました。</p>
<p>これで画像の量も減るし、楽になりますね！</p>
<p>前回でも少し使用しましたが、今回は影の形を変えることで写真などの浮き表現を変えたりしていきます。</p>
<p>記述がすこし面倒ですが、サムネイルなどに使う場合一つ作ってしまえば増えても増えても同じ効果をつけれるので便利です。<br /> それでは、作っていきましょう！</p>
<h3>下準備</h3>
<p>今回も前回と同じ写真をつかいます。</p>
<p>前回と同様に可変仕様にして、今回widthを半分にして小さくし、枠も付けてあげます。。</p>
<style><!--
.img01 {
	    width:250px;
	    margin:0 auto;
	    box-sizing:border-box;/* borderとpaddingをwidthに含める */
	    -moz-box-sizing:border-box;
	    -webkit-box-sizing:border-box;
	    -ms-box-sizing:border-box;
	  }
    .waku01{
	    padding:7px;
	    background:#fff;
      border:1px solid #ccc;
	  }
	  .img01 img {
	    width:100%;
	    height:auto;
	    vertical-align:top;
	  }
--></style>
<p class="img01 waku01"><img alt="ブランケットを羽織った女性" src="https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg" width="500" height="500" /></p>
<pre class="brush: xml; title: ; notranslate">
  &lt;style&gt;
	  .img01 {
	    width:250px;
	    margin:0 auto;
	    box-sizing:border-box;/* borderとpaddingをwidthに含める */
	    -moz-box-sizing:border-box;
	    -webkit-box-sizing:border-box;
	    -ms-box-sizing:border-box;
	  }
    .waku01{
	    padding:7px;
	    background:#fff;
      border:1px solid #ccc;
	  }
	  .img01 img {
	    width:100%;
	    height:auto;
	    vertical-align:top;
	  }
	&lt;/style&gt;
  &lt;p class=&quot;img01 waku01&quot;&gt;&lt;img src=&quot;https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg&quot; width=&quot;500&quot; height=&quot;500&quot; alt=&quot;ブランケットを羽織った女性&quot; /&gt;&lt;/p&gt;
</pre><br /><br />
<p><br /><br /></p>
<p><br /><br /></p>
<p>それでは、基本の影をつけてみます</p>
<h3><strong>box-shadow</strong>を使う</h3>
<p>box-shadowの使い方をおさらいしておきます。</p>
<p>例）</p>
<p>box-shadow:10px 10px 10px 10px rgba(0,0,0,0.2)<br /> box-shadow:y方向のオフセット x方向のオフセット ぼかし 広がり 色</p>
<p>という感じです。※現在最新のモダンブラウザはベンダープレフィックスいらなくなってます<br /> <br /> では、実際につけてみます。</p>
<style><!--
.shadow01 {
    box-shadow:2px 2px 4px 0 rgba(0,0,0,0.2);
  }
--></style>
<p class="img01 waku01 shadow01"><img alt="ブランケットを羽織った女性" src="https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg" width="500" height="500" /></p>
<pre class="brush: xml; title: ; notranslate">
  &lt;style&gt;
    .shadow01 {
      box-shadow:2px 2px 4px 0 rgba(0,0,0,0.2);
    }
  &lt;/style&gt;
  &lt;p class=&quot;img01 waku01 shadow01&quot;&gt;&lt;img src=&quot;https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg&quot; width=&quot;500&quot; height=&quot;500&quot; alt=&quot;ブランケットを羽織った女性&quot; /&gt;&lt;/p&gt;
</pre><br /><br />
<p><br /><br /></p>
<p><br /><br /></p>
<p>マイナスの値を与えることで逆などもできます</p>
<style><!--
.shadow02 {
    box-shadow:-2px -2px 4px 0 rgba(0,0,0,0.2);
  }
--></style>
<p class="img01 waku01 shadow02"><img alt="ブランケットを羽織った女性" src="https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg" width="500" height="500" /></p>
<pre class="brush: xml; title: ; notranslate">
&lt;style&gt;
  .shadow02 {
    box-shadow:-2px -2px 4px 0 rgba(0,0,0,0.2);
  }
&lt;/style&gt;
&lt;p class=&quot;img01 waku01 shadow02&quot;&gt;&lt;img src=&quot;https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg&quot; width=&quot;500&quot; height=&quot;500&quot; alt=&quot;ブランケットを羽織った女性&quot; /&gt;&lt;/p&gt;
</pre><br /><br />
<p><br /><br /></p>
<p><br /><br /></p>
<style><!--
.shadow03 {
    box-shadow:2px -2px 4px 0 rgba(0,0,0,0.2);
  }
--></style>
<p class="img01 waku01 shadow03"><img alt="ブランケットを羽織った女性" src="https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg" width="500" height="500" /></p>
<pre class="brush: xml; title: ; notranslate">
&lt;style&gt;
  .shadow03 {
    box-shadow:2px -2px 4px 0 rgba(0,0,0,0.2);
  }
&lt;/style&gt;
&lt;p class=&quot;img01 waku01 shadow03&quot;&gt;&lt;img src=&quot;https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg&quot; width=&quot;500&quot; height=&quot;500&quot; alt=&quot;ブランケットを羽織った女性&quot; /&gt;&lt;/p&gt;
</pre><br /><br />
<p><br /><br /></p>
<p><br /><br /></p>
<p>こんなかんじで四方に影を落とすことができます。<br /> 「,」カンマを使うことで、いくつも重ねてつかえます。<br /> 例えば、ボタンを作るときなどによく重ねて使います。（imgがあると内側の影が見えないのでDIVでボタンっぽいのをつくってみます。）</p>
<style><!--
.box1 {
    width:200px;
    height:40px;
    margin:0 auto;
    background:#209FFB;
  }
  .shadow04 {
    box-shadow:inset -2px -2px 4px 0 rgba(0,0,0,0.2),inset 2px 2px 2px 0 rgba(255,255,255,1);
  }/* insetは内側に影を付けたいときに使います。 */
--></style>
<div class="box1 shadow04"></div>
<pre class="brush: xml; title: ; notranslate">
&lt;style&gt;
  .box1 {
    width:200px;
    height:40px;
    margin:0 auto;
    background:#209FFB;
  }
  .shadow04 {
    box-shadow:inset -2px -2px 4px 0 rgba(0,0,0,0.2),inset 2px 2px 2px 0 rgba(255,255,255,1);
  }/* insetは内側に影を付けたいときに使います。 */
&lt;/style&gt;
&lt;div class=&quot;box1 shadow04&quot;&gt;&lt;/div&gt;
</pre><br /><br />
<p><br /><br /></p>
<p><br /><br /></p>
<p>少しそれましたが、これでbox-shadowの基本は終わりです。<br /> これを駆使してシャドウやハイライトを表現していきます。</p>
<p>それでは本題のすこし変わった影を作っていきます。</p>
<h3>擬似要素を使って色々な影を表現してみる</h3>
<p>今回も擬似要素:before :afterを使います。</p>
<p>まずは、定番の左右に影をつけて、浮いたように見せるあれです。</p>
<style><!--
.shadow05 {
    position:relative;
  }
  .shadow05:before,.shadow05:after {
    content: "";
    position: absolute;
    bottom: 3px;
    left: 3px;
    z-index: -1;
    width: 50%;
    height: 5px;
    box-shadow: 0 4px 6px 0 rgba(0,0,0,0.3);
    -webkit-transform: rotate(-3deg);
    -moz-transform: rotate(-3deg);
    -ms-transform: rotate(-3deg);
    transform: rotate(-3deg);
  }
  .shadow05:after {
    right:3px;
    left:auto;
    -webkit-transform:rotate(3deg);
    -moz-transform:rotate(3deg);
    -ms-transform:rotate(3deg);
    transform:rotate(3deg);
  }
--></style>
<p class="img01 waku01 shadow05"><img alt="ブランケットを羽織った女性" src="https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg" width="500" height="500" /></p>
<pre class="brush: xml; title: ; notranslate">
&lt;style&gt;
  .shadow05 {
    position:relative;
  }
  .shadow05:before,
  .shadow05:after {
    content: &quot;&quot;;
    position: absolute;
    bottom: 3px;
    left: 3px;
    z-index: -1;
    width: 50%;
    height: 5px;
    box-shadow: 0 4px 6px 0 rgba(0,0,0,0.3);
    -webkit-transform: rotate(-3deg);
    -moz-transform: rotate(-3deg);
    -ms-transform: rotate(-3deg);
    transform: rotate(-3deg);
  }
  .shadow05:after {
    right:3px;
    left:auto;
    -webkit-transform:rotate(3deg);
    -moz-transform:rotate(3deg);
    -ms-transform:rotate(3deg);
    transform:rotate(3deg);
  }
&lt;/style&gt;
&lt;p class=&quot;img01 waku01 shadow05&quot;&gt;&lt;img src=&quot;https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg&quot; width=&quot;500&quot; height=&quot;500&quot; alt=&quot;ブランケットを羽織った女性&quot; /&gt;&lt;/p&gt;
</pre><br /><br />
<p><br /><br /></p>
<p><br /><br /></p>
<p>よく見るやつですね♪<br /> これを作れるようになれば、あとは全部応用です。<br /> 左だけ右だけもbeforeだけにして、右だけの場合はafterのpositionとtransformをbeforeに移すだけです。</p>
<style><!--
.shadow05_1 {
    position:relative;
  }
  .shadow05_1:before {
    content: "";
    position: absolute;
    bottom: 3px;
    left: 3px;
    z-index: -1;
    width: 50%;
    height: 5px;
    box-shadow: 0 4px 6px 0 rgba(0,0,0,0.3);
    -webkit-transform: rotate(-3deg);
    -moz-transform: rotate(-3deg);
    -ms-transform: rotate(-3deg);
    transform: rotate(-3deg);
  }
--></style>
<p class="img01 waku01 shadow05_1"><img alt="ブランケットを羽織った女性" src="https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg" width="500" height="500" /></p>
<pre class="brush: xml; title: ; notranslate">
&lt;style&gt;
  .shadow05_1 {
    position:relative;
  }
  .shadow05_1:before {
    content: &quot;&quot;;
    position: absolute;
    bottom: 3px;
    left: 3px;
    z-index: -1;
    width: 50%;
    height: 5px;
    box-shadow: 0 4px 6px 0 rgba(0,0,0,0.3);
    -webkit-transform: rotate(-3deg);
    -moz-transform: rotate(-3deg);
    -ms-transform: rotate(-3deg);
    transform: rotate(-3deg);
  }
&lt;/style&gt;
&lt;p class=&quot;img01 waku01 shadow05_1&quot;&gt;&lt;img src=&quot;https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg&quot; width=&quot;500&quot; height=&quot;500&quot; alt=&quot;ブランケットを羽織った女性&quot; /&gt;&lt;/p&gt;
</pre><br /><br />
<p><br /><br /></p>
<p><br /><br /></p>
<style><!--
.shadow05_2 {
    position:relative;
  }
  .shadow05_2:before {
    content: "";
    position: absolute;
    bottom: 3px;
    right: 3px;
    z-index: -1;
    width: 50%;
    height: 5px;
    box-shadow: 0 4px 6px 0 rgba(0,0,0,0.3);
    -webkit-transform: rotate(3deg);
    -moz-transform: rotate(3deg);
    -ms-transform: rotate(3deg);
    transform: rotate(3deg);
  }
--></style>
<p class="img01 waku01 shadow05_2"><img alt="ブランケットを羽織った女性" src="https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg" width="500" height="500" /></p>
<pre class="brush: xml; title: ; notranslate">
&lt;style&gt;
  .shadow05_2 {
    position:relative;
  }
  .shadow05_2:before {
    content: &quot;&quot;;
    position: absolute;
    bottom: 3px;
    right: 3px;
    z-index: -1;
    width: 50%;
    height: 5px;
    box-shadow: 0 4px 6px 0 rgba(0,0,0,0.3);
    -webkit-transform: rotate(3deg);
    -moz-transform: rotate(3deg);
    -ms-transform: rotate(3deg);
    transform: rotate(3deg);
  }
&lt;/style&gt;
&lt;p class=&quot;img01 waku01 shadow05_2&quot;&gt;&lt;img src=&quot;https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg&quot; width=&quot;500&quot; height=&quot;500&quot; alt=&quot;ブランケットを羽織った女性&quot; /&gt;&lt;/p&gt;
</pre><br /><br />
<p><br /><br /></p>
<p><br /><br /></p>
<p>付箋などの表現にも使えそうですね(*´ω｀*)</p>
<p><strong>縦方向にアーチしたような影</strong></p>
<style><!--
.shadow06 {
    position: relative;
    box-shadow: inset 0px 7px 16px -4px rgba(0,0,0,0.1),
                inset 0 -7px 16px -4px rgba(0,0,0,0.1);
  }
  .shadow06:before,
  .shadow06:after {
    content: "";
    position: absolute;
    bottom: 17%;
    left: 11px;
    z-index: -1;
    width: 4%;
    height: 50%;
    box-shadow: 1px 0px 10px 0 rgba(0,0,0,1);
    -webkit-transform: skew(4deg,95deg);
    -moz-transform: skew(4deg,95deg);
    -ms-transform: skew(4deg,95deg);
    transform: skew(4deg,95deg);
  }
  .shadow06:after {
    right:14px;
    left:auto;
  }
--></style>
<p class="img01 waku01 shadow06"><img alt="ブランケットを羽織った女性" src="https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg" width="500" height="500" /></p>
<pre class="brush: xml; title: ; notranslate">
&lt;style&gt;
  .shadow06 {
    position: relative;
    box-shadow: inset 0px 7px 16px -4px rgba(0,0,0,0.1),
                inset 0 -7px 16px -4px rgba(0,0,0,0.1);
  }
  .shadow06:before,
  .shadow06:after {
    content: &quot;&quot;;
    position: absolute;
    bottom: 17%;
    left: 11px;
    z-index: -1;
    width: 4%;
    height: 50%;
    box-shadow: 1px 0px 10px 0 rgba(0,0,0,1);
    -webkit-transform: skew(4deg,95deg);
    -moz-transform: skew(4deg,95deg);
    -ms-transform: skew(4deg,95deg);
    transform: skew(4deg,95deg);
  }
  .shadow06:after {
    right:14px;
    left:auto;
  }
&lt;/style&gt;
&lt;p class=&quot;img01 waku01 shadow06&quot;&gt;&lt;img src=&quot;https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg&quot; width=&quot;500&quot; height=&quot;500&quot; alt=&quot;ブランケットを羽織った女性&quot; /&gt;&lt;/p&gt;
</pre><br /><br />
<p><br /><br /></p>
<p><br /><br /></p>
<p>ちょっと雑ですが、このようなこともできます♪</p>
<p>他にも意外とつくろうと思えばいくらでも作れたりします。<br /> 基本は擬似要素を使うことですね。<br /> 擬似要素便利♪</p>
<p>最後にbox-shadowはborderとしても使えます。<br /> 普通のborderよりもbox-shadowで作ったほうが雰囲気よかったりもするので使ってみるのも良いかと思います。</p>
<style><!--
.shadow07 {
    padding: 7px;
    background:#fff;
    box-shadow: 0 0 1px 0 rgba(0,0,0,0.3);
  }
--></style>
<p class="img01 shadow07"><img alt="ブランケットを羽織った女性" src="https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg" width="500" height="500" /></p>
<p>すこしぼかしが効いてリッチな雰囲気とか出そうです♪<br /> 今回は影として使いましたが、光彩としてもつかえます。<br /> 工夫次第でいろんな表現が可能ですね。</p>
<p>是非、色々と試してみてください。</p>
<p>それでは！良きコーディングライフを～(・ω&lt;)ﾉｼ</p>
]]></content:encoded>
			<wfw:commentRss>https://taneppa.net/css3_02/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>【CSS3】で写真に色々装飾を加えてみた border-imageなど (枠・写真加工編【IE9以前は非推奨】</title>
		<link>https://taneppa.net/css3_01/</link>
		<comments>https://taneppa.net/css3_01/#comments</comments>
		<pubDate>Fri, 16 Jan 2015 00:21:43 +0000</pubDate>
		<dc:creator>yanoppa!</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Web制作]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[コーディング]]></category>
		<category><![CDATA[初心者向け]]></category>

		<guid isPermaLink="false">https://taneppa.net/?p=2018</guid>
		<description><![CDATA[どうもおはこんばんちわ、暑がりで寒がりな面倒くさいやつ…やのっぱです(´・ω・｀)おほー 今回はお役立ち記事が [...]]]></description>
				<content:encoded><![CDATA[
<div style="line-height: 2;">
<p><span style="line-height: 2; font-size: 13px;">どうもおはこんばんちわ、暑がりで寒がりな面倒くさいやつ…やのっぱです(´・ω・｀)おほー</span></p>
<p>今回はお役立ち記事が思い浮かばないので、装飾つくって遊んだだけです。</p>
<p>こういうのお好きな方は参考にしたり、もっとこうしたほうがいいよね…など考える材料にしたりしていただけると幸いです。<br /> なお、今回IE9～6は無視してます。border-imageなどがIE10以降実装になってるからですね。<br /> IEでも表示したい！って方は<a href="http://css3pie.com/" target="_blank">CSS3 PIE</a>や<a href="http://www.useragentman.com/blog/csssandpaper-a-css3-javascript-library/" target="_blank">cssSandpaper</a>を使って対応させると良いですよ(´・ω・｀)ｂ</p>
<br />
<p>今回写真は<a href="http://www.pakutaso.com/" target="_blank">「ぱくたそ」</a>さんから拝借いたしました。<br /> 写真のチョイスは僕の趣味ですｗ 包まる娘っていいよね♪(´・ω・｀)</p>
<br />
<p><img alt="ブランケットを羽織った女性" src="https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg" width="500" height="500" /></p>
<br />
<p>それではちょこちょこやっていきましょう！</p>
<br />
<p>まずは、borderとかpaddingを使用した時に要素のサイズが変わるのを防ぐため、box-sizingを使用します。<br /> 次にimgを可変可能にしておきます。<br /> これをしておくことで、とりあえず置いた画像のサイズをいちいち変えなくても崩れず編集していくことができます。</p>
<pre class="brush: xml; title: ; notranslate">
  &lt;p class=&quot;img01&quot;&gt;&lt;img src=&quot;photo.jpg&quot; width=&quot;500&quot; height=&quot;500&quot; alt=&quot;ブランケットを羽織った女性&quot; /&gt;&lt;/p&gt;
  </pre><br /><br /><br /><br /><pre class="brush: xml; title: ; notranslate">
  &lt;style&gt;
	  .img01 {
	    max-width:500px;
	    margin:0 auto;
	    box-sizing:border-box;/* borderとpaddingをwidthに含める */
	    -moz-box-sizing:border-box;
	    -webkit-box-sizing:border-box;
	    -ms-box-sizing:border-box;
	  }
	  .img01 img {
	    width:100%;
	    height:auto;
	    vertical-align:top;
	  }
	&lt;/style&gt;
  </pre><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
<h3>枠を付ける編</h3>
<br />
<p>では、まずはちょっと古臭いけど、白枠を付けてみます。(装飾用のclassを別に振ります)</p>
<style><!--
.img01 {
	    max-width:500px;
	    margin:0 auto;
	    box-sizing:border-box;
	    -moz-box-sizing:border-box;
	    -webkit-box-sizing:border-box;
	    -ms-box-sizing:border-box;
	  }
	  .img01 img {
	    width:100%;
	    height:auto;
	    vertical-align:top;
	  }
	  .waku01{
	    padding:7px;
	    border:1px solid #ccc;
	    background:#fff;
	  }
--></style>
<p class="img01 waku01"><img alt="ブランケットを羽織った女性" src="https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg" width="500" height="500" /></p>
<pre class="brush: xml; title: ; notranslate">
  &lt;style&gt;
	  .waku01{
	    padding:7px;
	    border:1px solid #ccc;
	    background:#fff;
	  }
	&lt;/style&gt;
  </pre><br /><br /><br /><br /><pre class="brush: xml; title: ; notranslate">
  &lt;p class=&quot;img01 waku01&quot;&gt;&lt;img src=&quot;photo.jpg&quot; width=&quot;500&quot; height=&quot;500&quot; alt=&quot;ブランケットを羽織った女性&quot; /&gt;&lt;/p&gt;
  </pre><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
<p>うん…普通ですね…ではちょっと影とか付けてみます。</p>
<style><!--
.waku01.shadow {
	    box-shadow: 1px 1px 5px rgba(20,20,20,0.2);
	  }
--></style>
<p class="img01 waku01 shadow"><img alt="ブランケットを羽織った女性" src="https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg" width="500" height="500" /></p>
<pre class="brush: xml; title: ; notranslate">
  &lt;style&gt;
	  .waku01 {
	    padding:7px;
	    border:1px solid #ccc;
	    background:#fff;
	    box-shadow: 1px 1px 5px rgba(20,20,20,0.2);/* ドロップシャドウ 【横位置 縦位置 ぼかし幅 色】の順に記述 */
	  }
	&lt;/style&gt;
  </pre><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
<p>ちょっとましになりましたが、やっぱ古臭いですねｗ(´・ω・｀)<br /> 次は半透明な枠とか作ってみます。</p>
<p>作り方はimgを内包しているボックスをposition:relative;にして、擬似要素:before :afterを上に乗っける形をとります。<br /> ここから自由度がぐっと上がります。</p>
<style><!--
.waku02 {
	    position:relative;
	  }
	  .waku02:before {
	    content: '';
	    display: block;
	    position: absolute;
	    top: 0;
	    left: 0;
	    width: 100%;
	    height: 100%;
	    box-shadow: inset 0 0 0px 8px rgba(255,255,255,0.6);
	    }
--></style>
<p class="img01 waku02"><img alt="ブランケットを羽織った女性" src="https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg" width="500" height="500" /></p>
<pre class="brush: xml; title: ; notranslate">
  &lt;style&gt;
	  .waku02 {
	    position:relative; /* positionの基準とするためrelativeを与えます。 */
	  }
	  .waku02:before {
	    content: ''; /* このプロパティが無いと擬似要素は機能しません、お決まりの呪文です。 */
	    display: block; /* ブロック要素にします。 */
	    position: absolute; /* absoluteで上に乗っけます。 */
	    top: 0; /* 縦横の値を入れるのは基本です。入れないとだめ！っと思っておくほうが今後の為いいです。 */
	    left: 0;
	    width: 100%;
	    height: 100%;
	    box-shadow: inset 0 0 0px 8px rgba(255,255,255,0.6);
	    }
	&lt;/style&gt;
  &lt;p class=&quot;img01 waku02&quot;&gt;&lt;img src=&quot;photo.jpg&quot; width=&quot;500&quot; height=&quot;500&quot; alt=&quot;ブランケットを羽織った女性&quot; /&gt;&lt;/p&gt;
  </pre><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
<p>すこしだけ角丸にしてみました。<br /> さりげなくがよいです。 過剰な角丸って変になっちゃいますからね！(´・ω・｀)</p>
<style><!--
.waku02.radius img {
	    border-radius: 4px;
	  }
--></style>
<p class="img01 waku02 radius"><img alt="ブランケットを羽織った女性" src="https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg" width="500" height="500" /></p>
<pre class="brush: xml; title: ; notranslate">
  &lt;style&gt;
	  .waku02.radius img {
	    border-radius: 4px;
	  }
	  &lt;/style&gt;
  &lt;p class=&quot;img01 waku02 radius&quot;&gt;&lt;img src=&quot;photo.jpg&quot; width=&quot;500&quot; height=&quot;500&quot; alt=&quot;ブランケットを羽織った女性&quot; /&gt;&lt;/p&gt;
  </pre><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
<p>CSS3からborder-imageというプロパティが追加されました！<br /> borderに画像を貼れるという代物です(´・ω・｀)ｂ</p>
<p>さっそく使ってみましょう！<br /> 紙のテクスチャ貼ったけど、なんだか額みたいですね・・・</p>
<style><!--
.waku02.bImg {
	    border:10px solid #ccc;
	    border-image:url(paper.gif) 15 repeat;
	    -webkit-border-image:url(https://taneppa.net/wp-content/uploads/2014/07/paper.gif) 15 repeat;
	  }
--></style>
<p class="img01 waku02 bImg"><img alt="ブランケットを羽織った女性" src="https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg" width="500" height="500" /></p>
<pre class="brush: xml; title: ; notranslate">
  &lt;style&gt;
	  .waku02.bImg {
	    border:10px solid #ccc;
	    border-image:url(paper.gif) 15 repeat;
	    -webkit-border-image:url(paper.gif) 15 repeat;
	  }
	&lt;/style&gt;
  &lt;p class=&quot;img01 waku02 bImg&quot;&gt;&lt;img src=&quot;photo.jpg&quot; width=&quot;500&quot; height=&quot;500&quot; alt=&quot;ブランケットを羽織った女性&quot; /&gt;&lt;/p&gt;
  </pre><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
<p>額みたいなので、もうちょっと額っぽくしてみます。</p>
<style><!--
.waku02.bImg:before {
	    box-shadow: none;  
	  }
	  .waku02.shadow {
	    box-shadow: 1px 3px 8px rgba(20,20,20,0.3);
	  }
	  .waku02.shadow:before {
	    box-shadow: inset 1px 1px 6px 0px rgba(0,0,0,0.4),
	                -1px -1px 2px rgba(40,40,40,0.2),
	                1px 1px 2px rgba(255,255,255,1);  
	  }
	  .waku02.bWidth {
	    border-width: 16px;
	  }
--></style>
<p class="img01 waku02 bImg shadow bWidth"><img alt="ブランケットを羽織った女性" src="https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg" width="500" height="500" /></p>
<pre class="brush: xml; title: ; notranslate">
  &lt;style&gt;
	  .waku02.bImg:before {
	    box-shadow: none;  
	  }
	  .waku02.shadow {
	    box-shadow: 1px 3px 8px rgba(20,20,20,0.3);
	  }
	  .waku02.shadow:before {
	    box-shadow: inset 1px 1px 6px 0px rgba(0,0,0,0.4),
	                -1px -1px 2px rgba(40,40,40,0.2),
	                1px 1px 2px rgba(255,255,255,1);  
	  }
	  .waku02.bWidth {
	    border-width: 16px;
	  }
	&lt;/style&gt;
  &lt;p class=&quot;img01 waku02 bImg shadow bWidth&quot;&gt;&lt;img src=&quot;photo.jpg&quot; width=&quot;500&quot; height=&quot;500&quot; alt=&quot;ブランケットを羽織った女性&quot; /&gt;&lt;/p&gt;
  </pre><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
<p>shadowを付けることで、少しはそれっぽく？なったと思いたいです。(´・ω・｀)</p>
<br />
<h3>フィルターをかけたような効果を付けてみる。</h3>
<br />
<p>先ほど作った額っぽい感じの中の写真にフィルター効果のようなものを付けてみます。</p>
<style><!--
.filter01:after {
	    content: ' ';
	    display: block;
	    position: absolute;
	    top: 0;
	    left: 0;
	    z-index: 20;
	    width: 100%;
	    height: 100%;
	    background: -moz-linear-gradient(to right bottom, rgba(107, 84, 12, 0.5) 0%, rgba(248, 212, 119, 0.18) 50%,rgba(104, 107, 70, 0.7) 100%);; /* FF3.6+ */
	    background: -webkit-linear-gradient(to right bottom, rgba(107, 84, 12, 0.5) 0%, rgba(248, 212, 119, 0.18) 50%,rgba(104, 107, 70, 0.7) 100%);; /* Chrome10+,Safari5.1+ */
	    background: -ms-linear-gradient(to right bottom, rgba(107, 84, 12, 0.5) 0%, rgba(248, 212, 119, 0.18) 50%,rgba(104, 107, 70, 0.7) 100%);; /* IE10+ */
	    background: linear-gradient(to right bottom, rgba(107, 84, 12, 0.5) 0%, rgba(248, 212, 119, 0.18) 50%,rgba(104, 107, 70, 0.7) 100%); /* W3C */
	  }
--></style>
<p class="img01 waku02 bImg shadow bWidth filter01"><img alt="ブランケットを羽織った女性" src="https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg" width="500" height="500" /></p>
<pre class="brush: xml; title: ; notranslate">
  &lt;style&gt;
	  .filter01:after {
	    content: ' ';
	    display: block;
	    position: absolute;
	    top: 0;
	    left: 0;
	    z-index: 20;
	    width: 100%;
	    height: 100%;
	    background: -moz-linear-gradient(to right bottom, rgba(107, 84, 12, 0.5) 0%, rgba(248, 212, 119, 0.18) 50%,rgba(104, 107, 70, 0.7) 100%);; /* FF3.6+ */
	    background: -webkit-linear-gradient(to right bottom, rgba(107, 84, 12, 0.5) 0%, rgba(248, 212, 119, 0.18) 50%,rgba(104, 107, 70, 0.7) 100%);; /* Chrome10+,Safari5.1+ */
	    background: -ms-linear-gradient(to right bottom, rgba(107, 84, 12, 0.5) 0%, rgba(248, 212, 119, 0.18) 50%,rgba(104, 107, 70, 0.7) 100%);; /* IE10+ */
	    background: linear-gradient(to right bottom, rgba(107, 84, 12, 0.5) 0%, rgba(248, 212, 119, 0.18) 50%,rgba(104, 107, 70, 0.7) 100%); /* W3C */
	  }
	&lt;/style&gt;
  &lt;p class=&quot;img01 waku02 bImg shadow bWidth filter&quot;&gt;&lt;img src=&quot;photo.jpg&quot; width=&quot;500&quot; height=&quot;500&quot; alt=&quot;ブランケットを羽織った女性&quot; /&gt;&lt;/p&gt;
  </pre><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
<p>セピアっぽくなるようにしてみました。<br /> やり方は、beforeでもいいのですが、今回shadowでつかってますので、擬似要素：afterを使って、薄いグラデーションを載せています。<br /> css filterを使えば、セピアとかさくっと出来るのですが、対応ブラウザが限定されるすぎるので今回この方法です。</p>
<p>それではもう一個つくってみます。</p>
<style><!--
.filter02:after {
	    content: ' ';
	    display: block;
	    position: absolute;
	    top: 0;
	    left: 0;
	    z-index: 20;
	    width: 100%;
	    height: 100%;
	    background: -webkit-gradient(radial, center center, 0, center center, 400, from(rgba(255, 255, 255, 0)), to(rgba(255,255,255,1)));
	    background: -moz-radial-gradient(rgba(255, 255, 255, 0) 0%, rgba(255,255,255,1) 150%);
	    background: radial-gradient(rgba(255, 255, 255, 0) 0%, rgba(255,255,255,1) 150%);
	  }
--></style>
<p class="img01 waku02 bImg shadow bWidth filter02"><img alt="ブランケットを羽織った女性" src="https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg" width="500" height="500" /></p>
<pre class="brush: xml; title: ; notranslate">
  &lt;style&gt;
	  .filter02:after {
	    content: ' ';
	    display: block;
	    position: absolute;
	    top: 0;
	    left: 0;
	    z-index: 20;
	    width: 100%;
	    height: 100%;
	    background: -webkit-gradient(radial, center center, 0, center center, 400, from(rgba(255, 255, 255, 0)), to(rgba(255,255,255,1)));
	    background: -moz-radial-gradient(rgba(255, 255, 255, 0) 0%, rgba(255,255,255,1) 150%);
	    background: radial-gradient(rgba(255, 255, 255, 0) 0%, rgba(255,255,255,1) 150%);
	  }
	&lt;/style&gt;
  &lt;p class=&quot;img01 waku02 bImg shadow bWidth filter02&quot;&gt;&lt;img src=&quot;photo.jpg&quot; width=&quot;500&quot; height=&quot;500&quot; alt=&quot;ブランケットを羽織った女性&quot; /&gt;&lt;/p&gt;
  </pre><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
<p>今度は円形グラデーションをつかってみました。(´・ω・｀)ｂ<br /> 雰囲気がガラッとかわりますね！<br /> CSSのグラデーションは記述が面倒くさいですが、作ってしまえばclassを振るだけで同じ効果を得られるので、なんだかんだ便利です♪</p>
<br />
<p>でわ、写真風にもどして、レイアウトを変えてみましょう。</p>
<h3>傾きを使って、工夫してみる</h3>
<br />
<p>まずは写真風にもどして、すこし傾けたりしてみます。</p>
<style><!--
.img01.waku03 {
	    border: 10px solid #fff;
	    box-shadow: 0 0 0 1px #ccc,1px 3px 8px 0 rgba(40,40,40,0.3);
	  }
	  .waku03.rotate01 {
	    -moz-transform:rotate(-3deg);
	    -webkit-transform:rotate(-3deg);
	    -ms-transform:rotate(-3deg);
	    transform:rotate(-3deg);
	  }
	  .waku03.rotate02 {
	    -moz-transform:rotate(1deg);
	    -webkit-transform:rotate(1deg);
	    -ms-transform:rotate(1deg);
	    transform:rotate(1deg);
	  }
--></style>
<p class="img01 waku03 shadow rotate01"><img alt="ブランケットを羽織った女性" src="https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg" width="500" height="500" /></p>
<pre class="brush: xml; title: ; notranslate">
  &lt;style&gt;
	  .img01.waku03 {
	    border: 10px solid #fff;
	    box-shadow: 0 0 0 1px #ccc,1px 3px 8px 0 rgba(40,40,40,0.3);
	  }
	  .waku03.rotate01 {
	    -moz-transform:rotate(-3deg);
	    -webkit-transform:rotate(-3deg);
	    -ms-transform:rotate(-3deg);
	    transform:rotate(-3deg);
	  }
	  .waku03.rotate02 {
	    -moz-transform:rotate(1deg);
	    -webkit-transform:rotate(1deg);
	    -ms-transform:rotate(1deg);
	    transform:rotate(1deg);
	  }
	&lt;/style&gt;
  &lt;p class=&quot;img01 waku03 shadow rotate01&quot;&gt;&lt;img src=&quot;photo.jpg&quot; width=&quot;500&quot; height=&quot;500&quot; alt=&quot;ブランケットを羽織った女性&quot; /&gt;&lt;/p&gt;
  </pre><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
<p>やはりこれも少し傾けるくらいがよいです。<br /> 大げさなのは今の流行りではないですし、安っぽくなってしまいます。</p>
<br />
<p>せっかくなので、先ほど作ったfilterを使ってみましょう！</p>
<p class="img01 waku03 shadow filter01 rotate01"><img alt="ブランケットを羽織った女性" src="https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg" width="500" height="500" /></p>
<br />
<p class="img01 waku03 shadow filter02 rotate02"><img alt="ブランケットを羽織った女性" src="https://taneppa.net/wp-content/uploads/2014/07/TIG93_buranketnikurumarerujyosei500.jpg" width="500" height="500" /></p>
<pre class="brush: xml; title: ; notranslate">
  &lt;p class=&quot;img01 waku03 shadow filter01 rotate01&quot;&gt;&lt;img src=&quot;photo.jpg&quot; width=&quot;500&quot; height=&quot;500&quot; alt=&quot;ブランケットを羽織った女性&quot; /&gt;&lt;/p&gt;
  &lt;br&gt;
  &lt;p class=&quot;img01 waku03 shadow filter02 rotate02&quot;&gt;&lt;img src=&quot;photo.jpg&quot; width=&quot;500&quot; height=&quot;500&quot; alt=&quot;ブランケットを羽織った女性&quot; /&gt;&lt;/p&gt;
  </pre><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
<p>今回はこのくらいで！<br /> 次回は影などの表現をやってみたいと思います。(*´ω｀*)ﾉｼ</p>
</div>
]]></content:encoded>
			<wfw:commentRss>https://taneppa.net/css3_01/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML5でコーディングするとき絶対しておいたほうが良い準備</title>
		<link>https://taneppa.net/html5_1/</link>
		<comments>https://taneppa.net/html5_1/#comments</comments>
		<pubDate>Wed, 05 Nov 2014 03:22:22 +0000</pubDate>
		<dc:creator>yanoppa!</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[コーディング]]></category>
		<category><![CDATA[初心者向け]]></category>

		<guid isPermaLink="false">https://taneppa.net/?p=1962</guid>
		<description><![CDATA[html5shiv, reset css などHTML5でコーディングするときに必ずといってもいいほど必要な記述を紹介します。IEを対象ブラウザにする場合はとくに...!]]></description>
				<content:encoded><![CDATA[
<div style="line-height: 2;">
<p><span style="line-height: 2; font-size: 13px;">おはこんばんちわ、あなたのわたしのやのっぱです(´・ω・｀)おほー</span></p>
<p>最近、HTML5で記述することも多くなってきたのではないでしょうか？<br /> 初めてのHTML5！といった記事を書こうとおもったのですが、収まり効かなくなりそうなので<br /> 小出しにいたします。</p>
<br />
<p>今回は準備編です！<br /> HTMLを勉強したてでHTML5はまだよくわからない！<br /> でもなんだか最新ですごそう！使ってみたい！</p>
<p>そんな声が聞こえてきます（幻聴）</p>
<br />
<p>というわけで、初心者がよく抜けている【記述前にする準備】を紹介するよ(´・ω・｀)ｂ</p>
<br />
<p>まずは、え？なんの準備よ？ってお話ですが、HTML5はモダンブラウザはほぼ対応しています！、しかしながらIEはIE8以前は対応していません。またまたお前かIEェ&#8230;.</p>
<p>どういうことかといいますと、新しく追加されたタグを認識しないのです。articleとかsectionとか&#8230;</p>
<p>なので、IEたんにこれはタグですよ～、箱なんですよ～、ブロック要素なんだよ～と教えてあげなければいけません。</p>
<p>これが初心者さんは意外と知らなくて、IEテストしたときにあれ？めっちゃ崩れてる！あわわっ！！<br /> という場面をよく見かけます。</p>
<p>それではIEにタグを教えてあげましょう！</p>
<br />
<h3>IEにHTML5をある程度対応させるおまじない</h3>
<p>これを</p>
<pre class="brush: xml; title: ; notranslate">
&lt;!--[if lt IE9]&gt;
 &lt;script src=&quot;//html5shiv.googlecode.com/svn/trunk/html5.js&quot;&gt;&lt;/script&gt;
&lt;![endif]--&gt;
</pre><br /><br />
<p>head内に貼り付けます。</p>
<pre class="brush: xml; title: ; notranslate">
&lt;!doctype html&gt;
&lt;html lang=&quot;ja&quot;&gt;
&lt;head&gt;
	&lt;meta charset=&quot;UTF-8&quot;&gt;
	&lt;title&gt;Document&lt;/title&gt;
  &lt;link rel=&quot;stylesheet&quot; href=&quot;style.css&quot; media=&quot;all&quot;&gt;
  &lt;!--[if lt IE9]&gt;
  &lt;script src=&quot;//html5shiv.googlecode.com/svn/trunk/html5.js&quot;&gt;&lt;/script&gt;
  &lt;![endif]--&gt;
  &lt;!-- ↑これです --&gt;
&lt;/head&gt;
&lt;body&gt;
	
&lt;/body&gt;
&lt;/html&gt;
</pre><br /><br />
<p>これでIEに新要素のタグをある程度ブロック要素として認識してくれます。（中には対応していないものもあり）</p>
<p>ついでにHTML5対応のreset.cssも載せておきます。<br /> resetせずに書く方は無視してください。</p>
<pre class="brush: xml; title: ; notranslate">
html, body, div, span, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
abbr, address, cite, code,
del, dfn, em, img, ins, kbd, q, samp,
small, strong, sub, sup, var,
b, i,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, figcaption, figure,
footer, header, hgroup, menu, nav, section, summary,
time, mark, audio, video {
	margin: 0;
	padding: 0;
	border:0;
	outline: 0;
	vertical-align: baseline;
	background:transparent;
}
html {
	overflow: inherit;
	height: 100%;
}
article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section {
	display:block;
}
body {
	font-family: &quot;メイリオ&quot;,&quot;Meiryo&quot;, &quot;ヒラギノ角ゴ Pro W3&quot;,&quot;Hiragino Kaku Gothic Pro&quot;, Osaka, sans-serif;
	color: #333333;
	font-size: 62.5%;
  line-height: 1.6;
	letter-spacing:0;
	-webkit-text-size-adjust: 100%;
}
h1, h2, h3, h4, h5, h6, p, td, th, address {
    font-weight: normal;
    font-size: 1.2em;
}
ol,ul {
	list-style: none;
}

fieldset,img { 
	border: 0;
}
img {
	vertical-align:top;
}
table {
	width:100%;
	border: 0;
	border-collapse: collapse;
	border-spacing: 0;
}
th, td {
	text-align:left;
	vertical-align:top;
}
caption,th {
	text-align: left;
}
address,caption,cite,code,dfn,em,strong,th,var {
	font-style: normal;
	font-weight: normal;
}
sup {
	font-size:62.5%;
	vertical-align: text-top;
}
</pre><br /><br />
<p>基本は押えていますが、作る内容によって追加したり色々いじります。<br /> とりあえず！ということでこれをreset.cssとして貼り付けておくと良いでしょう。</p>
<br />
<p>HTML5で記述するまえに、こういった準備をして自分なりに出来上がったものをテンプレートとして保存しておくことをおすすめします。</p>
<br />
<p>あと個人的にresetはしておいたほうが良いと思います。<br /> 多人数で編集するときなど、なんでここでlist-style入んねん！！！くそっ！<br /> などとなることもあるからですね。</p>
<br />
<p>それでは、よきコーディングライフを～(´・ω・｀)</p>
</div>
]]></content:encoded>
			<wfw:commentRss>https://taneppa.net/html5_1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>【CSS】のショートハンドまとめてみた【プロパティを一括で指定しよう！】</title>
		<link>https://taneppa.net/shorthand/</link>
		<comments>https://taneppa.net/shorthand/#comments</comments>
		<pubDate>Sat, 11 Oct 2014 08:52:37 +0000</pubDate>
		<dc:creator>yanoppa!</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[コーディング]]></category>
		<category><![CDATA[初心者向け]]></category>
		<category><![CDATA[効率化]]></category>

		<guid isPermaLink="false">https://taneppa.net/?p=1969</guid>
		<description><![CDATA[CSSのショートハンドまとめてみました。ショートハンドとは何かなど、HTML・CSS初心者に向けて詳しく紹介します！【プロパティを一括で指定しよう！】]]></description>
				<content:encoded><![CDATA[
<div style="line-height: 2;">
<p><span style="line-height: 2; font-size: 13px;">おはこんばんちわ、たまにデザインすると通常の１７倍くらいストレスがたまるやのっぱです(´・ω・｀)おほー</span></p>
<p><br /> 今回は、後輩にちょっとコーディング手伝わせた時にショートハンド使ってなくて気になったので、CSSの<strong>ショートハンド</strong>についてまとめてみました。</p>
<br />
<p>ショートハンド？なにそれ？ショートケーキかなにか？おいしいの？っという方のためにちょっとご説明します。</p>
<br />
<h3><strong>ショートハンドとは</strong></h3>
<br />
<p><strong>例）</strong></p>
<pre class="brush: xml; title: ; notranslate">
margin-top: 10px;
margin-right: 8px;
margin-bottom: 6px;
margin-left: 20px;
</pre><br /><br />
<p>このように、marginなどは四方向個別に指定できますよね。<br /> しかし、こんなだらだら書くのはかっこ悪いので、スマートに一括指定したのがショートハンドです。</p>
<br />
<p><strong>例）ショートハンド版</strong></p>
<pre class="brush: xml; title: ; notranslate">
margin: 10px 8px 6px 20px; /*上 右 下 左の順*/
</pre><br /><br />
<p>このように短い記述で同じ指定が出来ます。<br /> スマートになって、かっこいいですよね！←ここ重要</p>
<br />
<p>CSSの行数も短くなって、見やすくなります。<br /> 全ページのCSSのをstyle.cssなどに全部記述しなくてはいけない時とか、行数多いとうんざりです(´・ω・｀)</p>
<br />
<p>それでは、よく使うショートハンドをまとめてみます(´・ω・｀)まとめはじまるよー</p>
<br /> <br />
<h3><strong>margin/padding ショートハンド</strong>(指定方法はどちらもいっしょ）</h3>
<pre class="brush: xml; title: ; notranslate">
.className {
  margin: 10px 8px 6px 4px; /* 上 右 下 左 */
  margin: 10px 20px 8px;    /* 上 左右 下 */
  margin: 10px 20px;        /* 上下 左右 */
  margin: 20px;             /* 四方向共通 */
}
</pre><br /><br /><br />
<p>基本<strong>時計回り</strong>ですね。<br /> この方式は四方向の指定ができるプロパティほぼすべてに使えます。</p>
<br />
<h3>他の使用可能プロパティ</h3>
<br />
<p><strong>・border-width(枠線の太さ）</strong></p>
<p><strong>例）</strong></p>
<pre class="brush: xml; title: ; notranslate">
.className {
  border-width: 2px 1px 2px; /* こんな感じ */
}
</pre><br /><br /><br />
<p><strong>・border-style(線の種類)</strong></p>
<p><strong>例）</strong></p>
<pre class="brush: xml; title: ; notranslate">
.className {
  border-style: solid dashed double dotted; /* 上:直線 右:破線 下:二重線 左:点線 */
}
</pre><br /><br /><br />
<p><strong>・border-color(線の色）</strong></p>
<p><strong>例）</strong></p>
<pre class="brush: xml; title: ; notranslate">
.className {
  border-color: red blue grey green; /* 上:赤 右:青 下:灰色 左:緑 */
}
</pre><br /><br /><br />
<p><strong>・border-radius(角丸指定)</strong></p>
<p>※border-radiusは角の指定なので上下左右ではなく、四角の指定にかわります。</p>
<p><strong>例）</strong></p>
<pre class="brush: xml; title: ; notranslate">
.className {
  border-radius: 3px 5px 7px 9px; /* 左上 右上 右下 左下 */
  border-radius: 3px 5px 7px;     /* 左上 右上左下 右下 */
  border-radius: 5px 7px;         /* 左上右下 右上左下 */
  border-radius: 5px;             /* 四つ角共通 */
}
</pre><br /><br /><br />
<p>時計回り型ショートハンドはこんな感じでした。</p>
<br />
<p>次にbackgroundプロパティのショートハンド</p>
<br /> <br />
<h3><strong>background</strong></h3>
<br />
<p><strong>例）</strong></p>
<pre class="brush: xml; title: ; notranslate">
.className {
  background-image: url(bgimg.jpg);  /* 画像 */
  background-position: left bottom;  /* 表示位置 */
  background-repeat: repeat-x;       /* 繰り返し */
  background-color: red;             /* 背景色 */
  background-attachment: fixed;      /* scroll(一緒にスクロール)かfixed(画面に固定) */
}
</pre><br /><br /><br />
<p>backgrondを分解するとこのようなプロパティにわかれます。</p>
<br />
<p>これを<strong>ショートハンド</strong>で記述すると</p>
<br />
<p><strong>例）ショートハンド版</strong></p>
<pre class="brush: xml; title: ; notranslate">
.className {
  backgrond: url(bgimg.jpg) left bottom repeat-x red fixed;
}
</pre><br /><br /><br />
<p>っとなります。<br /> 短くて素敵ですね。<br /> 気をつけないと行けないところは、positionの記述ですね。基本、左右 上下の順に記述します。</p>
<br />
<p>あと、backgrond-sizeはたぶんショートハンド化は出来なかったと思うので書いてないです。<br /> background-positionと記述がかぶるからだと思われます。</p>
<br />
<p>記述順に特に決まりはありませんが、自分なりの順番を決めておくことをおすすめします。</p>
<br />
<p>最後にfontのショートハンドです。</p>
<br /> <br />
<h3><strong>font</strong></h3>
<br />
<p><strong>例）</strong></p>
<pre class="brush: xml; title: ; notranslate">
.className {
  font-style: normal;
  font-variant:normal;
  font-weight:bold;
  font-size:140%;
  line-height:1.6;
  font-family:&quot;ヒラギノ角ゴ Pro W3&quot;, &quot;Hiragino Kaku Gothic Pro&quot;, &quot;メイリオ&quot;, Meiryo, Osaka, &quot;ＭＳ Ｐゴシック&quot;, &quot;MS PGothic&quot;, sans-serif;
}
</pre><br /><br /><br />
<p>こちら、fontを一括指定できるのですが、他のショートハンドと違って、記述順に注意しなくては行けません。</p>
<br />
<p><strong>例）ショートハンド版</strong></p>
<pre class="brush: xml; title: ; notranslate">
.className {
  font:normal normal bold 140%/1.6 &quot;ヒラギノ角ゴ Pro W3&quot;, &quot;Hiragino Kaku Gothic Pro&quot;, &quot;メイリオ&quot;, Meiryo, Osaka, &quot;ＭＳ Ｐゴシック&quot;, &quot;MS PGothic&quot;, sans-serif;
}
</pre><br /><br /><br />
<p>このようにfont-style font-variant font-weightまでは順番は自由なのですが</p>
<br />
<p>font-size line-height font-familyはこの順番で記述しないといけません。</p>
<br />
<p>僕は面倒いので、fontに関してはショートハンド無しで記述していますね。</p>
<br />
<p>fontは別として、padding margin border backgroundはほとんどショートハンドで記述します。<br /> 一つだけ指定する場合は個別ですが、２つ以上指定する場合、ショートハンドの記述です。</p>
<br />
<p>web初心者の方は別々で書いているかもしれませんが、ショートハンドを使用して見慣れておくことをおすすめします。</p>
<br />
<p>現場ではほぼショートハンドですので、読めないと大変ですよ(´・ω・｀)</p>
<br />
<p>それでは、良きコーディングライフを～(・ω&lt;)ﾉｼ</p>
</div>
]]></content:encoded>
			<wfw:commentRss>https://taneppa.net/shorthand/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>【Dreamweaver CC】でHTML5での画像挿入バグを直す方法</title>
		<link>https://taneppa.net/dwbug/</link>
		<comments>https://taneppa.net/dwbug/#comments</comments>
		<pubDate>Mon, 28 Jul 2014 06:33:56 +0000</pubDate>
		<dc:creator>yanoppa!</dc:creator>
				<category><![CDATA[Dreamweaver]]></category>
		<category><![CDATA[バグ解消]]></category>
		<category><![CDATA[効率化]]></category>

		<guid isPermaLink="false">https://taneppa.net/?p=2070</guid>
		<description><![CDATA[Dreamweaver CC でHTML5なのに画像挿入すると 最後に / (スラッシュ)が入ってしまいます。そのバグを直す方法を紹介します！]]></description>
				<content:encoded><![CDATA[
<div style="line-height: 2.4;">
<h2></h2>
<p>おはこんばんちわ、毎年かならず風邪を3度は患うやのっぱです(´・ω・｀)おほー</p>
<br />
<p>本日はあの煩わしかったDreamweaverCCの画像挿入バグ改善法をご紹介します。</p>
<br />
<p>この改善方法が、意外とググっても出てこないんですよね。。。<br /> というわけで、ふたっぱのジェバンニ（Boss）が一晩でやってくれました←ものの4～5分</p>
<br />
<p>その前に、どのようなバグかと申しますと、DreamweaverCCを使用してドキュメントタイプHTML5でコーディングしていくとき<br /> 画像挿入をすると、&lt;img src=&#8221;*****.jpg&#8221; width=&#8221;300&#8243; height=&#8221;300&#8243; alt=&#8221;"/&gt;と出ます。</p>
<br />
<p>なにがおかしいの？っと思いますよね…<br /> よくご覧になってください。</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-2075" alt="bug01" src="https://taneppa.net/wp-content/uploads/2014/07/bug01.jpg" width="300" height="150" /></p>
<p>そう…HTML5は閉じスラッシュいらないんです…しかも半角スペースも入ってないし(´・ω・｀)</p>
<br />
<p>一応HTML5はxhtmlの記述でも問題なく動くのですが、気持ち悪いですよね。<br /> きっちりしてる制作会社だと、直して～と言われるところです。</p>
<br />
<p>でわ、これを直す方法ですがDreamweaverを制御してるjsを直接編集していきます。<br /> ファイルの場所など自信が無い方は、お近くのよく知ってる人にお願いしてみてください！</p>
<br />
<p>ファイルの場所</p>
<p>C:\Program Files (x86)＞\Adobe＞\AdobeDreamweaverCC＞\configuration＞\Objects＞\Common＞\image.js</p>
<p>のimage.jsを変更していきます。<br /> 階層が奥の方なので、変なところを触らないように気をつけましょう♪</p>
<br />
<p>では、エディターソフトでimage.jsを開きます。(Dreamweaverでも良いです)<br /> 失敗が心配な方はバックアップをとっておきましょう！ image.jsファイルをコピーして拡張子.jsを.bkなどに変えて置いておくと便利です。</p>
<br />
<p>編集する場所は52行目にある【rtnStr = rtnStr + &#8216;alt=&#8221;&#8216; + &#8216;&#8221; /&gt;&#8217;;】の部分です</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-2076" alt="bug02" src="https://taneppa.net/wp-content/uploads/2014/07/bug02.jpg" width="600" height="300" /></p>
<br />
<p>ここを以下のソースに置き換えます。</p>
<pre class="brush: xml; title: ; notranslate">
 if(thisDOM.getIsXHTMLStrictDocument()){
   rtnStr = rtnStr + 'alt=&quot;' + '&quot; /&gt;';
 }else{
   rtnStr = rtnStr + 'alt=&quot;' + '&quot;&gt;';
 }
</pre><br /><br /><br /><br />
<p>こんな感じになればよいです</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-2077" alt="bug03" src="https://taneppa.net/wp-content/uploads/2014/07/bug03.jpg" width="600" height="300" /></p>
<br />
<p>保存したら、Dreamweaverを起動している方は一度落として、もう一度ソフトを立ち上げてください。</p>
<p>すると、imgタグのバグが直っているはずです！</p>
<p>この仕様に戸惑っていた方も多いはず！<br /> 早速書き換えてみてください♪</p>
<p>それでは！良きコーディングライフを～see you(・ω&lt;)ﾉｼ</p>
</div>
]]></content:encoded>
			<wfw:commentRss>https://taneppa.net/dwbug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>今さら聞けない、marginとpaddingの違い</title>
		<link>https://taneppa.net/margin_padding/</link>
		<comments>https://taneppa.net/margin_padding/#comments</comments>
		<pubDate>Wed, 23 Jul 2014 06:51:53 +0000</pubDate>
		<dc:creator>yanoppa!</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[コーディング]]></category>
		<category><![CDATA[初心者向け]]></category>

		<guid isPermaLink="false">https://taneppa.net/?p=1889</guid>
		<description><![CDATA[margin paddingの基本的な考え方を記事にしました！どうmargin paddingの違いってなんのか？CSS・HTML初心者はぜひ参考にください！]]></description>
				<content:encoded><![CDATA[<style><!--
.pressArt .mainPressSect .tbl tr th,
.pressArt .mainPressSect .tbl tr td {
  padding:4px 0 4px 16px;
}
.pressArt .mainPressSect .tbl tr th {
  width:240px;
}
.pressArt .mainPressSect h3 {
  margin-top:20px;
}
--></style>
<div style="line-height: 2.6;">
<p><span style="line-height: 2.6; font-size: 13px;">こんばんちわ、初夏ですでに溶けそうなゲルっぱ。。。やのっぱです(´・ω・｀)ｳｪｳｪ</span></p>
<p>今回は超絶初心者さんへ贈る、<strong>margin</strong>(マージン)と<strong>padding</strong>(パディング)を軽めに説明します。</p>
<p>注意：本記事のソースはclearfixを導入した状態で作っています。 実際にお試しになる場合はclearfixを導入してください。<br /> <a href="https://taneppa.net/float/" target="_blank">clearfixなんぞや？はこちら</a></p>
<h3><strong>margin</strong> <strong>padding</strong>とはなんぞや？</h3>
<p><strong>margin</strong>とは要素間の間隔のことです。</p>
<p><strong>padding</strong>とは要素内の余白のことです。</p>
<p>混同しがちなので言い方を変えてみました。</p>
<p>では、<strong>margin</strong>からいきましょ～(´・ω・｀)ｂ</p>
<h3><strong>margin</strong></h3>
<p><strong>プロパティ</strong></p>
<p><strong>個別</strong></p>
<table class="tbl" style="border: 1px solid #93580D;" border="1">
<tbody>
<tr>
<th scope="row">margin-top: ○px;</th>
<td>上に対するmargin</td>
</tr>
<tr>
<th scope="row">margin-right: ○px;</th>
<td>右に対するmargin</td>
</tr>
<tr>
<th scope="row">margin-bottom: ○px;</th>
<td>下に対するmargin</td>
</tr>
<tr>
<th scope="row">margin-left: ○px;</th>
<td>左に対するmargin</td>
</tr>
</tbody></table>
<p><strong>ショートハンド</strong></p>
<table class="tbl" style="border: 1px solid #93580D;" border="1">
<tbody>
<tr>
<th scope="row">margin: ○px;</th>
<td>四方向共通</td>
</tr>
<tr>
<th scope="row">margin: ○px ○px;</th>
<td>上下　左右</td>
</tr>
<tr>
<th scope="row">margin: ○px ○px ○px;</th>
<td>上　左右　下</td>
</tr>
<tr>
<th scope="row">margin: ○px ○px ○px ○px;</th>
<td>上　右　下　左</td>
</tr>
</tbody></table>
<p>今回論理プロパティ（margin-startとか）は説明に入れません。(IE8以前は未対応だし。。。またおまえかIEたん;)</p>
<p>これは後日「<strong>【CSS】marginについてちょっと本気出して説明してみた</strong>」にて詳しく説明いたします。</p>
<p>ではまず、ボックスモデルを確認してみましょう。</p>
<br />
<p style="text-align: center;"><img class="aligncenter size-full wp-image-1903" alt="図：ボックスモデル" src="https://taneppa.net/wp-content/uploads/2014/06/marginbox.gif" width="700" height="500" /></p>
<br />
<p>このように、<strong>margin</strong>とは要素の外に対するものなのです。<br /> なので、たとえば<strong>div</strong>に背景色を付けていても、<strong>margin</strong>は外の間隔のことなので、<strong>margin</strong>の領域にその<strong>div</strong>の背景色は付きません。</p>
<p>なんのこっちゃ抹茶に紅茶な方は、borderやbackgroundを付けてみましょう。</p>
<p>実際にやって見るとよくわかります。百聞は一見に如かずです( ｰ`дｰ´)ｷﾘｯ</p>
<p>ではもっとわかりやすくするため、divを並べてみましょう。</p>
<style><!--
.pressArt .mainPressSect .contBox {
  position:relative;
  border:2px solid #ccc;
  padding: 25px 0;
  width:480px;
  margin: 0 auto;
  background:#fff;
}
.pressArt .mainPressSect .contBox .marginBox01 {
  float:left;
  width:200px;
  height:200px;
  margin:0 20px;
  background:#9ADEFF;
}
.pressArt .mainPressSect .contBox .marginBox02 {
  float:left;
  width:200px;
  height:200px;
  margin:0 20px;
  background:#BAFFAD;
}
.pressArt .mainPressSect .contBox .txt01 {
  position:absolute;
  top:120px;
  left:0;
}
.pressArt .mainPressSect .contBox .txt02 {
  position:absolute;
  top:120px;
  left:230px;
}
.pressArt .mainPressSect .contBox .txt03 {
  position:absolute;
  top:120px;
  right:-68px;
}
.pressArt .mainPressSect .contBox .txt04 {
  position: absolute;
  top: 0;
  left: 48%;
}
.pressArt .mainPressSect .contBox .txt05 {
  position: absolute;
  bottom: 0;
  left: 48%;
}
--></style>
<div class="contBox clearfix">
<div class="marginBox01"></div>
<div class="marginBox02"></div>
<p class="txt01">↑ここmargin</p>
<p class="txt02">↑ここmargin</p>
<p class="txt03">↑ここmargin</p>
<p class="txt04">↑ここcontBoxのpadding</p>
<p class="txt05">↓ここcontBoxのpadding</p>
</div>
<pre class="brush: xml; title: ; notranslate">
&lt;style&gt;
.contBox {
  width: 480px;
  padding: 25px 0;
  margin: 0 auto;
  background:#fff;
  border: 2px solid #ccc;
}
.contBox .marginBox01 {
  float: left;
  width: 200px;
  height :200px;
  margin: 0 20px;
  background: #9ADEFF;
}
.contBox .marginBox02 {
  float: left;
  width: 200px;
  height: 200px;
  margin: 0 20px;
  background: #BAFFAD;
}

&lt;/style&gt;
&lt;div class=&quot;contBox clearfix&quot;&gt;
  &lt;div class=&quot;marginBox01&quot;&gt;&lt;/div&gt;
  &lt;div class=&quot;marginBox02&quot;&gt;&lt;/div&gt;
&lt;/div&gt;
</pre><br /><br /><br /><br /><br /><br />
<p><strong>Chrome</strong>や<strong>Firefox</strong>などの開発者ツールでフォーカスすると<strong>margin</strong>や<strong>padding</strong>に色がつくので、使い方がわかる方は確認してみましょう。</p>
<p>ここで注意して見ておいて頂きたいのは、<strong>真ん中</strong>の<strong>margin</strong>です。<br /> <strong>20px＋20pxで40px</strong>になっているのを覚えておいてくださいね！</p>
<p>では次に、よく引っかかる<strong>margin</strong>の<strong>相殺</strong>を考えていきます。</p>
<p>これがあるので、<strong>margin</strong>を理解してないうちは<strong>margin</strong>使いにくっ！！っとなるのかもしれません。</p>
<h3>marginの相殺とは</h3>
<p>marginは<strong>縦方向（垂直方向）</strong>に限り、重なる<strong>margin</strong>を相殺する性質があります。</p>
<p>どういうことかといいますと</p>
<pre class="brush: xml; title: ; notranslate">
&lt;style&gt;
.contBox02 {
  width: 480px;
  margin: 0 auto;
  border: 2px solid #ccc;
  background:#fff;
}
.contBox02 .marginBox01 {
  width: 200px;
  height: 200px;
  margin: 20px auto;
  background: #9ADEFF;
}
.contBox02 .marginBox02 {
  width: 200px;
  height: 200px;
  margin: 20px auto;
  background: #BAFFAD;
}
&lt;/style&gt;
&lt;div class=&quot;contBox02&quot;&gt;
  &lt;div class=&quot;marginBox01&quot;&gt;&lt;/div&gt;
  &lt;div class=&quot;marginBox02&quot;&gt;&lt;/div&gt;
&lt;/div&gt;

</pre><br /><br /><br /><br /><br /><br /><style><!--
.pressArt .mainPressSect .contBox02 {
  position: relative;
  width: 480px;
  margin: 0 auto;
  border: 2px solid #ccc;
  background:#fff;
}
.pressArt .mainPressSect .contBox02 .marginBox01 {
  width: 200px;
  height: 200px;
  margin: 20px auto;
  background: #9ADEFF;
}
.pressArt .mainPressSect .contBox02 .marginBox02 {
  width: 200px;
  height: 200px;
  margin: 20px auto;
  background: #BAFFAD;
}
.pressArt .mainPressSect .contBox02 .marginBox02.plus{
  margin: 40px auto 20px;
}
--></style>
<div class="contBox02">
  <div class="marginBox01"></div>
  <div class="marginBox02"></div>
</div>
<p>このようなボックスモデルをつくりました。<br /> <strong>marginBox</strong>の上下に<strong>20px</strong>の<strong>margin</strong>をつけてますが。。。</p>
<p><strong>marginBox01</strong>と<strong>marginBox02</strong>の間が<strong>20px+20pxの40px</strong>になっていないのにお気づきになりましたでしょうか？</p>
<p>上下に隣接する要素の<strong>margin</strong>が<strong>同じ</strong>場合、<strong>相殺</strong>されてしまい、2<strong>0px</strong>の場合<strong>40px</strong>ではなく<strong>20px</strong>になります。</p>
<p>では、どちらかが少ない、または多い場合はどうなのか？</p>
<p>その場合、値が大きいほうが勝ちます。</p>
<p><strong>20px</strong>と<strong>40px</strong>だと<strong>40px</strong>に軍配があがります。</p>
<p>ではやってみましょう！</p>
<p><strong>marginBox02</strong>の<strong>margin-top</strong>を<strong>40px</strong>にしてみます。</p>
<div class="contBox02">
  <div class="marginBox01"></div>
  <div class="marginBox02 plus"></div>
</div>
<p>どうでしょう？<strong>40px</strong>離れましたね。</p>
<p>このような性質があるので、使いようによっては便利につかえます。</p>
<p>ちなみにデフォルトでは<strong>&lt;p&gt;</strong>には上下に<strong>margin</strong>が<strong>1em</strong>かかっています。<br /> なので、デフォルトだと<strong>&lt;p&gt;</strong>同士がつめつめにならないんですね！</p>
<p>次は<strong>padding</strong>に行ってみましょう！</p>
<h3><strong>padding</strong></h3>
<p><strong>プロパティ</strong></p>
<p><strong>個別</strong></p>
<table class="tbl" style="border: 1px solid #93580D;" border="1">
<tbody>
<tr>
<th scope="row">padding-top: ○px;</th>
<td>上に対するpadding</td>
</tr>
<tr>
<th scope="row">padding-right: ○px;</th>
<td>右に対するpadding</td>
</tr>
<tr>
<th scope="row">padding-bottom: ○px;</th>
<td>下に対するpadding</td>
</tr>
<tr>
<th scope="row">padding-left: ○px;</th>
<td>左に対するpadding</td>
</tr>
</tbody></table>
<p><strong>ショートハンド</strong></p>
<table class="tbl" style="border: 1px solid #93580D;" border="1">
<tbody>
<tr>
<th scope="row">padding: ○px;</th>
<td>四方向共通</td>
</tr>
<tr>
<th scope="row">padding: ○px ○px;</th>
<td>上下　左右</td>
</tr>
<tr>
<th scope="row">padding: ○px ○px ○px;</th>
<td>上　左右　下</td>
</tr>
<tr>
<th scope="row">padding: ○px ○px ○px ○px;</th>
<td>上　右　下　左</td>
</tr>
</tbody></table>
<br />
<p style="text-align: center;"><img class="aligncenter size-full wp-image-1903" alt="図：ボックスモデル" src="https://taneppa.net/wp-content/uploads/2014/06/marginbox.gif" width="700" height="500" /></p>
<p>この様に、<strong>padding</strong>は内側の余白のことです。</p>
<p>内側の余白なので、<strong>padding</strong>を追加すると<strong>ブロック要素自体の大きさ</strong>もかわります。</p>
<p>要は脂肪ですね。</p>
<p><strong>border</strong>を<strong>皮膚</strong>とすると<strong>padding</strong>は<strong>脂肪</strong>です。<br /> 増えるとブロック要素は太っていきます。</p>
<p>なので、<strong>float</strong>などで<strong>width</strong>をきっちり指定する場合は注意が必要ですね。</p>
<br />
<p><strong>padding</strong>は<strong>margin</strong>と違い、<strong>相殺</strong>されることもありません。</p>
<p>特徴としては<strong>ブロック要素</strong>を膨張させるので背景色なども一緒についてきます。<br />これも<strong>border</strong>と<strong>background</strong>を付けてあげるとわかりやすいので、やってみてくださいね。</p>
<p>では実践してみましょう！</p>
<style><!--
.pressArt .mainPressSect .contBox .paddingBox01 {
  width:356px;
  height:156px;
  padding:20px;
  margin:0 auto;
  background:#FFDDFB;
  border:2px solid #ccc;
}
.pressArt .mainPressSect .contBox .paddingBox01 .inBox{
  width:100%;
  height:100%;
  background:#FFFDD5;
}
--></style>
<div class="contBox">
  <div class="paddingBox01">
  	<div class="inBox"></div>
  </div>
</div>
<p>ピンク色がpaddingです。<br /> 白いところがmarginですね、わかりやすいように無理やりつくりましたが、黄色のところがテキストだったりします。</p>
<p>marginにくらべ、難しくはないのですが、ブロック要素の大きさを変えてしまうということだけ気をつけましょう。</p>
<p>これでほぼ終わりなのですが、一つpaddingをつかった例を作ってみました。(IE10～対応)</p>
<style><!--
.pressArt .mainPressSect .navTest {
  width:100%;
  padding:4px 0;
  background: #5b5b5b; /* Old browsers */
  background: -moz-linear-gradient(top,  #5b5b5b 0%, #2b2b2b 100%); /* FF3.6+ */
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#5b5b5b), color-stop(100%,#2b2b2b)); /* Chrome,Safari4+ */
  background: -webkit-linear-gradient(top,  #5b5b5b 0%,#2b2b2b 100%); /* Chrome10+,Safari5.1+ */
  background: -o-linear-gradient(top,  #5b5b5b 0%,#2b2b2b 100%); /* Opera 11.10+ */
  background: -ms-linear-gradient(top,  #5b5b5b 0%,#2b2b2b 100%); /* IE10+ */
  background: linear-gradient(to bottom,  #5b5b5b 0%,#2b2b2b 100%); /* W3C */
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#5b5b5b', endColorstr='#2b2b2b',GradientType=0 ); /* IE6-8 */
  border-top: 2px solid #9B9B9B;
  border-bottom: 2px solid #9B9B9B;
}
.pressArt .mainPressSect .navTest .navList {
  overflow: hidden;
  width:80%;
  margin:0 auto;
  padding:0;
  box-shadow: 1px 0 0 #686868,-1px 0 0 #414141;
  -webkit-box-shadow: 1px 0 0 #686868,-1px 0 0 #414141;
  -moz-box-shadow: 1px 0 0 #686868,-1px 0 0 #414141;
  list-style: none;
  font-weight: bold;
  text-align: center;
  color: #DDDDDD;
}
.pressArt .mainPressSect .navTest .navList li {
  float:left;
  width:20%;
  padding:1% 0;
  box-shadow: inset 1px 0 0 #686868,inset -1px 0 0 #414141;
  -webkit-box-shadow: inset 1px 0 0 #686868,inset -1px 0 0 #414141;
  -moz-box-shadow: inset 1px 0 0 #686868,inset -1px 0 0 #414141;
  background:none;
  cursor:pointer;
}
.pressArt .mainPressSect .navTest .navList li:hover {
  text-shadow: 0px 0px 6px rgba(0, 255, 0, 0.56);
  color:#6FA25B;
}
--></style>
<div class="navTest">
<ul class="navList clearfix">
	<li>NAVI01</li>
	<li>NAVI02</li>
	<li>NAVI03</li>
	<li>NAVI04</li>
	<li>NAVI05</li>
</ul>
</div>
<pre class="brush: xml; title: ; notranslate">
&lt;style&gt;
.navTest {
  width:100%;
  padding:4px 0;
  background: #5b5b5b; /* Old browsers */
  background: -moz-linear-gradient(top,  #5b5b5b 0%, #2b2b2b 100%); /* FF3.6+ */
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#5b5b5b), color-stop(100%,#2b2b2b)); /* Chrome,Safari4+ */
  background: -webkit-linear-gradient(top,  #5b5b5b 0%,#2b2b2b 100%); /* Chrome10+,Safari5.1+ */
  background: -o-linear-gradient(top,  #5b5b5b 0%,#2b2b2b 100%); /* Opera 11.10+ */
  background: -ms-linear-gradient(top,  #5b5b5b 0%,#2b2b2b 100%); /* IE10+ */
  background: linear-gradient(to bottom,  #5b5b5b 0%,#2b2b2b 100%); /* W3C */
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#5b5b5b', endColorstr='#2b2b2b',GradientType=0 ); /* IE6-8 */
  border-top: 2px solid #9B9B9B;
  border-bottom: 2px solid #9B9B9B;
}
.navTest .navList {
  overflow: hidden;
  width:80%;
  margin:0 auto;
  padding:0;
  box-shadow: 1px 0 0 #686868,-1px 0 0 #414141;
  -webkit-box-shadow: 1px 0 0 #686868,-1px 0 0 #414141;
  -moz-box-shadow: 1px 0 0 #686868,-1px 0 0 #414141;
  list-style: none;
  font-weight: bold;
  text-align: center;
  color: #DDDDDD;
}
.navTest .navList li {
  float:left;
  width:20%;
  padding:1% 0;
  box-shadow: inset 1px 0 0 #686868,inset -1px 0 0 #414141;
  -webkit-box-shadow: inset 1px 0 0 #686868,inset -1px 0 0 #414141;
  -moz-box-shadow: inset 1px 0 0 #686868,inset -1px 0 0 #414141;
  cursor:pointer;
}
.navTest .navList li:hover {
  text-shadow: 0px 0px 6px rgba(0, 255, 0, 0.56);
  color:#6FA25B;
}
&lt;/style&gt;
&lt;div class=&quot;navTest&quot;&gt;
  &lt;ul class=&quot;navList clearfix&quot;&gt;
  	&lt;li&gt;NAVI01&lt;/li&gt;
  	&lt;li&gt;NAVI02&lt;/li&gt;
  	&lt;li&gt;NAVI03&lt;/li&gt;
  	&lt;li&gt;NAVI04&lt;/li&gt;
  	&lt;li&gt;NAVI05&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</pre><br /><br /><br /><br /><br /><br />
<p>ざくざく作ったのでソースがあれですが、paddingを効果的に使うことで、ナビの縦線が途中から始まってたり<br /> NAVIの文字を上下中央にしたりしてます。改行されるとアウトですが(汗<br /> 縦全部に線あるよりも、なんとなくこっちのほうがかっこいい。。。気がします(・ω・｀;)</p>
<p>marginでも出来るんですけれど、ボックスモデル的にこっちのが綺麗かなと</p>
<p>さて、marginの特性がわかればpaddingもおのずとわかってくるとおもいます。</p>
<p>まずは色々やってみて検証してみるのが良いと思います。でわ！素敵なコーディングライフを～(・ω&lt;)ﾉｼ</p>
</div>]]></content:encoded>
			<wfw:commentRss>https://taneppa.net/margin_padding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
