<?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>Webデザイン  |  ITのあれこれ</title>
	<atom:link href="https://himatoto.com/tag/web%E3%83%87%E3%82%B6%E3%82%A4%E3%83%B3/feed/" rel="self" type="application/rss+xml" />
	<link>https://himatoto.com</link>
	<description>初心者視点で分かりやすく</description>
	<lastBuildDate>Sat, 06 Aug 2022 02:28:54 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.1</generator>

<image>
	<url>https://himatoto.com/wp-content/uploads/2020/06/cropped-4495bed8051fcc9fd4ac4bababda36e3-32x32.png</url>
	<title>Webデザイン  |  ITのあれこれ</title>
	<link>https://himatoto.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>【Bootstrap】簡単に要素と要素の間隔をあける</title>
		<link>https://himatoto.com/bootstrap2/</link>
					<comments>https://himatoto.com/bootstrap2/#respond</comments>
		
		<dc:creator><![CDATA[himatoto]]></dc:creator>
		<pubDate>Tue, 18 Aug 2020 06:02:57 +0000</pubDate>
				<category><![CDATA[Bootstrap]]></category>
		<category><![CDATA[Webデザイン]]></category>
		<category><![CDATA[Webページ]]></category>
		<category><![CDATA[CSS]]></category>
		<guid isPermaLink="false">https://himatoto.com/?p=346</guid>

					<description><![CDATA[Bootstrapを利用して便利だと感じたことをまとめてます。 困った時に参考にして頂ければと思います。 （Bootstrapの逆引きとして参考にして頂ければと思います。） ※Bootstrap4での記述となります。 要 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>Bootstrapを利用して便利だと感じたことをまとめてます。</p>



<p>困った時に参考にして頂ければと思います。</p>



<p>（Bootstrapの逆引きとして参考にして頂ければと思います。）</p>



<p>※Bootstrap4での記述となります。</p>



<h2 class="wp-block-heading">要素と要素の間隔をあける</h2>



<p>HTMLでWebページを作成していると要素と要素の間隔をあけたい！ってことがあるかと思います。</p>



<p>下記図のように要素と要素の間隔をあける方法を説明します。</p>



<figure class="wp-block-image aligncenter size-large"><img fetchpriority="high" decoding="async" width="508" height="458" src="https://himatoto.com/wp-content/uploads/2020/08/margin1-1.png" alt="" class="wp-image-406" srcset="https://himatoto.com/wp-content/uploads/2020/08/margin1-1.png 508w, https://himatoto.com/wp-content/uploads/2020/08/margin1-1-300x270.png 300w" sizes="(max-width: 508px) 100vw, 508px" /></figure>



<p>要素同士の間隔をあける場合、色んな方法がります。</p>



<p>今回は要素の外側に余白を設定し間隔をあける方法を説明します。</p>



<p><span class="marker-under-red">余白を設定したい要素のclsssに「m方向-余白のサイズ」を設定</span>する。</p>



<pre class="wp-block-code"><code>&lt;img src="./images/item1.png" class="mr-3" /&gt;
&lt;img src="./images/item2.png" /&gt;</code></pre>



<figure class="wp-block-image aligncenter size-large"><img decoding="async" width="504" height="186" src="https://himatoto.com/wp-content/uploads/2020/08/margin2.png" alt="" class="wp-image-409" srcset="https://himatoto.com/wp-content/uploads/2020/08/margin2.png 504w, https://himatoto.com/wp-content/uploads/2020/08/margin2-300x111.png 300w" sizes="(max-width: 504px) 100vw, 504px" /><figcaption>左側の要素の右側に余白を入れて間隔をあける場合</figcaption></figure>



<pre class="wp-block-code"><code>&lt;img src="./images/item1.png" /&gt;
&lt;img src="./images/item2.png" class="ml-3" /&gt;</code></pre>



<figure class="wp-block-image aligncenter size-large"><img decoding="async" width="504" height="186" src="https://himatoto.com/wp-content/uploads/2020/08/margin3.png" alt="" class="wp-image-410" srcset="https://himatoto.com/wp-content/uploads/2020/08/margin3.png 504w, https://himatoto.com/wp-content/uploads/2020/08/margin3-300x111.png 300w" sizes="(max-width: 504px) 100vw, 504px" /><figcaption>右側の要素の左側に余白を入れて間隔をあける場合</figcaption></figure>



<div class="wp-block-cocoon-blocks-label-box-1 label-box block-box"><div class="label-box-label block-box-label box-label"><span class="label-box-label-text block-box-label-text box-label-text">少し詳しく</span></div><div class="label-box-content block-box-content box-content">
<p>mr-3・・・要素の右側に余白（マージン）を設定</p>



<p>ml-3・・・要素の左側に予約（マージン）を設定</p>



<p>「r」or「l」の部分を変更すると余白を入れる<span class="marker-under-red">方向</span>が変わります。</p>



<figure class="wp-block-table">
<div class="scrollable-table"><table style="width: 100%; height: 276px;">
<thead>
<tr style="height: 70px;">
<th style="height: 70px;">Bootstrapのクラス名<br>（m隣に記載するもの）</th>
<th style="height: 70px;">例</th>
<th style="height: 70px;">説明</th>
</tr>
</thead>
<tbody>
<tr style="height: 42px;">
<td style="height: 42px;">なし</td>
<td style="height: 42px;">m-1</td>
<td style="height: 42px;">要素の上右下左に余白（マージン）を設定</td>
</tr>
<tr style="height: 41px;">
<td style="height: 41px;">t</td>
<td style="height: 41px;">m<strong>t</strong>-1</td>
<td style="height: 41px;">要素の上側に予約（マージン）を設定</td>
</tr>
<tr style="height: 41px;">
<td style="height: 41px;">r</td>
<td style="height: 41px;">m<strong>r</strong>-1</td>
<td style="height: 41px;">要素の右側に余白（マージン）を設定</td>
</tr>
<tr style="height: 41px;">
<td style="height: 41px;">b</td>
<td style="height: 41px;">m<strong>b</strong>-1</td>
<td style="height: 41px;">要素の下側に余白（マージン）を設定</td>
</tr>
<tr style="height: 41px;">
<td style="height: 41px;">l</td>
<td style="height: 41px;">m<strong>l</strong>-1</td>
<td style="height: 41px;">要素の左側に余白（マージン）を設定</td>
</tr>
</tbody>
</table></div>
</figure>



<p>「3」の部分を変更すると余白の<span class="marker-under-red">幅</span>が変わります。</p>



<p>※数字の部分は「1」～「5」が設定できます。</p>
</div></div>



<div class="wp-block-cocoon-blocks-label-box-1 label-box block-box"><div class="label-box-label block-box-label box-label"><span class="label-box-label-text block-box-label-text box-label-text">もっと詳しく</span></div><div class="label-box-content block-box-content box-content">
<p>下記表示は、Bootstrapのクラス名とそのクラス名内で書かれているCSSの対応表です。</p>



<figure class="wp-block-table">
<div class="scrollable-table"><table style="width: 100%; height: 125px;">
<thead>
<tr style="height: 42px;">
<th style="height: 42px; width: 42.5806%;">Bootstrapのクラス名</th>
<th style="height: 42px; width: 57.2903%;">CSS</th>
</tr>
</thead>
<tbody>
<tr style="height: 42px;">
<td style="height: 42px; width: 42.5806%;">mr-3</td>
<td style="height: 42px; width: 57.2903%;">margin-right: 1rem!important;</td>
</tr>
<tr style="height: 41px;">
<td style="height: 41px; width: 42.5806%;">ml-3</td>
<td style="height: 41px; width: 57.2903%;">margin-left: 1rem!important;</td>
</tr>
</tbody>
</table></div>
</figure>



<p>※余白の部分に関する部分を記載しています。</p>
</div></div>
]]></content:encoded>
					
					<wfw:commentRss>https://himatoto.com/bootstrap2/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>【Bootstrap】スマートフォンの時だけ改行する</title>
		<link>https://himatoto.com/bootstrap1/</link>
					<comments>https://himatoto.com/bootstrap1/#respond</comments>
		
		<dc:creator><![CDATA[himatoto]]></dc:creator>
		<pubDate>Sat, 18 Jul 2020 03:08:09 +0000</pubDate>
				<category><![CDATA[Bootstrap]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Webデザイン]]></category>
		<category><![CDATA[Webページ]]></category>
		<category><![CDATA[Webサイト]]></category>
		<guid isPermaLink="false">https://himatoto.com/?p=200</guid>

					<description><![CDATA[Bootstrapを利用して便利だと感じたことをまとめてます。 困った時に参考にして頂ければと思います。 （Bootstrapの逆引きとして参考にして頂ければと思います。） ※Bootstrap4での記述となります。 目 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>Bootstrapを利用して便利だと感じたことをまとめてます。</p>



<p>困った時に参考にして頂ければと思います。</p>



<p>（Bootstrapの逆引きとして参考にして頂ければと思います。）</p>



<p>※Bootstrap4での記述となります。</p>




  <div id="toc" class="toc tnt-number toc-center tnt-number border-element"><input type="checkbox" class="toc-checkbox" id="toc-checkbox-4" checked><label class="toc-title" for="toc-checkbox-4">目次</label>
    <div class="toc-content">
    <ol class="toc-list open"><li><a href="#toc1" tabindex="0">横のサイズ</a></li><li><a href="#toc2" tabindex="0">スマートフォン表示の時改行する</a></li><li><a href="#toc3" tabindex="0">パソコン表示の時改行する</a></li></ol>
    </div>
  </div>

<h2 class="wp-block-heading"><span id="toc1">横のサイズ</span></h2>



<p>bootstrapでは横のサイズを表す時にclass名の一部に「sm, md, lg, xl」を使用します。</p>



<p>それぞれのclass名が表しているサイズは下記の通りです。</p>



<figure class="wp-block-table aligncenter">
<div class="scrollable-table"><table style="width: 80%; height: 207px;">
<thead>
<tr style="height: 42px;">
<th style="height: 42px;">サイズをあらわすclass</th>
<th style="height: 42px;">サイズ</th>
</tr>
</thead>
<tbody>
<tr style="height: 42px;">
<td style="height: 42px; text-align: center;">sm</td>
<td style="height: 42px;">576px以上</td>
</tr>
<tr style="height: 41px;">
<td style="height: 41px; text-align: center;">md</td>
<td style="height: 41px;">768px以上</td>
</tr>
<tr style="height: 41px;">
<td style="height: 41px; text-align: center;">lg</td>
<td style="height: 41px;">992px以上</td>
</tr>
<tr style="height: 41px;">
<td style="height: 41px; text-align: center;">xl</td>
<td style="height: 41px;">1200px以上</td>
</tr>
</tbody>
</table></div>
</figure>



<h2 class="wp-block-heading"><span id="toc2">スマートフォン表示の時改行する</span></h2>



<p>スマートフォン表示の時だけ改行させたい！</p>



<p>そんな場合のclass指定の方法について説明します。</p>



<p><span class="marker-under-red">brタグ（改行）のclassに「d-sm-none」を指定すると、スマートフォン表示時に改行が有効になります。</span></p>



<pre class="wp-block-code"><code>&lt;p>あいうえお&lt;br class="d-sm-none" />かきくけこ&lt;/p></code></pre>



<div class="wp-block-cocoon-blocks-column-2 column-wrap column-2 column-2-2-1-1 layout-box">
<div class="wp-block-cocoon-blocks-column-left column-left">
<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" src="https://himatoto.com/wp-content/uploads/2020/07/bootstrap-1.png" alt="" class="wp-image-311" width="357" height="223" srcset="https://himatoto.com/wp-content/uploads/2020/07/bootstrap-1.png 640w, https://himatoto.com/wp-content/uploads/2020/07/bootstrap-1-300x188.png 300w" sizes="(max-width: 357px) 100vw, 357px" /><figcaption>パソコン表示イメージ</figcaption></figure></div>
</div>



<div class="wp-block-cocoon-blocks-column-right column-right">
<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" src="https://himatoto.com/wp-content/uploads/2020/07/bootstrap_sp-2.png" alt="" class="wp-image-312" width="357" height="223" srcset="https://himatoto.com/wp-content/uploads/2020/07/bootstrap_sp-2.png 640w, https://himatoto.com/wp-content/uploads/2020/07/bootstrap_sp-2-300x188.png 300w" sizes="(max-width: 357px) 100vw, 357px" /><figcaption>スマートフォン表示イメージ</figcaption></figure></div>
</div>
</div>



<div class="wp-block-cocoon-blocks-label-box-1 label-box block-box"><div class="label-box-label block-box-label box-label"><span class="label-box-label-text block-box-label-text box-label-text">少し詳しく</span></div><div class="label-box-content block-box-content box-content">
<p>d-sm-none・・・表示領域が576px以上の場合、改行タグが非表示になります。</p>



<p>「sm」の部分を「md」「lg」「xl」に変更することでそれぞれのサイズで表示・表示の調整ができます。</p>
</div></div>



<div class="wp-block-cocoon-blocks-label-box-1 label-box block-box"><div class="label-box-label block-box-label box-label"><span class="label-box-label-text block-box-label-text box-label-text">もっと詳しく</span></div><div class="label-box-content block-box-content box-content">
<p>下記表示は、Bootstrapのクラス名とそのクラス名内で書かれているCSSの対応表です。</p>



<figure class="wp-block-table">
<div class="scrollable-table"><table style="width: 100%; height: 196px;">
<thead>
<tr style="height: 42px;">
<th style="height: 42px;">Bootstrapのクラス名</th>
<th style="height: 42px;">CSS</th>
</tr>
</thead>
<tbody>
<tr style="height: 154px;">
<td style="height: 154px;">d-sm-none</td>
<td style="height: 154px;">@media&nbsp;(min-width:576px){<br>&nbsp; .d-sm-none{<br>&nbsp; &nbsp; display:none!important<br>&nbsp; }<br>}</td>
</tr>
</tbody>
</table></div>
</figure>



<p>※表示・表示に関係する部分を記載してます。</p>
</div></div>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading"><span id="toc3">パソコン表示の時改行する</span></h2>



<p>上記で記載した内容の逆のパターン。</p>



<p>パソコン表示の時だけ表示させたい！</p>



<p>そんな時のclassの指定の方法を説明します。</p>



<pre class="wp-block-code"><code>&lt;p>あいうえお&lt;br class="d-none d-lg-inline" />かきくけこ&lt;/p></code></pre>



<p><span class="marker-under-red">brタグ（改行）のclassに「d-none」と「d-lg-inline」を指定すると、パソコン表示時に改行が有効になります。</span></p>



<div class="wp-block-cocoon-blocks-column-2 column-wrap column-2 column-2-2-1-1 layout-box">
<div class="wp-block-cocoon-blocks-column-left column-left">
<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="640" height="400" src="https://himatoto.com/wp-content/uploads/2020/07/bootstrap_2.png" alt="" class="wp-image-317" srcset="https://himatoto.com/wp-content/uploads/2020/07/bootstrap_2.png 640w, https://himatoto.com/wp-content/uploads/2020/07/bootstrap_2-300x188.png 300w" sizes="(max-width: 640px) 100vw, 640px" /><figcaption>パソコン表示イメージ</figcaption></figure></div>
</div>



<div class="wp-block-cocoon-blocks-column-right column-right">
<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="640" height="400" src="https://himatoto.com/wp-content/uploads/2020/07/bootstrap_sp_2.png" alt="" class="wp-image-318" srcset="https://himatoto.com/wp-content/uploads/2020/07/bootstrap_sp_2.png 640w, https://himatoto.com/wp-content/uploads/2020/07/bootstrap_sp_2-300x188.png 300w" sizes="(max-width: 640px) 100vw, 640px" /><figcaption>スマートフォン表示イメージ</figcaption></figure></div>
</div>
</div>



<div class="wp-block-cocoon-blocks-label-box-1 label-box block-box"><div class="label-box-label block-box-label box-label"><span class="label-box-label-text block-box-label-text box-label-text">少し詳しく</span></div><div class="label-box-content block-box-content box-content">
<p>d-none・・・非表示にします。</p>



<p>d-lg-inline・・・表示領域が992px以上の場合、表示（インライン表示）します。</p>



<p>「d-none」で指定したタグを非表示にします。「d-lg-inline」を使用することにより表示領域が992pxの時タグを表示させることができます。</p>



<p>「lg」の部分を「sm」「md」「xl」に変更することでそれぞれのサイズで表示・表示の調整ができます。</p>
</div></div>



<div class="wp-block-cocoon-blocks-label-box-1 label-box block-box"><div class="label-box-label block-box-label box-label"><span class="label-box-label-text block-box-label-text box-label-text">もっと詳しく</span></div><div class="label-box-content block-box-content box-content">
<p>下記表示は、Bootstrapのクラス名とそのクラス名内で書かれているCSSの対応表です。</p>



<figure class="wp-block-table">
<div class="scrollable-table"><table style="width: 100%; height: 237px;">
<thead>
<tr style="height: 42px;">
<th style="height: 42px;">Bootstrapのクラス名</th>
<th style="height: 42px;">CSS</th>
</tr>
</thead>
<tbody>
<tr style="height: 42px;">
<td style="height: 42px;">d-none</td>
<td style="height: 42px;">display:none;</td>
</tr>
<tr style="height: 153px;">
<td style="height: 153px;">d-lg-inline</td>
<td style="height: 153px;">
<div>
<div>@media (min-width:992px){</div>
<div>
<div>
<div>  .d-lg-inline-block{</div>
<div>    display:inline-block!important</div>
<div>  }</div>
</div>
</div>
<div>}</div>
</div>
</td>
</tr>
</tbody>
</table></div>
</figure>



<p>※表示・表示に関係する部分を記載してます。</p>
</div></div>
]]></content:encoded>
					
					<wfw:commentRss>https://himatoto.com/bootstrap1/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
