<?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>WORDPRESS  |  おせちてっく</title>
	<atom:link href="https://osechi-tech.net/category/it-all/%E3%83%96%E3%83%AD%E3%82%B0/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>https://osechi-tech.net</link>
	<description>IT情報をメインに発信するブログ</description>
	<lastBuildDate>Thu, 24 Aug 2023 13:51:56 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.3.8</generator>

<image>
	<url>https://osechi-tech.net/wp-content/uploads/2021/06/cropped-8426167e536ec96e143cb0c91eed5a5e-1-32x32.png</url>
	<title>WORDPRESS  |  おせちてっく</title>
	<link>https://osechi-tech.net</link>
	<width>32</width>
	<height>32</height>
</image> 
	<atom:link rel='hub' href='https://osechi-tech.net/?pushpress=hub'/>
	<item>
		<title>【WORDPRESS】スマホで画像がはみ出る場合の解決策</title>
		<link>https://osechi-tech.net/wordpress-image-over/</link>
					<comments>https://osechi-tech.net/wordpress-image-over/#respond</comments>
		
		<dc:creator><![CDATA[おせち]]></dc:creator>
		<pubDate>Wed, 30 Dec 2020 09:50:49 +0000</pubDate>
				<category><![CDATA[WORDPRESS]]></category>
		<guid isPermaLink="false">http://osechi-tech.net/?p=487</guid>

					<description><![CDATA[WORDPRESS使ってる人 投稿した記事をスマホで表示すると、画像がはみ出てグラグラしちゃう。これじゃ、誰も、読んでくれないよ。う～ん、困ったな。 　 ★ この記事では、こんなWORDPRESSの悩みを解決します。 （ [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><!--左の吹き出し--></p>
<div class="balloon-simple">
<div class="icon-left"><img decoding="async" src="https://osechi-tech.net/wp-content/uploads/2020/07/computer01_boy.png" alt=""><br />WORDPRESS<br />使ってる人</div>
<div class="balloon">
<div class="serif-left">投稿した記事をスマホで表示すると、<br />画像がはみ出てグラグラしちゃう。<br />これじゃ、誰も、読んでくれないよ。<br />う～ん、困ったな。</div>
</div>
</div>
<p><!--左の吹き出し end--></p>


<p>　</p>



<p><span class="badge-green">★</span> この記事では、こんなWORDPRESSの悩みを解決します。<br></p>



<p>（まかせてちょーよ。）</p>



<p><br><span class="badge-green">★</span> WORDPRESSの投稿機能で、記事に画像を載せるとき、スマホの画面では、画像がはみ出て表示されることがあります。</p>



<p>グラグラするし、非常に見にくいです。</p>



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



<p><br><span class="badge-green">★</span> グーグルで調べても、すぐには解決しなかったので、解決策を紹介します。</p>



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



<p>解決策①と解決策②の二つあります。</p>



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



<p>※おそらく、解決策①で解決しなかった人が、このページに来ているケースが多そうです。</p>



<p>なので、解決策①をさっと読んで、解決策②のほうを、早くみてもらったほうがいいかもしれません。<br></p>



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



<h2 class="wp-block-heading">[WORDPRESS]スマホで画像はみ出る問題の解決策①</h2>



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



<h3 class="wp-block-heading">インターネットで調べると</h3>



<p><br><span class="badge-green">★</span>「つぎの方法で解決します」という記事が多かったです。</p>



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



<p>下の記述を、テーマエディタで、&nbsp;style.cssに書き込むと解決するようです。</p>



<p>img { max-width: 100%; height: auto; }　</p>



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



<h3 class="wp-block-heading">やり方を丁寧に説明すると</h3>



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



<h4 class="wp-block-heading"><span class="bold">手順1. ダッシュボード＝＞外観＝＞テーマエディタをクリック</span></h4>



<figure class="wp-block-image size-large"><img decoding="async" fetchpriority="high" width="248" height="299" src="https://osechi-tech.net/wp-content/uploads/2021/01/47f8654e4e3b3b8f85600b96e6b7daac.png" alt="【WORDPRESS】スマホで画像がはみ出る場合の解決策(画像①)" class="wp-image-502"/></figure>



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



<h4 class="wp-block-heading"><span class="bold">手順2. style.cssというファイルが開くので、</span><strong>つぎのコード</strong><strong>を書きこむ。</strong></h4>



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



<p> img{ max-width: 100%; height: auto; }</p>



<p></p>



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



<p>※空いているところなら、どこでもいいです。</p>



<p>迷ったら、一番下とかに追記してください。</p>



<p></p>



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



<h4 class="wp-block-heading"><span class="bold">手順3. 下のほうにある「ファイルを更新」ボタンを押す。</span></h4>



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



<figure class="wp-block-image size-large"><img decoding="async" width="130" height="41" src="https://osechi-tech.net/wp-content/uploads/2021/01/44d29d2792be3bad9a9ed98c7bbb20d6.png" alt="【WORDPRESS】スマホで画像がはみ出る場合の解決策(画像②)" class="wp-image-503"/></figure>



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



<p><span class="bold">これで、完了です。</span></p>



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



<h3 class="wp-block-heading">このコマンドの意味</h3>



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



<p>img{ max-width: 100%; height: auto; }の意味ですが、</p>



<div class="wp-block-group box6-m is-layout-constrained wp-block-group-is-layout-constrained">
<ul>
<li>画像の横幅は、画面の100%までが上限ですよ。</li>



<li>画像の縦幅は、横幅に合わせてくださいね。</li>
</ul>
</div>



<p>って、感じでしょうか。</p>



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



<h3 class="wp-block-heading">結論からいうと</h3>



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



<p><span class="badge-green">★</span> 大抵の人は、上記の設定でうまくいくようです。</p>



<p>ただ、私の場合、上手くいきませんでした。</p>



<p>多分、理由は私が画像を中央揃えにしていたことが原因だろうと、<br>思います。</p>



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



<p><span class="badge-green">★</span> 画像を中央揃えにしなければ、問題は解決するかもしれません。</p>



<p>しかし、中央揃えのままで、なんとかしたいという人も多いはず。</p>



<p>だって、中央揃えのほうが見映えがいいじゃないですか。</p>



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



<p>（ここは、ゼッタイに妥協しない。ゼッタイに。）</p>



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



<p><span class="badge-pink">★</span> なので、そういう人には解決策②がおすすめです。</p>



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



<h2 class="wp-block-heading">[WORDPRESS]スマホで画像はみ出る問題の解決策②</h2>



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



<h3 class="wp-block-heading">私の場合、これで解決しました</h3>



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



<p>下の記述を、テーマエディタで、&nbsp;style.cssに書き込むと解決するようです。</p>



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



<p>.wp-block-image{ max-width: 100%; height: auto; }<br>figure{ max-width: 100%; height: auto; }　　<br>img { max-width: 100%; height: auto; }　　</p>



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



<h3 class="wp-block-heading">やり方を丁寧に書くと</h3>



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



<h4 class="wp-block-heading">手順1. ダッシュボード＝＞外観＝＞テーマエディタをクリック</h4>



<figure class="wp-block-image size-large"><img decoding="async" width="248" height="299" src="https://osechi-tech.net/wp-content/uploads/2021/01/47f8654e4e3b3b8f85600b96e6b7daac.png" alt="【WORDPRESS】スマホで画像がはみ出る場合の解決策(画像③）" class="wp-image-502"/></figure>



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



<h4 class="wp-block-heading">手順2. style.cssというファイルが開くので、以下の記述を追加</h4>



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



<p>.wp-block-image{ max-width: 100%; height: auto; }<br>figure{ max-width: 100%; height: auto; }　　<br>img { max-width: 100%; height: auto; }　</p>



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



<p>※空いているところなら、どこでもいいです。</p>



<p>迷ったら、一番下とかに追記してください。</p>



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



<h4 class="wp-block-heading">手順3. 下のほうにある「ファイルを更新」ボタンを押す。</h4>



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



<figure class="wp-block-image size-large"><img decoding="async" width="130" height="41" src="https://osechi-tech.net/wp-content/uploads/2021/01/44d29d2792be3bad9a9ed98c7bbb20d6.png" alt="【WORDPRESS】スマホで画像がはみ出る場合の解決策(画像④）" class="wp-image-503"/></figure>



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



<p><span class="bold">はい、これで完了です。</span></p>



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



<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5896543996649185" crossorigin="anonymous"></script>
<ins class="adsbygoogle" style="display:block; text-align:center;" data-ad-layout="in-article" data-ad-format="fluid" data-ad-client="ca-pub-5896543996649185" data-ad-slot="1152501239"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



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



<h3 class="wp-block-heading">おそらく</h3>



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



<p><span class="badge-green">★</span> WORDPRESSで、画像を中央揃えに設定した場合、figureという領域の中に画像が配置されます。</p>



<p>その状態で、画像の横幅の上限を100%に設定すると、画面の100%じゃなく、figure領域内の100%に設定されてしまう。</p>



<p>ということっぽいですね。</p>



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



<p>※上記の設定の3行のうち、最初の一行はいらないかも。</p>



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



<h3 class="wp-block-heading">注意点：</h3>



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



<p>つぎのような場合があります。</p>



<div class="wp-block-group box6-m is-layout-constrained wp-block-group-is-layout-constrained">
<ul>
<li>スマホでは、画像がはみ出ずに表示されている</li>



<li>WORDPRESSの投稿のカスタマイズで確認すると、画像がはみ出たまま表示される</li>
</ul>
</div>



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



<p>そういうこともありますので、実際にスマホの画面で確認してくださいね。</p>



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



<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5896543996649185" crossorigin="anonymous"></script>
<ins class="adsbygoogle" style="display:block; text-align:center;" data-ad-layout="in-article" data-ad-format="fluid" data-ad-client="ca-pub-5896543996649185" data-ad-slot="1152501239"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



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



<h2 class="wp-block-heading">[WORDPRESS]スマホで画像はみ出る問題の解決策（まとめ）</h2>



<figure class="wp-block-image aligncenter size-large is-resized"><img decoding="async" src="https://osechi-tech.net/wp-content/uploads/2021/01/jeep-1639961_960_720.jpg" alt="" class="wp-image-514" style="aspect-ratio:696/521" width="696" height="521" srcset="https://osechi-tech.net/wp-content/uploads/2021/01/jeep-1639961_960_720.jpg 800w, https://osechi-tech.net/wp-content/uploads/2021/01/jeep-1639961_960_720-300x225.jpg 300w, https://osechi-tech.net/wp-content/uploads/2021/01/jeep-1639961_960_720-768x576.jpg 768w" sizes="(max-width: 696px) 100vw, 696px" /></figure>



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



<p><span class="badge-green">★</span> スマホで表示すると、画像がはみ出て見にくい問題は、以下ということで、大丈夫だと思います。</p>



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



<p>①大抵の場合、style.cssに、以下を追記で解決。</p>



<p>img { max-width: 100%; height: auto; }　</p>



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



<p>②画像を中央揃えにしている場合、以下を追記で解決</p>



<p>.wp-block-image{ max-width: 100%; height: auto; }<br>figure{ max-width: 100%; height: auto; }　　<br>img { max-width: 100%; height: auto; }　</p>



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



<p><span class="badge-pink">★</span> 参考になりましたか？</p>



<p>これで解決したという方がいれば、よかったです。<br><br>では、またまた～。</p>



<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5896543996649185" crossorigin="anonymous"></script>
<ins class="adsbygoogle" style="display:block" data-ad-format="autorelaxed" data-ad-client="ca-pub-5896543996649185" data-ad-slot="7061898498"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://osechi-tech.net/wordpress-image-over/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
