<?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>css | 相模原市ホームページ制作 ロックストリーム</title>
	<atom:link href="https://rockstream-jp.com/category/blog/css/feed/" rel="self" type="application/rss+xml" />
	<link>https://rockstream-jp.com</link>
	<description>相模原市WEBサイト制作・カスタム・修復</description>
	<lastBuildDate>Tue, 17 Sep 2024 01:59:29 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
<atom:link rel="hub" href="https://pubsubhubbub.appspot.com"/>
<atom:link rel="hub" href="https://pubsubhubbub.superfeedr.com"/>
<atom:link rel="self" href="https://rockstream-jp.com/category/blog/css/feed/"/>
	<item>
		<title>【CSS】text-decoretion:underlineの下線位置を変える方法</title>
		<link>https://rockstream-jp.com/css-underline-position/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=css-underline-position</link>
					<comments>https://rockstream-jp.com/css-underline-position/#respond</comments>
		
		<dc:creator><![CDATA[zassy]]></dc:creator>
		<pubDate>Tue, 17 Sep 2019 01:49:36 +0000</pubDate>
				<category><![CDATA[css]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[アンダーライン]]></category>
		<guid isPermaLink="false">https://rockstream-jp.com/?p=28442</guid>

					<description><![CDATA[<p>備忘録 text-decoretion:underlineで指定すると下線がテキスト下にくっついていますが、下線を離したい場合の方...</p>
The post <a href="https://rockstream-jp.com/css-underline-position/">【CSS】text-decoretion:underlineの下線位置を変える方法</a> first appeared on <a href="https://rockstream-jp.com">相模原市ホームページ制作 ロックストリーム</a>.]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss-underline-position%2F&amp;linkname=%E3%80%90CSS%E3%80%91text-decoretion%3Aunderline%E3%81%AE%E4%B8%8B%E7%B7%9A%E4%BD%8D%E7%BD%AE%E3%82%92%E5%A4%89%E3%81%88%E3%82%8B%E6%96%B9%E6%B3%95" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss-underline-position%2F&amp;linkname=%E3%80%90CSS%E3%80%91text-decoretion%3Aunderline%E3%81%AE%E4%B8%8B%E7%B7%9A%E4%BD%8D%E7%BD%AE%E3%82%92%E5%A4%89%E3%81%88%E3%82%8B%E6%96%B9%E6%B3%95" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_line" href="https://www.addtoany.com/add_to/line?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss-underline-position%2F&amp;linkname=%E3%80%90CSS%E3%80%91text-decoretion%3Aunderline%E3%81%AE%E4%B8%8B%E7%B7%9A%E4%BD%8D%E7%BD%AE%E3%82%92%E5%A4%89%E3%81%88%E3%82%8B%E6%96%B9%E6%B3%95" title="Line" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Frockstream-jp.com%2Fcss-underline-position%2F&#038;title=%E3%80%90CSS%E3%80%91text-decoretion%3Aunderline%E3%81%AE%E4%B8%8B%E7%B7%9A%E4%BD%8D%E7%BD%AE%E3%82%92%E5%A4%89%E3%81%88%E3%82%8B%E6%96%B9%E6%B3%95" data-a2a-url="https://rockstream-jp.com/css-underline-position/" data-a2a-title="【CSS】text-decoretion:underlineの下線位置を変える方法"></a></p><p>備忘録</p>
<p>text-decoretion:underlineで指定すると下線がテキスト下にくっついていますが、下線を離したい場合の方法です。</p>
<h4>CSS</h4>
<pre class="brush: xml; title: ; notranslate">
//通常
text-underline-offset: auto;

//8px離す
text-underline-offset: 8px;

//0.5rem上（テキスト上）に移動
text-underline-offset: -0.5rem;
</pre>
<div class="mb50"></div>
<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss-underline-position%2F&amp;linkname=%E3%80%90CSS%E3%80%91text-decoretion%3Aunderline%E3%81%AE%E4%B8%8B%E7%B7%9A%E4%BD%8D%E7%BD%AE%E3%82%92%E5%A4%89%E3%81%88%E3%82%8B%E6%96%B9%E6%B3%95" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss-underline-position%2F&amp;linkname=%E3%80%90CSS%E3%80%91text-decoretion%3Aunderline%E3%81%AE%E4%B8%8B%E7%B7%9A%E4%BD%8D%E7%BD%AE%E3%82%92%E5%A4%89%E3%81%88%E3%82%8B%E6%96%B9%E6%B3%95" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_line" href="https://www.addtoany.com/add_to/line?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss-underline-position%2F&amp;linkname=%E3%80%90CSS%E3%80%91text-decoretion%3Aunderline%E3%81%AE%E4%B8%8B%E7%B7%9A%E4%BD%8D%E7%BD%AE%E3%82%92%E5%A4%89%E3%81%88%E3%82%8B%E6%96%B9%E6%B3%95" title="Line" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Frockstream-jp.com%2Fcss-underline-position%2F&#038;title=%E3%80%90CSS%E3%80%91text-decoretion%3Aunderline%E3%81%AE%E4%B8%8B%E7%B7%9A%E4%BD%8D%E7%BD%AE%E3%82%92%E5%A4%89%E3%81%88%E3%82%8B%E6%96%B9%E6%B3%95" data-a2a-url="https://rockstream-jp.com/css-underline-position/" data-a2a-title="【CSS】text-decoretion:underlineの下線位置を変える方法"></a></p>The post <a href="https://rockstream-jp.com/css-underline-position/">【CSS】text-decoretion:underlineの下線位置を変える方法</a> first appeared on <a href="https://rockstream-jp.com">相模原市ホームページ制作 ロックストリーム</a>.]]></content:encoded>
					
					<wfw:commentRss>https://rockstream-jp.com/css-underline-position/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>【CSS】hover時の下線を動かす方法</title>
		<link>https://rockstream-jp.com/css-hover-border-animation/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=css-hover-border-animation</link>
					<comments>https://rockstream-jp.com/css-hover-border-animation/#respond</comments>
		
		<dc:creator><![CDATA[zassy]]></dc:creator>
		<pubDate>Tue, 12 Mar 2019 07:12:51 +0000</pubDate>
				<category><![CDATA[css]]></category>
		<guid isPermaLink="false">https://rockstream-jp.com/?p=20577</guid>

					<description><![CDATA[<p>備忘録です。 リンクhover時に下線が右から左に動いたり中央から左右に伸びるアレの方法です。 参考サイト リンク要素のhover...</p>
The post <a href="https://rockstream-jp.com/css-hover-border-animation/">【CSS】hover時の下線を動かす方法</a> first appeared on <a href="https://rockstream-jp.com">相模原市ホームページ制作 ロックストリーム</a>.]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss-hover-border-animation%2F&amp;linkname=%E3%80%90CSS%E3%80%91hover%E6%99%82%E3%81%AE%E4%B8%8B%E7%B7%9A%E3%82%92%E5%8B%95%E3%81%8B%E3%81%99%E6%96%B9%E6%B3%95" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss-hover-border-animation%2F&amp;linkname=%E3%80%90CSS%E3%80%91hover%E6%99%82%E3%81%AE%E4%B8%8B%E7%B7%9A%E3%82%92%E5%8B%95%E3%81%8B%E3%81%99%E6%96%B9%E6%B3%95" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_line" href="https://www.addtoany.com/add_to/line?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss-hover-border-animation%2F&amp;linkname=%E3%80%90CSS%E3%80%91hover%E6%99%82%E3%81%AE%E4%B8%8B%E7%B7%9A%E3%82%92%E5%8B%95%E3%81%8B%E3%81%99%E6%96%B9%E6%B3%95" title="Line" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Frockstream-jp.com%2Fcss-hover-border-animation%2F&#038;title=%E3%80%90CSS%E3%80%91hover%E6%99%82%E3%81%AE%E4%B8%8B%E7%B7%9A%E3%82%92%E5%8B%95%E3%81%8B%E3%81%99%E6%96%B9%E6%B3%95" data-a2a-url="https://rockstream-jp.com/css-hover-border-animation/" data-a2a-title="【CSS】hover時の下線を動かす方法"></a></p><p>備忘録です。</p>
<p>リンクhover時に下線が右から左に動いたり中央から左右に伸びるアレの方法です。</p>
<p>参考サイト<br />
<a href="https://www.terakoya.work/link-hover-line-css-animation/" rel="noopener" target="_blank">リンク要素のhover時に下線をCSSでアニメーション表示させる方法</a></p>
<p>html</p>
<pre class="brush: xml; title: ; notranslate">
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;&quot;&gt;MENU01&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;&quot;&gt;MENU02&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;&quot;&gt;MENU03&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;&quot;&gt;MENU04&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;&quot;&gt;MENU05&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</pre>
<p>下線が左から右に引かれるアニメーション</p>
<pre class="brush: xml; title: ; notranslate">
ul {
  display: flex;
  list-style: none;
}
li {
  padding: 5px;
}
a {
  display: block;
  padding: 0 0 5px;
  text-decoration: none;
}
a::after {
  border-bottom: solid 2px #f00;
  bottom: 0;
  content: &quot;&quot;;
  display: block;
  transition: all .3s ease;
  -webkit-transition: all .3s ease;
  width: 0;
}
a:hover::after {
  width: 100%;
}
</pre>
<p>下線が右から左に引かれるアニメーション</p>
<pre class="brush: xml; title: ; notranslate">
ul {
  display: flex;
  list-style: none;
}
li {
  padding: 5px;
}
a {
  display: block;
  padding: 0 0 5px;
  position: relative;
  text-decoration: none;
}
a::after {
  border-bottom: solid 2px #f00;
  bottom: 0;
  content: &quot;&quot;;
  display: block;
  position: absolute;
  right: 0;
  transition: all .3s ease;
  -webkit-transition: all .3s ease;
  width: 0;
}
a:hover::after {
  width: 100%;
}
</pre>
<p>下線が中央から左右に引かれるアニメーション</p>
<pre class="brush: xml; title: ; notranslate">
ul {
  display: flex;
  list-style: none;
}
li {
  padding: 5px;
}
a {
  display: block;
  padding: 0 0 5px;
  position: relative;
  text-decoration: none;
}
a::before,
a::after {
  border-bottom: solid 2px #f00;
  bottom: 0;
  content: &quot;&quot;;
  display: block;
  position: absolute;
  transition: all .3s ease;
  -webkit-transition: all .3s ease;
  width: 0;
}
a::before {
  left: 50%;
}
a::after {
  right: 50%;
}
a:hover::before,
a:hover::after {
  width: 50%;
}
</pre>
<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss-hover-border-animation%2F&amp;linkname=%E3%80%90CSS%E3%80%91hover%E6%99%82%E3%81%AE%E4%B8%8B%E7%B7%9A%E3%82%92%E5%8B%95%E3%81%8B%E3%81%99%E6%96%B9%E6%B3%95" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss-hover-border-animation%2F&amp;linkname=%E3%80%90CSS%E3%80%91hover%E6%99%82%E3%81%AE%E4%B8%8B%E7%B7%9A%E3%82%92%E5%8B%95%E3%81%8B%E3%81%99%E6%96%B9%E6%B3%95" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_line" href="https://www.addtoany.com/add_to/line?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss-hover-border-animation%2F&amp;linkname=%E3%80%90CSS%E3%80%91hover%E6%99%82%E3%81%AE%E4%B8%8B%E7%B7%9A%E3%82%92%E5%8B%95%E3%81%8B%E3%81%99%E6%96%B9%E6%B3%95" title="Line" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Frockstream-jp.com%2Fcss-hover-border-animation%2F&#038;title=%E3%80%90CSS%E3%80%91hover%E6%99%82%E3%81%AE%E4%B8%8B%E7%B7%9A%E3%82%92%E5%8B%95%E3%81%8B%E3%81%99%E6%96%B9%E6%B3%95" data-a2a-url="https://rockstream-jp.com/css-hover-border-animation/" data-a2a-title="【CSS】hover時の下線を動かす方法"></a></p>The post <a href="https://rockstream-jp.com/css-hover-border-animation/">【CSS】hover時の下線を動かす方法</a> first appeared on <a href="https://rockstream-jp.com">相模原市ホームページ制作 ロックストリーム</a>.]]></content:encoded>
					
					<wfw:commentRss>https://rockstream-jp.com/css-hover-border-animation/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>【CSS】ボタンをクリックした際の枠を消す方法</title>
		<link>https://rockstream-jp.com/css-button-click-border/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=css-button-click-border</link>
					<comments>https://rockstream-jp.com/css-button-click-border/#respond</comments>
		
		<dc:creator><![CDATA[zassy]]></dc:creator>
		<pubDate>Sun, 11 Nov 2018 06:20:20 +0000</pubDate>
				<category><![CDATA[css]]></category>
		<guid isPermaLink="false">https://rockstream-jp.com/?p=20004</guid>

					<description><![CDATA[<p>備忘録です。 ボタンをクリックした際に表示される枠を消す方法です。 参考サイト buttonタグをクリックすると表示されるボヤっと...</p>
The post <a href="https://rockstream-jp.com/css-button-click-border/">【CSS】ボタンをクリックした際の枠を消す方法</a> first appeared on <a href="https://rockstream-jp.com">相模原市ホームページ制作 ロックストリーム</a>.]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss-button-click-border%2F&amp;linkname=%E3%80%90CSS%E3%80%91%E3%83%9C%E3%82%BF%E3%83%B3%E3%82%92%E3%82%AF%E3%83%AA%E3%83%83%E3%82%AF%E3%81%97%E3%81%9F%E9%9A%9B%E3%81%AE%E6%9E%A0%E3%82%92%E6%B6%88%E3%81%99%E6%96%B9%E6%B3%95" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss-button-click-border%2F&amp;linkname=%E3%80%90CSS%E3%80%91%E3%83%9C%E3%82%BF%E3%83%B3%E3%82%92%E3%82%AF%E3%83%AA%E3%83%83%E3%82%AF%E3%81%97%E3%81%9F%E9%9A%9B%E3%81%AE%E6%9E%A0%E3%82%92%E6%B6%88%E3%81%99%E6%96%B9%E6%B3%95" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_line" href="https://www.addtoany.com/add_to/line?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss-button-click-border%2F&amp;linkname=%E3%80%90CSS%E3%80%91%E3%83%9C%E3%82%BF%E3%83%B3%E3%82%92%E3%82%AF%E3%83%AA%E3%83%83%E3%82%AF%E3%81%97%E3%81%9F%E9%9A%9B%E3%81%AE%E6%9E%A0%E3%82%92%E6%B6%88%E3%81%99%E6%96%B9%E6%B3%95" title="Line" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Frockstream-jp.com%2Fcss-button-click-border%2F&#038;title=%E3%80%90CSS%E3%80%91%E3%83%9C%E3%82%BF%E3%83%B3%E3%82%92%E3%82%AF%E3%83%AA%E3%83%83%E3%82%AF%E3%81%97%E3%81%9F%E9%9A%9B%E3%81%AE%E6%9E%A0%E3%82%92%E6%B6%88%E3%81%99%E6%96%B9%E6%B3%95" data-a2a-url="https://rockstream-jp.com/css-button-click-border/" data-a2a-title="【CSS】ボタンをクリックした際の枠を消す方法"></a></p><p>備忘録です。</p>
<p>ボタンをクリックした際に表示される枠を消す方法です。</p>
<p>参考サイト<br />
<a href="https://www.shirokuma-systems.com/seisaku/cording/331.html" rel="noopener noreferrer" target="_blank">buttonタグをクリックすると表示されるボヤっとした枠線を消す</a></p>
<p>CSSに追加</p>
<pre class="brush: xml; title: ; notranslate">
button:focus {
    outline:0;
}
</pre>
<div class="mb50"></div>
<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss-button-click-border%2F&amp;linkname=%E3%80%90CSS%E3%80%91%E3%83%9C%E3%82%BF%E3%83%B3%E3%82%92%E3%82%AF%E3%83%AA%E3%83%83%E3%82%AF%E3%81%97%E3%81%9F%E9%9A%9B%E3%81%AE%E6%9E%A0%E3%82%92%E6%B6%88%E3%81%99%E6%96%B9%E6%B3%95" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss-button-click-border%2F&amp;linkname=%E3%80%90CSS%E3%80%91%E3%83%9C%E3%82%BF%E3%83%B3%E3%82%92%E3%82%AF%E3%83%AA%E3%83%83%E3%82%AF%E3%81%97%E3%81%9F%E9%9A%9B%E3%81%AE%E6%9E%A0%E3%82%92%E6%B6%88%E3%81%99%E6%96%B9%E6%B3%95" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_line" href="https://www.addtoany.com/add_to/line?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss-button-click-border%2F&amp;linkname=%E3%80%90CSS%E3%80%91%E3%83%9C%E3%82%BF%E3%83%B3%E3%82%92%E3%82%AF%E3%83%AA%E3%83%83%E3%82%AF%E3%81%97%E3%81%9F%E9%9A%9B%E3%81%AE%E6%9E%A0%E3%82%92%E6%B6%88%E3%81%99%E6%96%B9%E6%B3%95" title="Line" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Frockstream-jp.com%2Fcss-button-click-border%2F&#038;title=%E3%80%90CSS%E3%80%91%E3%83%9C%E3%82%BF%E3%83%B3%E3%82%92%E3%82%AF%E3%83%AA%E3%83%83%E3%82%AF%E3%81%97%E3%81%9F%E9%9A%9B%E3%81%AE%E6%9E%A0%E3%82%92%E6%B6%88%E3%81%99%E6%96%B9%E6%B3%95" data-a2a-url="https://rockstream-jp.com/css-button-click-border/" data-a2a-title="【CSS】ボタンをクリックした際の枠を消す方法"></a></p>The post <a href="https://rockstream-jp.com/css-button-click-border/">【CSS】ボタンをクリックした際の枠を消す方法</a> first appeared on <a href="https://rockstream-jp.com">相模原市ホームページ制作 ロックストリーム</a>.]]></content:encoded>
					
					<wfw:commentRss>https://rockstream-jp.com/css-button-click-border/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>【CSS】クリックで画像などを切り替えるinput:checked</title>
		<link>https://rockstream-jp.com/css%ef%bc%8dinput-checked/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=css%25ef%25bc%258dinput-checked</link>
					<comments>https://rockstream-jp.com/css%ef%bc%8dinput-checked/#respond</comments>
		
		<dc:creator><![CDATA[zassy]]></dc:creator>
		<pubDate>Fri, 29 Jun 2018 03:34:38 +0000</pubDate>
				<category><![CDATA[css]]></category>
		<guid isPermaLink="false">https://rockstream-jp.com/?p=16784</guid>

					<description><![CDATA[<p>備忘録です。 クリックで画像を切り替える方法というとjavascriptですが、CSSでも実装できる方法がありました。 参考サイト...</p>
The post <a href="https://rockstream-jp.com/css%ef%bc%8dinput-checked/">【CSS】クリックで画像などを切り替えるinput:checked</a> first appeared on <a href="https://rockstream-jp.com">相模原市ホームページ制作 ロックストリーム</a>.]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss%25ef%25bc%258dinput-checked%2F&amp;linkname=%E3%80%90CSS%E3%80%91%E3%82%AF%E3%83%AA%E3%83%83%E3%82%AF%E3%81%A7%E7%94%BB%E5%83%8F%E3%81%AA%E3%81%A9%E3%82%92%E5%88%87%E3%82%8A%E6%9B%BF%E3%81%88%E3%82%8Binput%3Achecked" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss%25ef%25bc%258dinput-checked%2F&amp;linkname=%E3%80%90CSS%E3%80%91%E3%82%AF%E3%83%AA%E3%83%83%E3%82%AF%E3%81%A7%E7%94%BB%E5%83%8F%E3%81%AA%E3%81%A9%E3%82%92%E5%88%87%E3%82%8A%E6%9B%BF%E3%81%88%E3%82%8Binput%3Achecked" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_line" href="https://www.addtoany.com/add_to/line?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss%25ef%25bc%258dinput-checked%2F&amp;linkname=%E3%80%90CSS%E3%80%91%E3%82%AF%E3%83%AA%E3%83%83%E3%82%AF%E3%81%A7%E7%94%BB%E5%83%8F%E3%81%AA%E3%81%A9%E3%82%92%E5%88%87%E3%82%8A%E6%9B%BF%E3%81%88%E3%82%8Binput%3Achecked" title="Line" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Frockstream-jp.com%2Fcss%25ef%25bc%258dinput-checked%2F&#038;title=%E3%80%90CSS%E3%80%91%E3%82%AF%E3%83%AA%E3%83%83%E3%82%AF%E3%81%A7%E7%94%BB%E5%83%8F%E3%81%AA%E3%81%A9%E3%82%92%E5%88%87%E3%82%8A%E6%9B%BF%E3%81%88%E3%82%8Binput%3Achecked" data-a2a-url="https://rockstream-jp.com/css%ef%bc%8dinput-checked/" data-a2a-title="【CSS】クリックで画像などを切り替えるinput:checked"></a></p><p>備忘録です。</p>
<p>クリックで画像を切り替える方法というとjavascriptですが、CSSでも実装できる方法がありました。</p>
<p>参考サイト<br />
<a href="https://developer.mozilla.org/ja/docs/Web/CSS/:checked" rel="noopener noreferrer" target="_blank">:checked - CSS: カスケーディングスタイルシート</a></p>
<h4>HTML</h4>
<pre class="brush: xml; title: ; notranslate">
&lt;div&gt;
  &lt;input type=&quot;radio&quot; name=&quot;my-input&quot; id=&quot;yes&quot;&gt;
  &lt;label for=&quot;yes&quot;&gt;Yes&lt;/label&gt;

  &lt;input type=&quot;radio&quot; name=&quot;my-input&quot; id=&quot;no&quot;&gt;
  &lt;label for=&quot;no&quot;&gt;No&lt;/label&gt;
&lt;/div&gt;

&lt;div&gt;
  &lt;input type=&quot;checkbox&quot; name=&quot;my-checkbox&quot; id=&quot;opt-in&quot;&gt;
  &lt;label for=&quot;opt-in&quot;&gt;Check me!&lt;/label&gt;
&lt;/div&gt;

&lt;select name=&quot;my-select&quot; id=&quot;fruit&quot;&gt;
  &lt;option value=&quot;opt1&quot;&gt;Apples&lt;/option&gt;
  &lt;option value=&quot;opt2&quot;&gt;Grapes&lt;/option&gt;
  &lt;option value=&quot;opt3&quot;&gt;Pears&lt;/option&gt;
&lt;/select&gt;
</pre>
<div class="mb40"></div>
<h4>CSS</h4>
<pre class="brush: xml; title: ; notranslate">
div,
select {
  margin: 8px;
}

/* チェックが入った入力のラベル */
input:checked + label {
  color: red;
}

/* チェックが入ったラジオボタン */
input&#x5B;type=&quot;radio&quot;]:checked {
  box-shadow: 0 0 0 3px orange;
}

/* チェックが入ったチェックボックス */
input&#x5B;type=&quot;checkbox&quot;]:checked {
  box-shadow: 0 0 0 3px hotpink;
}

/* 選択されたオプション */
option:checked {
  box-shadow: 0 0 0 3px lime;
  color: red;
}
</pre>
<div class="mb40"></div>
<p>CSSで背景画像を切り替える際にも使いましたが大丈夫でした。<br />外注案件のためサンプルページをお見せできませんがCSSの一部を公開します。<br />ちなみにMW WP Formのチェックボックスに使いました。<br />サンプルCSS</p>
<pre class="brush: xml; title: ; notranslate">
label&#x5B;for=&quot;select_car-1&quot;] span{
    background:url(images/car/carclass_1_off.png) no-repeat;
}
label&#x5B;for=&quot;select_car-1&quot;] input&#x5B;type=&quot;checkbox&quot;]:checked + span{
    background:url(images/car/carclass_1_on.png) no-repeat;
}
</pre>
<div class="mb40"></div>
<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss%25ef%25bc%258dinput-checked%2F&amp;linkname=%E3%80%90CSS%E3%80%91%E3%82%AF%E3%83%AA%E3%83%83%E3%82%AF%E3%81%A7%E7%94%BB%E5%83%8F%E3%81%AA%E3%81%A9%E3%82%92%E5%88%87%E3%82%8A%E6%9B%BF%E3%81%88%E3%82%8Binput%3Achecked" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss%25ef%25bc%258dinput-checked%2F&amp;linkname=%E3%80%90CSS%E3%80%91%E3%82%AF%E3%83%AA%E3%83%83%E3%82%AF%E3%81%A7%E7%94%BB%E5%83%8F%E3%81%AA%E3%81%A9%E3%82%92%E5%88%87%E3%82%8A%E6%9B%BF%E3%81%88%E3%82%8Binput%3Achecked" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_line" href="https://www.addtoany.com/add_to/line?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss%25ef%25bc%258dinput-checked%2F&amp;linkname=%E3%80%90CSS%E3%80%91%E3%82%AF%E3%83%AA%E3%83%83%E3%82%AF%E3%81%A7%E7%94%BB%E5%83%8F%E3%81%AA%E3%81%A9%E3%82%92%E5%88%87%E3%82%8A%E6%9B%BF%E3%81%88%E3%82%8Binput%3Achecked" title="Line" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Frockstream-jp.com%2Fcss%25ef%25bc%258dinput-checked%2F&#038;title=%E3%80%90CSS%E3%80%91%E3%82%AF%E3%83%AA%E3%83%83%E3%82%AF%E3%81%A7%E7%94%BB%E5%83%8F%E3%81%AA%E3%81%A9%E3%82%92%E5%88%87%E3%82%8A%E6%9B%BF%E3%81%88%E3%82%8Binput%3Achecked" data-a2a-url="https://rockstream-jp.com/css%ef%bc%8dinput-checked/" data-a2a-title="【CSS】クリックで画像などを切り替えるinput:checked"></a></p>The post <a href="https://rockstream-jp.com/css%ef%bc%8dinput-checked/">【CSS】クリックで画像などを切り替えるinput:checked</a> first appeared on <a href="https://rockstream-jp.com">相模原市ホームページ制作 ロックストリーム</a>.]]></content:encoded>
					
					<wfw:commentRss>https://rockstream-jp.com/css%ef%bc%8dinput-checked/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>【CSS】Youtube動画のアスペクト比を固定する方法</title>
		<link>https://rockstream-jp.com/css-youtube-aspect/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=css-youtube-aspect</link>
					<comments>https://rockstream-jp.com/css-youtube-aspect/#respond</comments>
		
		<dc:creator><![CDATA[zassy]]></dc:creator>
		<pubDate>Sun, 25 Mar 2018 05:01:32 +0000</pubDate>
				<category><![CDATA[css]]></category>
		<guid isPermaLink="false">https://rockstream-jp.com/?p=11141</guid>

					<description><![CDATA[<p>備忘録です。 参考サイト youtubeの動画をCSSでアスペクト比固定で表示する。 HTML &#60;div class=&#038;qu...</p>
The post <a href="https://rockstream-jp.com/css-youtube-aspect/">【CSS】Youtube動画のアスペクト比を固定する方法</a> first appeared on <a href="https://rockstream-jp.com">相模原市ホームページ制作 ロックストリーム</a>.]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss-youtube-aspect%2F&amp;linkname=%E3%80%90CSS%E3%80%91Youtube%E5%8B%95%E7%94%BB%E3%81%AE%E3%82%A2%E3%82%B9%E3%83%9A%E3%82%AF%E3%83%88%E6%AF%94%E3%82%92%E5%9B%BA%E5%AE%9A%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss-youtube-aspect%2F&amp;linkname=%E3%80%90CSS%E3%80%91Youtube%E5%8B%95%E7%94%BB%E3%81%AE%E3%82%A2%E3%82%B9%E3%83%9A%E3%82%AF%E3%83%88%E6%AF%94%E3%82%92%E5%9B%BA%E5%AE%9A%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_line" href="https://www.addtoany.com/add_to/line?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss-youtube-aspect%2F&amp;linkname=%E3%80%90CSS%E3%80%91Youtube%E5%8B%95%E7%94%BB%E3%81%AE%E3%82%A2%E3%82%B9%E3%83%9A%E3%82%AF%E3%83%88%E6%AF%94%E3%82%92%E5%9B%BA%E5%AE%9A%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95" title="Line" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Frockstream-jp.com%2Fcss-youtube-aspect%2F&#038;title=%E3%80%90CSS%E3%80%91Youtube%E5%8B%95%E7%94%BB%E3%81%AE%E3%82%A2%E3%82%B9%E3%83%9A%E3%82%AF%E3%83%88%E6%AF%94%E3%82%92%E5%9B%BA%E5%AE%9A%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95" data-a2a-url="https://rockstream-jp.com/css-youtube-aspect/" data-a2a-title="【CSS】Youtube動画のアスペクト比を固定する方法"></a></p><p>備忘録です。</p>
<p>参考サイト<br />
<a href="https://qiita.com/hemispherium/items/3faf6d2e1a7b63870371" rel="noopener" target="_blank">youtubeの動画をCSSでアスペクト比固定で表示する。</a></p>
<p>HTML</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div class=&quot;iframe-wrapper&quot;&gt;
  &lt;!-- youtubeの動画 --&gt;
  &lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/cl-KAl2Xlug&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;
&lt;div&gt;
</pre>
<p>CSS</p>
<pre class="brush: xml; title: ; notranslate">
iframe {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

.iframe-wrapper {
  padding-bottom: 56.25%;
  /* 9/16*100=56.25 アスペクト比は16:9 */
  height: 0;
  position: relative;
}
</pre>
<p class="mb40">youtube以外にもiframeを使っている場合には、親要素にid指定をすると特定のiframeだけに適用されます。</p>
<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss-youtube-aspect%2F&amp;linkname=%E3%80%90CSS%E3%80%91Youtube%E5%8B%95%E7%94%BB%E3%81%AE%E3%82%A2%E3%82%B9%E3%83%9A%E3%82%AF%E3%83%88%E6%AF%94%E3%82%92%E5%9B%BA%E5%AE%9A%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss-youtube-aspect%2F&amp;linkname=%E3%80%90CSS%E3%80%91Youtube%E5%8B%95%E7%94%BB%E3%81%AE%E3%82%A2%E3%82%B9%E3%83%9A%E3%82%AF%E3%83%88%E6%AF%94%E3%82%92%E5%9B%BA%E5%AE%9A%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_line" href="https://www.addtoany.com/add_to/line?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss-youtube-aspect%2F&amp;linkname=%E3%80%90CSS%E3%80%91Youtube%E5%8B%95%E7%94%BB%E3%81%AE%E3%82%A2%E3%82%B9%E3%83%9A%E3%82%AF%E3%83%88%E6%AF%94%E3%82%92%E5%9B%BA%E5%AE%9A%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95" title="Line" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Frockstream-jp.com%2Fcss-youtube-aspect%2F&#038;title=%E3%80%90CSS%E3%80%91Youtube%E5%8B%95%E7%94%BB%E3%81%AE%E3%82%A2%E3%82%B9%E3%83%9A%E3%82%AF%E3%83%88%E6%AF%94%E3%82%92%E5%9B%BA%E5%AE%9A%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95" data-a2a-url="https://rockstream-jp.com/css-youtube-aspect/" data-a2a-title="【CSS】Youtube動画のアスペクト比を固定する方法"></a></p>The post <a href="https://rockstream-jp.com/css-youtube-aspect/">【CSS】Youtube動画のアスペクト比を固定する方法</a> first appeared on <a href="https://rockstream-jp.com">相模原市ホームページ制作 ロックストリーム</a>.]]></content:encoded>
					
					<wfw:commentRss>https://rockstream-jp.com/css-youtube-aspect/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>【CSS】iPhoneのフォントサイズ自動調整を回避する方法</title>
		<link>https://rockstream-jp.com/css-iphone-auto-font-size/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=css-iphone-auto-font-size</link>
					<comments>https://rockstream-jp.com/css-iphone-auto-font-size/#respond</comments>
		
		<dc:creator><![CDATA[zassy]]></dc:creator>
		<pubDate>Sat, 24 Mar 2018 13:30:34 +0000</pubDate>
				<category><![CDATA[css]]></category>
		<guid isPermaLink="false">https://rockstream-jp.com/?p=17614</guid>

					<description><![CDATA[<p>備忘録です。 iPhoneのSafariでフォントが自動調整されてしまう問題を解決する方法です。 参考サイト iPhone版Saf...</p>
The post <a href="https://rockstream-jp.com/css-iphone-auto-font-size/">【CSS】iPhoneのフォントサイズ自動調整を回避する方法</a> first appeared on <a href="https://rockstream-jp.com">相模原市ホームページ制作 ロックストリーム</a>.]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss-iphone-auto-font-size%2F&amp;linkname=%E3%80%90CSS%E3%80%91iPhone%E3%81%AE%E3%83%95%E3%82%A9%E3%83%B3%E3%83%88%E3%82%B5%E3%82%A4%E3%82%BA%E8%87%AA%E5%8B%95%E8%AA%BF%E6%95%B4%E3%82%92%E5%9B%9E%E9%81%BF%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss-iphone-auto-font-size%2F&amp;linkname=%E3%80%90CSS%E3%80%91iPhone%E3%81%AE%E3%83%95%E3%82%A9%E3%83%B3%E3%83%88%E3%82%B5%E3%82%A4%E3%82%BA%E8%87%AA%E5%8B%95%E8%AA%BF%E6%95%B4%E3%82%92%E5%9B%9E%E9%81%BF%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_line" href="https://www.addtoany.com/add_to/line?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss-iphone-auto-font-size%2F&amp;linkname=%E3%80%90CSS%E3%80%91iPhone%E3%81%AE%E3%83%95%E3%82%A9%E3%83%B3%E3%83%88%E3%82%B5%E3%82%A4%E3%82%BA%E8%87%AA%E5%8B%95%E8%AA%BF%E6%95%B4%E3%82%92%E5%9B%9E%E9%81%BF%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95" title="Line" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Frockstream-jp.com%2Fcss-iphone-auto-font-size%2F&#038;title=%E3%80%90CSS%E3%80%91iPhone%E3%81%AE%E3%83%95%E3%82%A9%E3%83%B3%E3%83%88%E3%82%B5%E3%82%A4%E3%82%BA%E8%87%AA%E5%8B%95%E8%AA%BF%E6%95%B4%E3%82%92%E5%9B%9E%E9%81%BF%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95" data-a2a-url="https://rockstream-jp.com/css-iphone-auto-font-size/" data-a2a-title="【CSS】iPhoneのフォントサイズ自動調整を回避する方法"></a></p><p>備忘録です。</p>
<p>iPhoneのSafariでフォントが自動調整されてしまう問題を解決する方法です。<br />
参考サイト<br />
<a href="https://webkan.hateblo.jp/entry/20151026/p1" rel="noopener noreferrer" target="_blank">iPhone版Safariでフォントサイズがおかしくなる問題</a>
</p>
<p>CSSに記述</p>
<pre class="brush: xml; title: ; notranslate">
body {
-webkit-text-size-adjust: 100%;
}
</pre>
<p class="mb50">これで自動調整が行われなくなります。</p>
<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss-iphone-auto-font-size%2F&amp;linkname=%E3%80%90CSS%E3%80%91iPhone%E3%81%AE%E3%83%95%E3%82%A9%E3%83%B3%E3%83%88%E3%82%B5%E3%82%A4%E3%82%BA%E8%87%AA%E5%8B%95%E8%AA%BF%E6%95%B4%E3%82%92%E5%9B%9E%E9%81%BF%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss-iphone-auto-font-size%2F&amp;linkname=%E3%80%90CSS%E3%80%91iPhone%E3%81%AE%E3%83%95%E3%82%A9%E3%83%B3%E3%83%88%E3%82%B5%E3%82%A4%E3%82%BA%E8%87%AA%E5%8B%95%E8%AA%BF%E6%95%B4%E3%82%92%E5%9B%9E%E9%81%BF%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_line" href="https://www.addtoany.com/add_to/line?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss-iphone-auto-font-size%2F&amp;linkname=%E3%80%90CSS%E3%80%91iPhone%E3%81%AE%E3%83%95%E3%82%A9%E3%83%B3%E3%83%88%E3%82%B5%E3%82%A4%E3%82%BA%E8%87%AA%E5%8B%95%E8%AA%BF%E6%95%B4%E3%82%92%E5%9B%9E%E9%81%BF%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95" title="Line" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Frockstream-jp.com%2Fcss-iphone-auto-font-size%2F&#038;title=%E3%80%90CSS%E3%80%91iPhone%E3%81%AE%E3%83%95%E3%82%A9%E3%83%B3%E3%83%88%E3%82%B5%E3%82%A4%E3%82%BA%E8%87%AA%E5%8B%95%E8%AA%BF%E6%95%B4%E3%82%92%E5%9B%9E%E9%81%BF%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95" data-a2a-url="https://rockstream-jp.com/css-iphone-auto-font-size/" data-a2a-title="【CSS】iPhoneのフォントサイズ自動調整を回避する方法"></a></p>The post <a href="https://rockstream-jp.com/css-iphone-auto-font-size/">【CSS】iPhoneのフォントサイズ自動調整を回避する方法</a> first appeared on <a href="https://rockstream-jp.com">相模原市ホームページ制作 ロックストリーム</a>.]]></content:encoded>
					
					<wfw:commentRss>https://rockstream-jp.com/css-iphone-auto-font-size/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>【CSS】台形を作る</title>
		<link>https://rockstream-jp.com/css-trapezoid/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=css-trapezoid</link>
					<comments>https://rockstream-jp.com/css-trapezoid/#respond</comments>
		
		<dc:creator><![CDATA[zassy]]></dc:creator>
		<pubDate>Sun, 11 Mar 2018 05:11:06 +0000</pubDate>
				<category><![CDATA[css]]></category>
		<guid isPermaLink="false">https://rockstream-jp.com/?p=14818</guid>

					<description><![CDATA[<p>備忘録です。 CSSで台形を作る方法です。 参考サイト [CSS] 台形をつくる（角を丸くしてみたり、中に文字を入れてみたり。） ...</p>
The post <a href="https://rockstream-jp.com/css-trapezoid/">【CSS】台形を作る</a> first appeared on <a href="https://rockstream-jp.com">相模原市ホームページ制作 ロックストリーム</a>.]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss-trapezoid%2F&amp;linkname=%E3%80%90CSS%E3%80%91%E5%8F%B0%E5%BD%A2%E3%82%92%E4%BD%9C%E3%82%8B" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss-trapezoid%2F&amp;linkname=%E3%80%90CSS%E3%80%91%E5%8F%B0%E5%BD%A2%E3%82%92%E4%BD%9C%E3%82%8B" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_line" href="https://www.addtoany.com/add_to/line?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss-trapezoid%2F&amp;linkname=%E3%80%90CSS%E3%80%91%E5%8F%B0%E5%BD%A2%E3%82%92%E4%BD%9C%E3%82%8B" title="Line" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Frockstream-jp.com%2Fcss-trapezoid%2F&#038;title=%E3%80%90CSS%E3%80%91%E5%8F%B0%E5%BD%A2%E3%82%92%E4%BD%9C%E3%82%8B" data-a2a-url="https://rockstream-jp.com/css-trapezoid/" data-a2a-title="【CSS】台形を作る"></a></p><p>備忘録です。</p>
<p>CSSで台形を作る方法です。</p>
<p>参考サイト<br />
<a href="https://qiita.com/mochizukikotaro/items/f0a2ff58bc28dd48f45b" rel="noopener" target="_blank">[CSS] 台形をつくる（角を丸くしてみたり、中に文字を入れてみたり。）</a><br />
<a href="https://css-tricks.com/the-shapes-of-css/" rel="noopener" target="_blank">The Shapes of CSS </a></p>
<h4>まず台形を作ります。</h4>
<p>HTML</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div class=&quot;trapezoid&quot;&gt;&lt;/div&gt;
</pre>
<p>CSS</p>
<pre class="brush: xml; title: ; notranslate">
.trapezoid {
    width: 120px;
    border-bottom: 80px solid orange;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    height: 0;
}
</pre>
<div class="mb40">
<style type="text/css">
.trapezoid {
    width: 120px;
    border-bottom: 80px solid orange;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    height: 0;
}
</style>
<div class="trapezoid"></div>
</div>
<h4>台形の中に文字を入れます</h4>
<p>HTML</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div class=&quot;trapezoid&quot;&gt;文字を入れます&lt;/div&gt;
</pre>
<p>CSS</p>
<pre class="brush: xml; title: ; notranslate">
.trapezoid {
    width: 160px;
    border-bottom: 80px solid orange;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    height: 0;
    text-align: center;
    line-height: 80px;
}
</pre>
<div class="mb40">
<style type="text/css">
.trapezoid2 {
    width: 160px;
    border-bottom: 80px solid orange;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    height: 0;
    text-align: center;
    line-height: 80px;
}
</style>
<div class="trapezoid2">文字を入れます</div>
</div>
<h4>台形の中に文字を入れます</h4>
<p>HTML</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div class=&quot;trapezoid&quot;&gt;
    &lt;div class=&quot;inner&quot;&gt;文字です。&lt;br&gt;二行目ですよ。&lt;/div&gt;
&lt;/div&gt;
</pre>
<p>CSS</p>
<pre class="brush: xml; title: ; notranslate">
.trapezoid {
    width: 160px;
    border-bottom: 80px solid orange;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    height: 0;
    text-align: center;
}

.inner {
    padding-top: 14px;
}
</pre>
<div class="mb40">
<style type="text/css">
.trapezoid3 {
    width: 160px;
    border-bottom: 80px solid orange;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    height: 0;
    text-align: center;
}</p>
<p>.trapezoid3 .inner {
    padding-top: 14px;
}
</style>
<div class="trapezoid3">
<div class="inner">文字です。<br />二行目ですよ。</div>
</p></div>
</div>
<h4>逆台形の場合</h4>
<p>HTML</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div class=&quot;trapezoid&quot;&gt;&lt;/div&gt;
</pre>
<p>CSS</p>
<pre class="brush: xml; title: ; notranslate">
.trapezoid {
    width: 120px;
    border-top: 80px solid orange;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    height: 0;
}
</pre>
<div class="mb40">
<style type="text/css">
.trapezoid5 {
    width: 120px;
    border-top: 80px solid orange;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    height: 0;
}
</style>
<div class="trapezoid5"></div>
</div>
<h4>逆台形に文字を入れる</h4>
<p>HTML</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div class=&quot;trapezoid&quot;&gt;&lt;span&gt;文字&lt;/span&gt;&lt;/div&gt;
</pre>
<p>CSS</p>
<pre class="brush: xml; title: ; notranslate">
.trapezoid {
    position:relative;
    width: 120px;
    border-top: 80px solid orange;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    height: 0;
    text-align: center;
}
.trapezoid span{
    position:relative;
    top:-60px;
}
</pre>
<div class="mb60">
<style type="text/css">
.trapezoid6 {
    position:relative;
    width: 120px;
    border-top: 80px solid orange;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    height: 0;
    text-align: center;
}
.trapezoid6 span{
    position:relative;
    top:-60px;
}
</style>
<div class="trapezoid6"><span>文字</span></div>
</div>
<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss-trapezoid%2F&amp;linkname=%E3%80%90CSS%E3%80%91%E5%8F%B0%E5%BD%A2%E3%82%92%E4%BD%9C%E3%82%8B" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss-trapezoid%2F&amp;linkname=%E3%80%90CSS%E3%80%91%E5%8F%B0%E5%BD%A2%E3%82%92%E4%BD%9C%E3%82%8B" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_line" href="https://www.addtoany.com/add_to/line?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss-trapezoid%2F&amp;linkname=%E3%80%90CSS%E3%80%91%E5%8F%B0%E5%BD%A2%E3%82%92%E4%BD%9C%E3%82%8B" title="Line" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Frockstream-jp.com%2Fcss-trapezoid%2F&#038;title=%E3%80%90CSS%E3%80%91%E5%8F%B0%E5%BD%A2%E3%82%92%E4%BD%9C%E3%82%8B" data-a2a-url="https://rockstream-jp.com/css-trapezoid/" data-a2a-title="【CSS】台形を作る"></a></p>The post <a href="https://rockstream-jp.com/css-trapezoid/">【CSS】台形を作る</a> first appeared on <a href="https://rockstream-jp.com">相模原市ホームページ制作 ロックストリーム</a>.]]></content:encoded>
					
					<wfw:commentRss>https://rockstream-jp.com/css-trapezoid/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>【CSS】縦書きにする方法</title>
		<link>https://rockstream-jp.com/css-tategaki/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=css-tategaki</link>
					<comments>https://rockstream-jp.com/css-tategaki/#respond</comments>
		
		<dc:creator><![CDATA[zassy]]></dc:creator>
		<pubDate>Thu, 22 Feb 2018 10:41:26 +0000</pubDate>
				<category><![CDATA[css]]></category>
		<guid isPermaLink="false">https://rockstream-jp.com/?p=10646</guid>

					<description><![CDATA[<p>備忘録です。 テキストを縦書きにする方法です。 参考サイト CSS3で縦書きにする方法と挙動 CSS div { -webkit-...</p>
The post <a href="https://rockstream-jp.com/css-tategaki/">【CSS】縦書きにする方法</a> first appeared on <a href="https://rockstream-jp.com">相模原市ホームページ制作 ロックストリーム</a>.]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss-tategaki%2F&amp;linkname=%E3%80%90CSS%E3%80%91%E7%B8%A6%E6%9B%B8%E3%81%8D%E3%81%AB%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss-tategaki%2F&amp;linkname=%E3%80%90CSS%E3%80%91%E7%B8%A6%E6%9B%B8%E3%81%8D%E3%81%AB%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_line" href="https://www.addtoany.com/add_to/line?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss-tategaki%2F&amp;linkname=%E3%80%90CSS%E3%80%91%E7%B8%A6%E6%9B%B8%E3%81%8D%E3%81%AB%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95" title="Line" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Frockstream-jp.com%2Fcss-tategaki%2F&#038;title=%E3%80%90CSS%E3%80%91%E7%B8%A6%E6%9B%B8%E3%81%8D%E3%81%AB%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95" data-a2a-url="https://rockstream-jp.com/css-tategaki/" data-a2a-title="【CSS】縦書きにする方法"></a></p><p>備忘録です。</p>
<p>テキストを縦書きにする方法です。<br />
参考サイト<br />
<a href="https://qiita.com/RinoTsuka/items/3e3eaaba8cddb6ff08e9" rel="noopener" target="_blank">CSS3で縦書きにする方法と挙動</a>
</p>
<p>CSS</p>
<pre class="brush: xml; title: ; notranslate">
div {
  -webkit-writing-mode: vertical-rl;
      -ms-writing-mode: tb-rl;
          writing-mode: vertical-rl;
}
</pre>
<style type="text/css">
div.tategaki{
  -webkit-writing-mode: vertical-rl;
      -ms-writing-mode: tb-rl;
          writing-mode: vertical-rl;
}
</style>
<p>縦書きのサンプル</p>
<div class="tategaki">縦書きになります</div>
<div class="mb40"></div>
<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss-tategaki%2F&amp;linkname=%E3%80%90CSS%E3%80%91%E7%B8%A6%E6%9B%B8%E3%81%8D%E3%81%AB%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss-tategaki%2F&amp;linkname=%E3%80%90CSS%E3%80%91%E7%B8%A6%E6%9B%B8%E3%81%8D%E3%81%AB%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_line" href="https://www.addtoany.com/add_to/line?linkurl=https%3A%2F%2Frockstream-jp.com%2Fcss-tategaki%2F&amp;linkname=%E3%80%90CSS%E3%80%91%E7%B8%A6%E6%9B%B8%E3%81%8D%E3%81%AB%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95" title="Line" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Frockstream-jp.com%2Fcss-tategaki%2F&#038;title=%E3%80%90CSS%E3%80%91%E7%B8%A6%E6%9B%B8%E3%81%8D%E3%81%AB%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95" data-a2a-url="https://rockstream-jp.com/css-tategaki/" data-a2a-title="【CSS】縦書きにする方法"></a></p>The post <a href="https://rockstream-jp.com/css-tategaki/">【CSS】縦書きにする方法</a> first appeared on <a href="https://rockstream-jp.com">相模原市ホームページ制作 ロックストリーム</a>.]]></content:encoded>
					
					<wfw:commentRss>https://rockstream-jp.com/css-tategaki/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>【CSS】Googleフォント</title>
		<link>https://rockstream-jp.com/google-fonts/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=google-fonts</link>
					<comments>https://rockstream-jp.com/google-fonts/#respond</comments>
		
		<dc:creator><![CDATA[zassy]]></dc:creator>
		<pubDate>Wed, 31 Jan 2018 12:39:58 +0000</pubDate>
				<category><![CDATA[css]]></category>
		<guid isPermaLink="false">https://rockstream-jp.com/?p=11827</guid>

					<description><![CDATA[<p>備忘録です。 個人的によく使うGoogleフォントです。 LATO https://fonts.google.com/specim...</p>
The post <a href="https://rockstream-jp.com/google-fonts/">【CSS】Googleフォント</a> first appeared on <a href="https://rockstream-jp.com">相模原市ホームページ制作 ロックストリーム</a>.]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Frockstream-jp.com%2Fgoogle-fonts%2F&amp;linkname=%E3%80%90CSS%E3%80%91Google%E3%83%95%E3%82%A9%E3%83%B3%E3%83%88" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Frockstream-jp.com%2Fgoogle-fonts%2F&amp;linkname=%E3%80%90CSS%E3%80%91Google%E3%83%95%E3%82%A9%E3%83%B3%E3%83%88" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_line" href="https://www.addtoany.com/add_to/line?linkurl=https%3A%2F%2Frockstream-jp.com%2Fgoogle-fonts%2F&amp;linkname=%E3%80%90CSS%E3%80%91Google%E3%83%95%E3%82%A9%E3%83%B3%E3%83%88" title="Line" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Frockstream-jp.com%2Fgoogle-fonts%2F&#038;title=%E3%80%90CSS%E3%80%91Google%E3%83%95%E3%82%A9%E3%83%B3%E3%83%88" data-a2a-url="https://rockstream-jp.com/google-fonts/" data-a2a-title="【CSS】Googleフォント"></a></p><p>備忘録です。</p>
<p>個人的によく使うGoogleフォントです。</p>
<p>LATO<br />
<a href="https://fonts.google.com/specimen/Lato" rel="noopener" target="_blank">https://fonts.google.com/specimen/Lato</a></p>
<pre class="brush: xml; title: ; notranslate">
&lt;link href=&quot;https://fonts.googleapis.com/css?family=Lato&quot; rel=&quot;stylesheet&quot;&gt;

&lt;style type=&quot;text/css&quot;&gt;
.lato{font-family: 'Lato', sans-serif;}
&lt;/style&gt;
</pre>
<div class="mb30"></div>
<p>Oswald<br />
<a href="https://fonts.google.com/specimen/Oswald" rel="noopener" target="_blank">https://fonts.google.com/specimen/Oswald</a></p>
<pre class="brush: xml; title: ; notranslate">
&lt;link href=&quot;https://fonts.googleapis.com/css?family=Oswald&quot; rel=&quot;stylesheet&quot;&gt;

&lt;style type=&quot;text/css&quot;&gt;
.oswald{font-family: 'Oswald', sans-serif;}
&lt;/style&gt;
</pre>
<p>Cinzel Decorative<br />
Trajan Proの代用として使用。<br />
<a href="https://fonts.google.com/specimen/Cinzel+Decorative" rel="noopener" target="_blank">https://fonts.google.com/specimen/Cinzel+Decorative</a></p>
<pre class="brush: xml; title: ; notranslate">
&lt;link href=&quot;https://fonts.googleapis.com/css?family=Cinzel+Decorative&quot; rel=&quot;stylesheet&quot;&gt;

&lt;style type=&quot;text/css&quot;&gt;
.cinzel{font-family: 'Cinzel Decorative', cursive;}
&lt;/style&gt;
</pre>
<div class="mb50"></div>
<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Frockstream-jp.com%2Fgoogle-fonts%2F&amp;linkname=%E3%80%90CSS%E3%80%91Google%E3%83%95%E3%82%A9%E3%83%B3%E3%83%88" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Frockstream-jp.com%2Fgoogle-fonts%2F&amp;linkname=%E3%80%90CSS%E3%80%91Google%E3%83%95%E3%82%A9%E3%83%B3%E3%83%88" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_line" href="https://www.addtoany.com/add_to/line?linkurl=https%3A%2F%2Frockstream-jp.com%2Fgoogle-fonts%2F&amp;linkname=%E3%80%90CSS%E3%80%91Google%E3%83%95%E3%82%A9%E3%83%B3%E3%83%88" title="Line" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Frockstream-jp.com%2Fgoogle-fonts%2F&#038;title=%E3%80%90CSS%E3%80%91Google%E3%83%95%E3%82%A9%E3%83%B3%E3%83%88" data-a2a-url="https://rockstream-jp.com/google-fonts/" data-a2a-title="【CSS】Googleフォント"></a></p>The post <a href="https://rockstream-jp.com/google-fonts/">【CSS】Googleフォント</a> first appeared on <a href="https://rockstream-jp.com">相模原市ホームページ制作 ロックストリーム</a>.]]></content:encoded>
					
					<wfw:commentRss>https://rockstream-jp.com/google-fonts/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>【jQuery】プラグインを使わずにスライドメニューを実装</title>
		<link>https://rockstream-jp.com/jquery-easy-slidemenu/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=jquery-easy-slidemenu</link>
					<comments>https://rockstream-jp.com/jquery-easy-slidemenu/#respond</comments>
		
		<dc:creator><![CDATA[zassy]]></dc:creator>
		<pubDate>Tue, 30 Jan 2018 09:37:16 +0000</pubDate>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[css]]></category>
		<guid isPermaLink="false">https://rockstream-jp.com/?p=11152</guid>

					<description><![CDATA[<p>備忘録です。 参考サイト [jQuery] プラグインを使わずに横からスライドインするメニューを簡単に作る 基本 HTML &#038;lt...</p>
The post <a href="https://rockstream-jp.com/jquery-easy-slidemenu/">【jQuery】プラグインを使わずにスライドメニューを実装</a> first appeared on <a href="https://rockstream-jp.com">相模原市ホームページ制作 ロックストリーム</a>.]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Frockstream-jp.com%2Fjquery-easy-slidemenu%2F&amp;linkname=%E3%80%90jQuery%E3%80%91%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3%E3%82%92%E4%BD%BF%E3%82%8F%E3%81%9A%E3%81%AB%E3%82%B9%E3%83%A9%E3%82%A4%E3%83%89%E3%83%A1%E3%83%8B%E3%83%A5%E3%83%BC%E3%82%92%E5%AE%9F%E8%A3%85" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Frockstream-jp.com%2Fjquery-easy-slidemenu%2F&amp;linkname=%E3%80%90jQuery%E3%80%91%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3%E3%82%92%E4%BD%BF%E3%82%8F%E3%81%9A%E3%81%AB%E3%82%B9%E3%83%A9%E3%82%A4%E3%83%89%E3%83%A1%E3%83%8B%E3%83%A5%E3%83%BC%E3%82%92%E5%AE%9F%E8%A3%85" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_line" href="https://www.addtoany.com/add_to/line?linkurl=https%3A%2F%2Frockstream-jp.com%2Fjquery-easy-slidemenu%2F&amp;linkname=%E3%80%90jQuery%E3%80%91%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3%E3%82%92%E4%BD%BF%E3%82%8F%E3%81%9A%E3%81%AB%E3%82%B9%E3%83%A9%E3%82%A4%E3%83%89%E3%83%A1%E3%83%8B%E3%83%A5%E3%83%BC%E3%82%92%E5%AE%9F%E8%A3%85" title="Line" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Frockstream-jp.com%2Fjquery-easy-slidemenu%2F&#038;title=%E3%80%90jQuery%E3%80%91%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3%E3%82%92%E4%BD%BF%E3%82%8F%E3%81%9A%E3%81%AB%E3%82%B9%E3%83%A9%E3%82%A4%E3%83%89%E3%83%A1%E3%83%8B%E3%83%A5%E3%83%BC%E3%82%92%E5%AE%9F%E8%A3%85" data-a2a-url="https://rockstream-jp.com/jquery-easy-slidemenu/" data-a2a-title="【jQuery】プラグインを使わずにスライドメニューを実装"></a></p><p>備忘録です。</p>
<p>参考サイト<br />
<a href="https://memocarilog.info/jquery/7551" rel="noopener" target="_blank">[jQuery] プラグインを使わずに横からスライドインするメニューを簡単に作る</a></p>
<h4>基本</p>
<p>HTML</p>
<pre class="brush: xml; title: ; notranslate">
&lt;!-- スライドメニュー部分--&gt;
&lt;nav id=&quot;slide_menu&quot;&gt;
    &lt;ul&gt;
        &lt;li&gt;&lt;a href=&quot;#&quot;&gt;menu1&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;#&quot;&gt;menu2&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;#&quot;&gt;menu3&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;#&quot;&gt;menu4&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;#&quot;&gt;menu5&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
&lt;/nav&gt;
 
&lt;!--メニューを出すボタン--&gt;
&lt;button id=&quot;button&quot;&gt;&lt;i class=&quot;fa fa-bars&quot;&gt;&lt;/i&gt; Menu&lt;/button&gt;
</pre>
<p>CSS body</p>
<pre class="brush: xml; title: ; notranslate">
body {
    position: relative;
    left: 0;
    overflow-x: hidden;
}
</pre>
<p>CSS スライド部分</p>
<pre class="brush: xml; title: ; notranslate">
#slide_menu{
    position: fixed;
    top: 0;
    left: -240px;
    width: 240px;
    height: 100%;
    background: #E87272;
}
</pre>
<p>jQuery</p>
<pre class="brush: xml; title: ; notranslate">
&lt;script src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js&quot;&gt;&lt;/script&gt;
&lt;script&gt;
$(function(){
var menu = $('#slide_menu'), // スライドインするメニューを指定
    menuBtn = $('#button'), // メニューボタンを指定
    body = $(document.body),     
    menuWidth = menu.outerWidth();                
     
    // メニューボタンをクリックした時の動き
    menuBtn.on('click', function(){
    // body に open クラスを付与する
    body.toggleClass('open');
        if(body.hasClass('open')){
            // open クラスが body についていたらメニューをスライドインする
            body.animate({'left' : menuWidth }, 300);            
            menu.animate({'left' : 0 }, 300);                    
        } else {
            // open クラスが body についていなかったらスライドアウトする
            menu.animate({'left' : -menuWidth }, 300);
            body.animate({'left' : 0 }, 300);            
        }             
    });
});    
&lt;/script&gt;
</pre>
<h4>応用</h4>
<p>jQuery メニューの開閉でボタン画像を切り替える場合にはbodyにcssを追加します。</p>
<pre class="brush: xml; title: ; notranslate">
&lt;script&gt;
$(function(){
var menu = $('#slide_menu'), // スライドインするメニューを指定
    menuBtn = $('#button'), // メニューボタンを指定
    body = $(document.body),     
    menuWidth = menu.outerWidth();                
     
    // メニューボタンをクリックした時の動き
    menuBtn.on('click', function(){
    // body に open クラスを付与する
    body.toggleClass('open');
        if(body.hasClass('open')){
            $('body').removeClass('close');
            // open クラスが body についていたらメニューをスライドインする
            body.animate({'left' : menuWidth }, 300);            
            menu.animate({'left' : 0 }, 300);                    
        } else {
            $('body').addClass('close');
            // open クラスが body についていなかったらスライドアウトする
            menu.animate({'left' : -menuWidth }, 300);
            body.animate({'left' : 0 }, 300);            
        }             
    });
});    
&lt;/script&gt;
</pre>
<p>メニューが開いている時にコンテンツ部分をクリックしても閉じることができるようにする</p>
<p>HTML<br />まず、HTML のどこかに div.layer を追加します。</p>
<pre class="brush: xml; title: ; notranslate">
&lt;body&gt;
&lt;div class=&quot;layer&quot;&gt;&lt;/div&gt;
&lt;div class=&quot;container&quot;&gt;
：
略
</pre>
<p>CSS</p>
<pre class="brush: xml; title: ; notranslate">
.layer{
    position: fixed;
    top: 0;
    z-index: 1;
    display: none;
    width: 100%;
    height: 100%;
    background-color: transparent;
}
body.open{
    position: fixed;
}
</pre>
<p>jQuery</p>
<pre class="brush: xml; title: ; notranslate">
$(function(){
var menu = $('#slide_menu'),
    menuBtn = $('#button'),
    body = $(document.body),
    // .layer もオブジェクト化    
    layer = $('.layer'),
    menuWidth = menu.outerWidth();                
         
    menuBtn.on('click', function(){
    body.toggleClass('open');
        if(body.hasClass('open')){
            // css で非表示にしていた .layer を表示
            $(&quot;.layer&quot;).show();
            body.animate({'left' : menuWidth }, 300);
            menu.animate({'left' : 0 }, 300);                    
        } else {
            // .layer を非表示
            $(&quot;.layer&quot;).hide();
            menu.animate({'left' : -menuWidth }, 300);
            body.animate({'left' : 0 }, 300);            
        }             
    });
    // .layer をクリック時にもメニューを閉じる
    layer.on('click', function(){
            menu.animate({'left' : -menuWidth }, 300);
            body.animate({'left' : 0 }, 300).removeClass('open');
            layer.hide();
    });
});
</pre>
<div class="mb40"></div>
<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Frockstream-jp.com%2Fjquery-easy-slidemenu%2F&amp;linkname=%E3%80%90jQuery%E3%80%91%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3%E3%82%92%E4%BD%BF%E3%82%8F%E3%81%9A%E3%81%AB%E3%82%B9%E3%83%A9%E3%82%A4%E3%83%89%E3%83%A1%E3%83%8B%E3%83%A5%E3%83%BC%E3%82%92%E5%AE%9F%E8%A3%85" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Frockstream-jp.com%2Fjquery-easy-slidemenu%2F&amp;linkname=%E3%80%90jQuery%E3%80%91%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3%E3%82%92%E4%BD%BF%E3%82%8F%E3%81%9A%E3%81%AB%E3%82%B9%E3%83%A9%E3%82%A4%E3%83%89%E3%83%A1%E3%83%8B%E3%83%A5%E3%83%BC%E3%82%92%E5%AE%9F%E8%A3%85" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_line" href="https://www.addtoany.com/add_to/line?linkurl=https%3A%2F%2Frockstream-jp.com%2Fjquery-easy-slidemenu%2F&amp;linkname=%E3%80%90jQuery%E3%80%91%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3%E3%82%92%E4%BD%BF%E3%82%8F%E3%81%9A%E3%81%AB%E3%82%B9%E3%83%A9%E3%82%A4%E3%83%89%E3%83%A1%E3%83%8B%E3%83%A5%E3%83%BC%E3%82%92%E5%AE%9F%E8%A3%85" title="Line" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Frockstream-jp.com%2Fjquery-easy-slidemenu%2F&#038;title=%E3%80%90jQuery%E3%80%91%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3%E3%82%92%E4%BD%BF%E3%82%8F%E3%81%9A%E3%81%AB%E3%82%B9%E3%83%A9%E3%82%A4%E3%83%89%E3%83%A1%E3%83%8B%E3%83%A5%E3%83%BC%E3%82%92%E5%AE%9F%E8%A3%85" data-a2a-url="https://rockstream-jp.com/jquery-easy-slidemenu/" data-a2a-title="【jQuery】プラグインを使わずにスライドメニューを実装"></a></p>The post <a href="https://rockstream-jp.com/jquery-easy-slidemenu/">【jQuery】プラグインを使わずにスライドメニューを実装</a> first appeared on <a href="https://rockstream-jp.com">相模原市ホームページ制作 ロックストリーム</a>.]]></content:encoded>
					
					<wfw:commentRss>https://rockstream-jp.com/jquery-easy-slidemenu/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
