<?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サイト制作に関するノウハウブログ｜IWACODE</title>
	<atom:link href="https://iwacode-web.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://iwacode-web.com</link>
	<description>初心者でもわかりやすいようにWeb制作に関するノウハウを発信していきます。コーディングだけではなく、デザイン、WordPressに関する情報、フリーランスとしてのマインド、活動についても発信していきます。</description>
	<lastBuildDate>Thu, 16 Oct 2025 04:31:42 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://iwacode-web.com/wp-content/uploads/2023/12/cropped-site-icon-32x32.png</url>
	<title>Webサイト制作に関するノウハウブログ｜IWACODE</title>
	<link>https://iwacode-web.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<atom:link rel="hub" href="https://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="https://pubsubhubbub.superfeedr.com"/><atom:link rel="hub" href="https://websubhub.com/hub"/>	<item>
		<title>【CSS】スクロールでヘッダーが重なる問題を解決！scroll-padding-topで快適なページ移動を実現しよう！</title>
		<link>https://iwacode-web.com/scroll-padding-top-scroll-fix/</link>
		
		<dc:creator><![CDATA[岩村　彰斗]]></dc:creator>
		<pubDate>Tue, 01 Oct 2024 23:00:00 +0000</pubDate>
				<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[Web制作]]></category>
		<guid isPermaLink="false">https://iwacode-web.com/?p=1087</guid>

					<description><![CDATA[<p><img src="https://iwacode-web.com/wp-content/uploads/2024/10/blog_20241002.png" class="webfeedsFeaturedVisual" /></p>Webサイトを作っていると、固定されたヘッダー（ナビゲーションバーなど）がページをスクロールした時にセクションのタイトルに被ってしまう…なんて経験、ありませんか？特にアンカーリンク（aタグ）やページ内リンクをクリックした [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><img src="https://iwacode-web.com/wp-content/uploads/2024/10/blog_20241002.png" class="webfeedsFeaturedVisual" /></p>
<p>Webサイトを作っていると、固定されたヘッダー（ナビゲーションバーなど）がページをスクロールした時にセクションのタイトルに被ってしまう…なんて経験、ありませんか？特にアンカーリンク（aタグ）やページ内リンクをクリックした際、この問題がよく発生します。この問題を解決してくれるのが、CSSの<code>scroll-padding-top</code>プロパティ！今日は、この便利なプロパティの使い方と、どうしてこの問題が起きるのか、解説していきます！</p>



<h2 class="wp-block-heading">なぜヘッダーが重なるのか？</h2>



<p>アンカーリンクでセクションに飛んだとき、ブラウザは通常セクションの上端を画面上に揃えます。しかし、固定されたヘッダーがあるとセクションタイトルが隠れてしまいます。そこで、<code>scroll-padding-top</code>を使うことで、ヘッダー分の余白を確保してタイトルが隠れないようにします！</p>



<h2 class="wp-block-heading">scroll-padding-topで解決</h2>



<p>それでは、ナビゲーションメニューのリンクをクリックしたときに、セクションタイトルがヘッダーに隠れないようにする方法を具体的に見ていきましょう。</p>



<p>次の例では、各セクションに個別の<code>scroll-padding-top</code>を指定しています。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-html" data-lang="HTML"><code>&lt;header class=&quot;fixed-header&quot;&gt;固定ヘッダー&lt;/header&gt;

&lt;nav&gt;
  &lt;a href=&quot;#section1&quot;&gt;セクション1&lt;/a&gt;
  &lt;a href=&quot;#section2&quot;&gt;セクション2&lt;/a&gt;
  &lt;a href=&quot;#section3&quot;&gt;セクション3&lt;/a&gt;
&lt;/nav&gt;

&lt;section id=&quot;section1&quot;&gt;
  &lt;h2&gt;セクション1&lt;/h2&gt;
  &lt;p&gt;ここはセクション1の内容です。&lt;/p&gt;
&lt;/section&gt;

&lt;section id=&quot;section2&quot;&gt;
  &lt;h2&gt;セクション2&lt;/h2&gt;
  &lt;p&gt;ここはセクション2の内容です。&lt;/p&gt;
&lt;/section&gt;

&lt;section id=&quot;section3&quot;&gt;
  &lt;h2&gt;セクション3&lt;/h2&gt;
  &lt;p&gt;ここはセクション3の内容です。&lt;/p&gt;
&lt;/section&gt;</code></pre></div>



<div class="hcb_wrap"><pre class="prism line-numbers lang-css" data-lang="CSS"><code>html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
}

.fixed-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background-color: #333;
  color: white;
  text-align: center;
  line-height: 60px;
  z-index: 1000;
}

nav {
  margin-top: 60px;
  /* ヘッダーの下にナビゲーションを配置 */
}

nav a {
  margin-right: 10px;
  color: #0073e6;
  text-decoration: none;
}

section {
  padding: 0 20px;
  height: 1000px;
}

#section1 {
  background-color: #eee;
}

#section2 {
  background-color: #ddd;
}

#section3 {
  background-color: #ccc;
}</code></pre></div>



<p>このコードでは、html要素（スクロール元となる親要素）に<code>scroll-padding-top: 60px;</code>を指定しています。これにより、ナビゲーションのリンクをクリックしたとき、固定されたヘッダーがセクションタイトルに被らず、スクロールがスムーズに行われます！</p>



<h2 class="wp-block-heading">カスタム変数でヘッダーの高さを管理しよう</h2>



<p>ヘッダーの高さは変わることがあるので、<code>scroll-padding-top</code>の値も管理しやすくするために、カスタム変数を使うと便利です。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-css" data-lang="CSS"><code>:root {
  --header-height: 60px; /* ヘッダーの高さを変数として管理 */
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

.fixed-header {
  height: var(--header-height);
}</code></pre></div>



<p>こうすることで、将来的にヘッダーの高さを変える場合でも、変数の値を変更するだけで全体が自動的に調整されます。管理が楽になるだけでなく、コードのメンテナンス性も向上します！</p>



<h2 class="wp-block-heading">さいごに</h2>



<p>今回は、各セクションに<code>scroll-padding-top</code>を設定し、ナビゲーションメニューからリンクをクリックした際にヘッダーがセクションに重ならないようにする方法を紹介しました！<code>scroll-padding-top</code>をうまく活用することで、スクロールに関する細かな調整も可能となるため、ぜひ取り入れてみてください！</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>【CSS】【filter】画像にエフェクトをかける方法 &#8211; ホバーした際に写真を白黒からカラーに</title>
		<link>https://iwacode-web.com/css-filter-image-effects-hover/</link>
		
		<dc:creator><![CDATA[岩村　彰斗]]></dc:creator>
		<pubDate>Tue, 01 Oct 2024 07:11:17 +0000</pubDate>
				<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[Web制作]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[コーディング]]></category>
		<category><![CDATA[初心者向け]]></category>
		<guid isPermaLink="false">https://iwacode-web.com/?p=1082</guid>

					<description><![CDATA[<p><img src="https://iwacode-web.com/wp-content/uploads/2024/10/blog_20241001.png" class="webfeedsFeaturedVisual" /></p>CSSのfilterプロパティとは？ CSSの中には、画像にエフェクトを簡単にかけられる「filter」プロパティがあります。 filterを使えば、画像を白黒にしたり、ぼかしを入れたり、明るさやコントラストを調整したり [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><img src="https://iwacode-web.com/wp-content/uploads/2024/10/blog_20241001.png" class="webfeedsFeaturedVisual" /></p>
<h2 class="wp-block-heading"><strong>CSSのfilterプロパティとは？</strong></h2>



<p>CSSの中には、画像にエフェクトを簡単にかけられる「filter」プロパティがあります。</p>



<p>filterを使えば、画像を白黒にしたり、ぼかしを入れたり、明るさやコントラストを調整したりと、いろいろな加工ができます。</p>



<p>「デザインをもうちょっとオシャレにしたいな…」と思ったときに役立つ技の一つなので、ぜひ活用してみてください！</p>



<h2 class="wp-block-heading">よく使われるfilter効果</h2>



<div class="hcb_wrap"><pre class="prism line-numbers lang-css" data-lang="CSS"><code>filter: grayscale(100%);    /* 画像をモノクロにする */
filter: blur(5px);          /* ぼかし効果 */
filter: brightness(150%);   /* 明るさ調整 */
filter: contrast(200%);     /* コントラストを調整 */
filter: saturate(300%);     /* 彩度を調整 */
filter: sepia(80%);         /* 画像をセピア色にする */</code></pre></div>



<h2 class="wp-block-heading">filter効果は組み合わせて使用できる</h2>



<p>filterプロパティは、複数の効果を組み合わせて使用できます。</p>



<p>例えば、白黒にした上で少し明るさを加えると、柔らかい印象のモノクロ画像が作れます。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-css" data-lang="CSS"><code>filter: grayscale(100%) brightness(120%);</code></pre></div>



<h2 class="wp-block-heading">動きのあるエフェクトを作るには？</h2>



<p>ただエフェクトをかけるだけでなく、動きがあるとさらに魅力が増します！</p>



<p>例えば、画像がグレースケール（モノクロ）からカラーに変わるようなアニメーションを加えてみましょう。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-css" data-lang="CSS"><code>img {
  filter: grayscale(100%);
  transition: filter 1s ease-in-out;
}
img:hover {
  filter: grayscale(0%);
}</code></pre></div>



<p>このコードでは、画像にマウスをホバーすると、徐々にカラーに戻るアニメーションが実現できます。</p>



<p>ホバーを外すとまたモノクロに戻るので、動きのあるスタイリッシュな演出ができますね！</p>



<h2 class="wp-block-heading">マスクや影を使った効果でさらにオシャレに！</h2>



<p>次に紹介するのは、画像にマスクや影を加える方法です。例えば、<strong>drop-shadow()</strong>を使えば、画像に立体感を持たせることができます。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-css" data-lang="CSS"><code>filter: drop-shadow(10px 10px 10px rgba(0, 0, 0, 0.5));</code></pre></div>



<p>こうすることで、画像の周りにぼんやりとした影をつけることができ、より深みのあるデザインが可能です。画像の配置や背景次第で、様々な演出に応用できます！</p>



<h2 class="wp-block-heading">filterプロパティを使うときのポイント！</h2>



<p>最後に、filterを使う上で気をつけたいポイントをいくつかご紹介します。</p>



<h3 class="wp-block-heading">ブラウザ対応</h3>



<p>filterプロパティはほとんどのモダンブラウザで対応していますが、古いブラウザでは一部サポートされていないことがあります。念のため、使いたいエフェクトが対応しているか確認しておきましょう。</p>



<h3 class="wp-block-heading">パフォーマンス</h3>



<p>特に大きな画像や多くのエフェクトを同時に適用すると、ページの読み込みやパフォーマンスに影響が出ることがあります。適度に使うのがポイントです！</p>



<h2 class="wp-block-heading">さいごに</h2>



<p>CSSのfilterプロパティを使えば、シンプルに見えるけど、プロっぽいエフェクトを画像に加えることができます！</p>



<p>ホバーアニメーションを使えば、動きのあるデザインが手軽に実現できるので、ぜひ試してみてください！</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>【CSS】【アスペクト比】aspect-ratioプロパティで要素の縦横比を簡単に設定する方法</title>
		<link>https://iwacode-web.com/css-aspect-ratio-tutorial/</link>
		
		<dc:creator><![CDATA[岩村　彰斗]]></dc:creator>
		<pubDate>Tue, 17 Sep 2024 13:14:53 +0000</pubDate>
				<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[Web制作]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[コーディング]]></category>
		<guid isPermaLink="false">https://iwacode-web.com/?p=1072</guid>

					<description><![CDATA[<p><img src="https://iwacode-web.com/wp-content/uploads/2024/09/blog_20240917.png" class="webfeedsFeaturedVisual" /></p>はじめに WEBデザインにおいて、要素の縦横比を調整するのはよくある課題です。特に、画像や動画、カードレイアウトなど、特定のアスペクト比を維持したい場合、従来の方法ではpaddingを利用したトリックやJavaScrip [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><img src="https://iwacode-web.com/wp-content/uploads/2024/09/blog_20240917.png" class="webfeedsFeaturedVisual" /></p>
<h2 class="wp-block-heading">はじめに</h2>



<p>WEBデザインにおいて、要素の縦横比を調整するのはよくある課題です。特に、画像や動画、カードレイアウトなど、特定のアスペクト比を維持したい場合、従来の方法では<code>padding</code>を利用したトリックやJavaScriptによる調整が必要でした。しかし、CSSの<code>aspect-ratio</code>プロパティを使えば、これが非常に簡単になります！</p>



<p>この記事では、<code>aspect-ratio</code>プロパティの使い方や注意点について詳しく解説していきます。</p>



<h2 class="wp-block-heading">概要</h2>



<p><code>aspect-ratio</code>プロパティは、要素の縦横の比率を簡単に指定できるCSSのプロパティです。これを使うと、幅に合わせて<strong><span class="swl-marker mark_yellow">高さを自動で計算</span></strong>してくれるので、面倒な調整が不要になります。値の指定は「<strong><span class="swl-marker mark_yellow">横:縦</span></strong>」の形式で行います。例えば、<code>aspect-ratio: 16 / 9;</code>と書けば、その要素は<strong><span class="swl-marker mark_yellow">常に16:9の比率を保つ</span></strong>ようになります。</p>



<p>それでは、このプロパティを使ったシンプルな例を見てみましょう。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-html" data-lang="HTML"><code>&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;ja&quot;&gt;
&lt;head&gt;
    &lt;meta charset=&quot;UTF-8&quot;&gt;
    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;
    &lt;title&gt;aspect-ratioの例&lt;/title&gt;
    &lt;style&gt;
        .aspect-box {
            width: 100%;
            max-width: 500px;
            aspect-ratio: 16 / 9;
            background-color: #e0e0e0;
            border: 2px solid #333;
        }
    &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;div class=&quot;aspect-box&quot;&gt;&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre></div>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="518" height="300" src="https://iwacode-web.com/wp-content/uploads/2024/09/image-28.png" alt="" class="wp-image-1073" style="width:300px;height:auto" srcset="https://iwacode-web.com/wp-content/uploads/2024/09/image-28.png 518w, https://iwacode-web.com/wp-content/uploads/2024/09/image-28-300x174.png 300w" sizes="(max-width: 518px) 100vw, 518px" /></figure>



<p>この例では、<code>.aspect-box</code>クラスの要素に<code>aspect-ratio: 16 / 9;</code>を設定しています。この要素の幅は100%（最大500px）に設定されており、それに合わせて縦横比16:9が自動的に保たれます。<span class="swl-marker mark_yellow">画面サイズが変わっても、この比率は変わらず</span>、見た目がきれいに維持されるのがポイントです。</p>



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



<p><code>aspect-ratio</code>プロパティは、<span class="swl-marker mark_yellow">明示的に高さや幅が指定されている場合、それらのプロパティに影響を受けます</span>。例えば、要素に<span class="swl-marker mark_yellow">すでに高さが設定</span>されていると、<code>aspect-ratio</code>はCSSの記載の順番によっては<span class="swl-marker mark_yellow">無視される</span>可能性があります。このため、<code>aspect-ratio</code>を使う際は、他のCSSプロパティとの組み合わせに気をつけてください。</p>



<h2 class="wp-block-heading"><strong>活用例</strong></h2>



<p><code>aspect-ratio</code>をうまく使うと、レイアウトに統一感を持たせることができます。例えば、ギャラリーの画像やカードのレイアウトに使うと、画像のサイズがバラバラでも一貫した比率で表示されるので、全体のデザインが整いやすくなります。</p>



<p>以下に、カードレイアウトに<code>aspect-ratio</code>を使った例を紹介します。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-html" data-lang="HTML"><code>&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;ja&quot;&gt;
&lt;head&gt;
    &lt;meta charset=&quot;UTF-8&quot;&gt;
    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;
    &lt;title&gt;カードレイアウトの例&lt;/title&gt;
    &lt;style&gt;
        .card-container {
            display: flex;
            gap: 16px;
            flex-wrap: wrap;
            max-width: 1000px;
            padding: 100px;
            width: 100%;
            margin: 0 auto;
        }
        .card {
            flex: 1 1 calc(33.333% - 16px);
            aspect-ratio: 4 / 3;
            background-color: #f5f5f5;
            border: 1px solid #ccc;
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            font-size: 1.2rem;
        }
    &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;div class=&quot;card-container&quot;&gt;
        &lt;div class=&quot;card&quot;&gt;カード1&lt;/div&gt;
        &lt;div class=&quot;card&quot;&gt;カード2&lt;/div&gt;
        &lt;div class=&quot;card&quot;&gt;カード3&lt;/div&gt;
        &lt;div class=&quot;card&quot;&gt;カード4&lt;/div&gt;
        &lt;div class=&quot;card&quot;&gt;カード5&lt;/div&gt;
        &lt;div class=&quot;card&quot;&gt;カード6&lt;/div&gt;
    &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre></div>



<figure class="wp-block-image size-large is-resized"><img decoding="async" width="1024" height="529" src="https://iwacode-web.com/wp-content/uploads/2024/09/image-29-1024x529.png" alt="" class="wp-image-1074" style="width:557px;height:auto" srcset="https://iwacode-web.com/wp-content/uploads/2024/09/image-29-1024x529.png 1024w, https://iwacode-web.com/wp-content/uploads/2024/09/image-29-300x155.png 300w, https://iwacode-web.com/wp-content/uploads/2024/09/image-29-768x397.png 768w, https://iwacode-web.com/wp-content/uploads/2024/09/image-29.png 1042w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>この例では、<code>.card</code>クラスに<code>aspect-ratio: 4 / 3;</code>を設定して、カードの幅に対して4:3の比率を保っています。これにより、各カードが均等に配置され、レイアウト全体が整った印象になります。</p>



<h2 class="wp-block-heading">おわりに</h2>



<p>いかがでしたでしょうか。今回は<code>aspect-ratio</code>プロパティについて解説させていただきました。</p>



<p><code>aspect-ratio</code>プロパティを使うと、これまで難しかった要素の縦横比の調整がとてもシンプルになります。<br>自身で計算して値を算出しなくともプロパティ側で自動的に割り当ててくれるため、非常に便利です。<code>aspect-ratio</code>をうまく活用して、見た目が美しいデザインを実現していきましょう！</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>【CSS】【三角形】clip-pathの使い方 &#8211; borderは使わずpolygon,circleで多様な形を切り取る方法と実例</title>
		<link>https://iwacode-web.com/css-clip-path-effect/</link>
		
		<dc:creator><![CDATA[岩村　彰斗]]></dc:creator>
		<pubDate>Sun, 15 Sep 2024 04:55:43 +0000</pubDate>
				<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[Web制作]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[コーディング]]></category>
		<category><![CDATA[初心者向け]]></category>
		<guid isPermaLink="false">https://iwacode-web.com/?p=1046</guid>

					<description><![CDATA[<p><img src="https://iwacode-web.com/wp-content/uploads/2024/09/blog_20240915-1.png" class="webfeedsFeaturedVisual" /></p>皆さんこんにちは！IWACODEの岩村です。 CSSのclip-pathプロパティを使うと、画像や要素をさまざまな形に切り取ることができます。borderプロパティでも三角形を作ることはできるんですが、少し手間がかかるの [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><img src="https://iwacode-web.com/wp-content/uploads/2024/09/blog_20240915-1.png" class="webfeedsFeaturedVisual" /></p>
<p>皆さんこんにちは！IWACODEの岩村です。</p>



<p>CSSの<code>clip-path</code>プロパティを使うと、画像や要素をさまざまな形に切り取ることができます。<code>border</code>プロパティでも三角形を作ることはできるんですが、少し手間がかかるのと少々わかりにくいところがあります。<br><code>clip-path</code>を使うともっと簡単に、そして柔軟に形を作ることができるので、特に三角形や直角三角形をデザインに取り入れたいときにはおすすめです。</p>



<p>本記事では、<code>clip-path</code>を使って基本的な三角形から少し変わった形状までを作る方法を紹介し、それらを実際のデザインにどのように応用できるかも解説していきます。WEBデザインにちょっとしたアクセントを加えたい方には、<code>clip-path</code>はとても便利なプロパティです。</p>



<p>さまざまな形の作り方と、その活用法をご覧ください！</p>



<h2 class="wp-block-heading">clip-pathとは？</h2>



<p><code>clip-path</code>は、要素の表示領域を指定するCSSプロパティです。形状を定義することで、その形に合わせて要素をクリップ（切り取り）できます。</p>



<p><code>clip-path</code>を使うことで、単純な四角形以外の形状をCSSだけで実現できます。</p>



<h2 class="wp-block-heading">clip-pathで作る基本的な形</h2>



<h3 class="wp-block-heading">三角形の作成</h3>



<p>三角形を作成する最も簡単な方法の一つが<code>clip-path</code>を使うことです。まずは<code>clip-path</code>を使った三角形の作成方法を見てみましょう。</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="251" height="249" src="https://iwacode-web.com/wp-content/uploads/2024/09/image-22.png" alt="" class="wp-image-1048" style="width:200px" srcset="https://iwacode-web.com/wp-content/uploads/2024/09/image-22.png 251w, https://iwacode-web.com/wp-content/uploads/2024/09/image-22-150x150.png 150w" sizes="(max-width: 251px) 100vw, 251px" /></figure>



<div class="hcb_wrap"><pre class="prism line-numbers lang-html" data-lang="HTML"><code>&lt;!-- 三角形 --&gt;
&lt;div class=&quot;triangle&quot;&gt;&lt;/div&gt;</code></pre></div>



<div class="hcb_wrap"><pre class="prism line-numbers lang-html" data-lang="HTML"><code>.triangle {
  width: 150px;
  height: 150px;
  background-color: #3498db;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}</code></pre></div>



<h4 class="wp-block-heading">コードの解説</h4>



<p><code>clip-path: polygon()</code>を使って三角形の頂点を指定しています。<code>polygon</code>関数の引数は、要素内の各頂点の位置を示します。この例では、3つの頂点が指定されています。</p>



<ul class="wp-block-list">
<li><code>50% 0%</code>：要素の上部中央を示します（x軸の50%、y軸の0%）</li>



<li><code>0% 100%</code>：要素の左下を示します（x軸の0%、y軸の100%）</li>



<li><code>100% 100%</code>：要素の右下を示します（x軸の100%、y軸の100%）</li>
</ul>



<h2 class="wp-block-heading">応用形の作成</h2>



<h3 class="wp-block-heading">直角三角形</h3>



<p>直角三角形も<code>clip-path</code>を使って簡単に作成できます。</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="255" height="250" src="https://iwacode-web.com/wp-content/uploads/2024/09/image-23.png" alt="" class="wp-image-1049" style="width:200px"/></figure>



<div class="hcb_wrap"><pre class="prism line-numbers lang-html" data-lang="HTML"><code>&lt;!-- 直角三角形 --&gt;
&lt;div class=&quot;right-triangle&quot;&gt;&lt;/div&gt;</code></pre></div>



<div class="hcb_wrap"><pre class="prism line-numbers lang-html" data-lang="HTML"><code>.right-triangle {
  width: 100px;
  height: 100px;
  background-color: #e74c3c;
  clip-path: polygon(0 0, 100% 100%, 0 100%);
}</code></pre></div>



<h4 class="wp-block-heading">コードの解説</h4>



<p>この例では、3つの頂点を以下のように指定しています。</p>



<ul class="wp-block-list">
<li><code>0 0</code>：要素の左上を示します（x軸の0、y軸の0）</li>



<li><code>100% 100%</code>：要素の右下を示します（x軸の100%、y軸の100%）</li>



<li><code>0 100%</code>：要素の左下を示します（x軸の0、y軸の100%）</li>
</ul>



<h3 class="wp-block-heading">台形</h3>



<p>台形も<code>clip-path</code>を使って簡単に作成可能です。</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="252" height="258" src="https://iwacode-web.com/wp-content/uploads/2024/09/image-24.png" alt="" class="wp-image-1050" style="width:200px"/></figure>



<div class="hcb_wrap"><pre class="prism line-numbers lang-html" data-lang="HTML"><code>&lt;!-- 台形 --&gt;
&lt;div class=&quot;trapezoid&quot;&gt;&lt;/div&gt;</code></pre></div>



<div class="hcb_wrap"><pre class="prism line-numbers lang-plain"><code>.trapezoid {
  width: 200px;
  height: 100px;
  background-color: #9b59b6;
  clip-path: polygon(25% 0%, 75% 0%, 100% 100%, 0% 100%);
}</code></pre></div>



<h2 class="wp-block-heading">実用例</h2>



<h3 class="wp-block-heading">カスタム形状の画像切り取り</h3>



<h4 class="wp-block-heading">円形</h4>



<p><code>clip-path</code>を使うと、画像を任意の形状にクリップすることが可能です。例えば、プロフィール写真を円形することもできます。</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="257" height="249" src="https://iwacode-web.com/wp-content/uploads/2024/09/image-25.png" alt="" class="wp-image-1051" style="width:200px"/></figure>



<div class="hcb_wrap"><pre class="prism line-numbers lang-html" data-lang="HTML"><code>&lt;!-- 円形（プロフィール画像の例） --&gt;
&lt;div class=&quot;profile-image&quot;&gt;&lt;/div&gt;</code></pre></div>



<div class="hcb_wrap"><pre class="prism line-numbers lang-css" data-lang="CSS"><code>.profile-image {
  width: 150px;
  height: 150px;
  background-image: url(&#39;https://via.placeholder.com/150&#39;);
  background-size: cover;
  clip-path: circle(50%);
}</code></pre></div>



<h4 class="wp-block-heading">多角形</h4>



<p>頂点を増やすことで以下のように多角形も作成することが可能です。</p>



<figure class="wp-block-image size-full"><img decoding="async" width="254" height="249" src="https://iwacode-web.com/wp-content/uploads/2024/09/image-26.png" alt="" class="wp-image-1052"/></figure>



<div class="hcb_wrap"><pre class="prism line-numbers lang-html" data-lang="HTML"><code>&lt;div class=&quot;hexagon&quot;&gt;&lt;/div&gt;</code></pre></div>



<div class="hcb_wrap"><pre class="prism line-numbers lang-css" data-lang="CSS"><code>.hexagon {
  width: 150px;
  height: 150px;
  background-color: #3498db;
  clip-path: polygon(
    /* 上辺中央 */
    50% 0%,
    /* 右上 */
    100% 25%,
    /* 右下 */
    100% 75%,
    /* 下辺中央 */
    50% 100%,
    /* 左下 */
    0% 75%,
    /* 左上 */
    0% 25%
    );
}</code></pre></div>



<h4 class="wp-block-heading">三角形で吹き出しを実装</h4>



<p>吹き出しの角の部分を疑似要素を使用して作成しております。</p>



<p>positionプロパティにて三角形の位置を調整することで吹き出しのデザインを実現しています。</p>



<p>positionプロパティの指定によっては右側に角を付けることも可能です。</p>



<figure class="wp-block-image size-full"><img decoding="async" width="260" height="158" src="https://iwacode-web.com/wp-content/uploads/2024/09/image-27.png" alt="" class="wp-image-1053"/></figure>



<div class="hcb_wrap"><pre class="prism line-numbers lang-html" data-lang="HTML"><code>&lt;div class=&quot;speech-bubble&quot;&gt;吹き出しを作成&lt;/div&gt;</code></pre></div>



<div class="hcb_wrap"><pre class="prism line-numbers lang-css" data-lang="CSS"><code>/* 吹き出しの本体部分 */
.speech-bubble {
  position: relative;
  background-color: #f0f0f0;
  padding: 1em;
  border-radius: 10px;
  width: fit-content;
  text-align: center;
  border: 1px solid #f0f0f0;
}

/* 三角形の部分 */
.speech-bubble::after {
  content: &quot;&quot;;
  display: block;
  background-color: #f0f0f0;
  position: absolute;
  inset: 100% 0 auto 0;
  margin-inline: auto;
  width: 30px;
  height: 30px;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}</code></pre></div>



<h2 class="wp-block-heading">さいごに</h2>



<p>いかがでしたでしょうか！</p>



<p><code>clip-path</code>を使用すると、要素や画像をさまざまな形にクリップでき、三角形などのデザインも容易に作成することができます。</p>



<p><code>clip-path</code>は非常に便利なプロパティのため、ぜひ使いこなして実線に役立てていきましょう！</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>【WordPress】CFSの代替に最適！Lazy Blocksで簡単カスタムフィールド設定【繰り返し処理（リピーター）も対応】</title>
		<link>https://iwacode-web.com/cfs-to-lazy-blocks-repeaters/</link>
		
		<dc:creator><![CDATA[岩村　彰斗]]></dc:creator>
		<pubDate>Fri, 06 Sep 2024 10:27:16 +0000</pubDate>
				<category><![CDATA[Web制作]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[コーディング]]></category>
		<guid isPermaLink="false">https://iwacode-web.com/?p=992</guid>

					<description><![CDATA[<p><img src="https://iwacode-web.com/wp-content/uploads/2024/09/blog_20240906.png" class="webfeedsFeaturedVisual" /></p>皆さんこんにちは！IWACODEの岩村です。 WordPressのカスタムフィールドを利用する際、Custom Field Suite（CFS）を使っていた方も多いでしょう。しかし、脆弱性の発見により、現在CFSの使用を [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><img src="https://iwacode-web.com/wp-content/uploads/2024/09/blog_20240906.png" class="webfeedsFeaturedVisual" /></p>
<p>皆さんこんにちは！IWACODEの岩村です。</p>



<p>WordPressのカスタムフィールドを利用する際、<strong>Custom Field Suite（CFS）</strong>を使っていた方も多いでしょう。しかし、脆弱性の発見により、現在CFSの使用を見直す必要が出てきています。多くの方が代替として<strong>Advanced Custom Field（ACF）</strong>を検討していますが、ACFの無料版には繰り返しフィールド機能がなく、リピーター処理ができない点で悩んでいる方も少なくありません。</p>



<p>そこで今回は、<strong><span class="swl-marker mark_yellow">Lazy Blocks</span></strong>というプラグインを使って、<strong><span class="swl-marker mark_yellow">繰り返し処理に対応したブロックの作成方法を</span></strong>ご紹介します。</p>



<h2 class="wp-block-heading">Lazy Blocksの特徴</h2>



<p>Lazy Blocksは、WordPressのブロックエディター（Gutenberg）でカスタムブロックを作成・管理できるプラグインです。特に、繰り返しフィールド（リピーター機能）を簡単に実装できる点で優れています。以下に、Lazy Blocksの主な特徴をまとめました。</p>



<dl class="swell-block-dl is-style-border">
<dt class="swell-block-dl__dt"><strong>Gutenberg完全対応</strong></dt>



<dd class="swell-block-dl__dd">
<p>Lazy BlocksはGutenbergエディターに完全対応しており、ビジュアル的なブロック編集が可能です。これにより、コーディング不要でカスタムブロックを作成できます。</p>
</dd>



<dt class="swell-block-dl__dt"><strong>繰り返しフィールドのサポート</strong></dt>



<dd class="swell-block-dl__dd">
<p>ACF（無料版）で対応が難しい繰り返し処理も、Lazy Blocksでは簡単に設定可能です。これにより、商品リストやスタッフ紹介ページなど、複数の要素を繰り返し表示したいケースに適しています。</p>
</dd>



<dt class="swell-block-dl__dt"><strong>カスタムフィールドの柔軟性</strong></dt>



<dd class="swell-block-dl__dd">
<p>Lazy Blocksは、テキスト、画像、数値、リストなど多様なフィールドタイプをサポートしており、フィールドのグルーピングや条件付き表示にも対応しています。</p>
</dd>
</dl>



<h2 class="wp-block-heading">Lazy Blocksのインストール、設定の手順</h2>



<p>次に、CFSで作成していたカスタムフィールドをLazy Blocksに移行する手順を説明します。</p>



<p>今回はスタッフ紹介のブロックを作成し、WordPressのPHP関数を使用し取得してみようと思います。</p>



<figure class="wp-block-image size-full"><img decoding="async" width="569" height="324" src="https://iwacode-web.com/wp-content/uploads/2024/09/image.png" alt="" class="wp-image-997" srcset="https://iwacode-web.com/wp-content/uploads/2024/09/image.png 569w, https://iwacode-web.com/wp-content/uploads/2024/09/image-300x171.png 300w" sizes="(max-width: 569px) 100vw, 569px" /></figure>



<h3 class="wp-block-heading">Lazy Blocksのインストールと設定</h3>



<p>WordPress管理画面でLazy Blocksをインストール、有効化します。</p>



<p>有効化すると管理画面に以下のように表示されます。</p>



<figure class="wp-block-image size-full"><img decoding="async" width="210" height="248" src="https://iwacode-web.com/wp-content/uploads/2024/09/image-1.png" alt="" class="wp-image-998"/></figure>



<p>Lazy Blocksを有効化したら、「Lazy Blocks」→「新規投稿を追加」からブロックの作成を開始します。フィールド名やフィールドタイプを設定していきます。</p>



<p>※サンプルブロックは必要ないので削除して問題ありません。</p>



<figure class="wp-block-image size-full"><img decoding="async" width="1000" height="429" src="https://iwacode-web.com/wp-content/uploads/2024/09/Group-73.png" alt="" class="wp-image-1000" srcset="https://iwacode-web.com/wp-content/uploads/2024/09/Group-73.png 1000w, https://iwacode-web.com/wp-content/uploads/2024/09/Group-73-300x129.png 300w, https://iwacode-web.com/wp-content/uploads/2024/09/Group-73-768x329.png 768w" sizes="(max-width: 1000px) 100vw, 1000px" /></figure>



<h3 class="wp-block-heading">ブロックを作成</h3>



<figure class="wp-block-image size-full"><img decoding="async" width="1000" height="481" src="https://iwacode-web.com/wp-content/uploads/2024/09/image-3.png" alt="" class="wp-image-1001" srcset="https://iwacode-web.com/wp-content/uploads/2024/09/image-3.png 1000w, https://iwacode-web.com/wp-content/uploads/2024/09/image-3-300x144.png 300w, https://iwacode-web.com/wp-content/uploads/2024/09/image-3-768x369.png 768w" sizes="(max-width: 1000px) 100vw, 1000px" /></figure>



<p>このような画面が表示されるので、以下の手順にて登録していきます。</p>



<figure class="wp-block-image size-full"><img decoding="async" width="1000" height="492" src="https://iwacode-web.com/wp-content/uploads/2024/09/20240906-02.png" alt="" class="wp-image-1002" srcset="https://iwacode-web.com/wp-content/uploads/2024/09/20240906-02.png 1000w, https://iwacode-web.com/wp-content/uploads/2024/09/20240906-02-300x148.png 300w, https://iwacode-web.com/wp-content/uploads/2024/09/20240906-02-768x378.png 768w" sizes="(max-width: 1000px) 100vw, 1000px" /></figure>



<ol class="wp-block-list">
<li>ブロック名を入力（ひとつ前の画面に一覧として表示されます）</li>



<li>SLUG名を登録（PHPにて取得する際にこちらの名称をキーにして取得します）</li>



<li>アイコンを設定します。グーテンベルク上で表示されるアイコンです。</li>



<li>カテゴリを設定します。作成したブロック定義をグーテンベルク上の選択画面のどのカテゴリに入れるかの指定になります。</li>



<li>グーテンベルク上でデータを登録する際に、グーテンベルク上で操作するのか、それとも右側の入力エリアで操作するのかの指定となります。</li>
</ol>



<h3 class="wp-block-heading"> 繰り返しの項目を作成</h3>



<p>次に繰り返し項目（リピーター）を設定していきます。</p>



<figure class="wp-block-image size-full"><img decoding="async" width="1000" height="362" src="https://iwacode-web.com/wp-content/uploads/2024/09/20240906-03.png" alt="" class="wp-image-1005" srcset="https://iwacode-web.com/wp-content/uploads/2024/09/20240906-03.png 1000w, https://iwacode-web.com/wp-content/uploads/2024/09/20240906-03-300x109.png 300w, https://iwacode-web.com/wp-content/uploads/2024/09/20240906-03-768x278.png 768w" sizes="(max-width: 1000px) 100vw, 1000px" /></figure>



<ol class="wp-block-list">
<li>繰り返し項目の名称を登録します。グーテンベルク上で表示されるラベルとなりますのでわかりやすい名前が良いです。</li>



<li>NAMEを登録します。DBに登録する際のキーとなる情報になるので、他と被らないように指定してください。後ほどPHPで取得する際にこちらの値を指定します。</li>



<li>リストから繰り返しを選択します。※結構下の方にあります。</li>



<li>こちらは繰り返し項目を追加していた際に表示される名称となります。グーテンベルク上では{{#}}には連番が割り当てられるため、実際には｛｛｝｝は表示されません。</li>
</ol>



<h3 class="wp-block-heading">繰り返し内の入力項目を作成</h3>



<p>今回はスタッフ紹介のため、以下の項目を作成します。</p>



<ul class="wp-block-list">
<li><strong>スタッフ画像（image）</strong></li>



<li><strong>スタッフ名（text）</strong></li>



<li><strong>ひとことコメント（textarea）</strong></li>
</ul>



<p><strong><span class="swl-marker mark_yellow">Hide Child Controls</span></strong>を押下し、繰り返しの中に入力項目を作成します。</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="133" src="https://iwacode-web.com/wp-content/uploads/2024/09/Group-74-1024x133.png" alt="" class="wp-image-1017" srcset="https://iwacode-web.com/wp-content/uploads/2024/09/Group-74-1024x133.png 1024w, https://iwacode-web.com/wp-content/uploads/2024/09/Group-74-300x39.png 300w, https://iwacode-web.com/wp-content/uploads/2024/09/Group-74-768x100.png 768w, https://iwacode-web.com/wp-content/uploads/2024/09/Group-74-1536x200.png 1536w, https://iwacode-web.com/wp-content/uploads/2024/09/Group-74.png 1826w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<h4 class="wp-block-heading">画像</h4>



<figure class="wp-block-image size-full"><img decoding="async" width="1000" height="408" src="https://iwacode-web.com/wp-content/uploads/2024/09/image-12.png" alt="" class="wp-image-1018" srcset="https://iwacode-web.com/wp-content/uploads/2024/09/image-12.png 1000w, https://iwacode-web.com/wp-content/uploads/2024/09/image-12-300x122.png 300w, https://iwacode-web.com/wp-content/uploads/2024/09/image-12-768x313.png 768w" sizes="(max-width: 1000px) 100vw, 1000px" /></figure>



<ol class="wp-block-list">
<li><strong>LABELに名称を設定</strong></li>



<li><strong>NAMEにキー情報を指定</strong></li>



<li><strong>TYPEに画像で指定</strong></li>
</ol>



<h4 class="wp-block-heading">テキスト</h4>



<figure class="wp-block-image size-full"><img decoding="async" width="1000" height="448" src="https://iwacode-web.com/wp-content/uploads/2024/09/image-13.png" alt="" class="wp-image-1019" srcset="https://iwacode-web.com/wp-content/uploads/2024/09/image-13.png 1000w, https://iwacode-web.com/wp-content/uploads/2024/09/image-13-300x134.png 300w, https://iwacode-web.com/wp-content/uploads/2024/09/image-13-768x344.png 768w" sizes="(max-width: 1000px) 100vw, 1000px" /></figure>



<ol class="wp-block-list">
<li><strong>LABELに名称を設定</strong></li>



<li><strong>NAMEにキー情報を指定</strong></li>



<li><strong>TYPEにテキストを指定</strong></li>
</ol>



<h4 class="wp-block-heading">テキストエリア</h4>



<figure class="wp-block-image size-full"><img decoding="async" width="1000" height="444" src="https://iwacode-web.com/wp-content/uploads/2024/09/image-14.png" alt="" class="wp-image-1020" srcset="https://iwacode-web.com/wp-content/uploads/2024/09/image-14.png 1000w, https://iwacode-web.com/wp-content/uploads/2024/09/image-14-300x133.png 300w, https://iwacode-web.com/wp-content/uploads/2024/09/image-14-768x341.png 768w" sizes="(max-width: 1000px) 100vw, 1000px" /></figure>



<ol class="wp-block-list">
<li><strong>LABELに名称を設定</strong></li>



<li><strong>NAMEにキー情報を指定</strong></li>



<li><strong>TYPEにテキストエリアを指定</strong></li>
</ol>



<h3 class="wp-block-heading">設定したブロックを公開</h3>



<figure class="wp-block-image size-full"><img decoding="async" width="1000" height="478" src="https://iwacode-web.com/wp-content/uploads/2024/09/Group-77.png" alt="" class="wp-image-1023" srcset="https://iwacode-web.com/wp-content/uploads/2024/09/Group-77.png 1000w, https://iwacode-web.com/wp-content/uploads/2024/09/Group-77-300x143.png 300w, https://iwacode-web.com/wp-content/uploads/2024/09/Group-77-768x367.png 768w" sizes="(max-width: 1000px) 100vw, 1000px" /></figure>



<p>画面右上の公開ボタンを押して保存します。<br>※上記の画像は既に公開ボタンを押しているため、ボタンの名前が「保存」になっています。</p>



<figure class="wp-block-image size-full"><img decoding="async" width="1000" height="375" src="https://iwacode-web.com/wp-content/uploads/2024/09/image-9.png" alt="" class="wp-image-1011" srcset="https://iwacode-web.com/wp-content/uploads/2024/09/image-9.png 1000w, https://iwacode-web.com/wp-content/uploads/2024/09/image-9-300x113.png 300w, https://iwacode-web.com/wp-content/uploads/2024/09/image-9-768x288.png 768w" sizes="(max-width: 1000px) 100vw, 1000px" /></figure>



<p>スタッフ紹介ブロックが作成されています。</p>



<h2 class="wp-block-heading">グーテンベルク（ブロックエディタ）にてデータの登録</h2>



<p>グーテンベルク（ブロックエディタ）上で、実際にデータを登録していきます。</p>



<p>ブロックの中に「スタッフ紹介」が追加されています。</p>



<figure class="wp-block-image size-full is-style-default"><img decoding="async" width="1000" height="568" src="https://iwacode-web.com/wp-content/uploads/2024/09/20240906-05.png" alt="" class="wp-image-1015" srcset="https://iwacode-web.com/wp-content/uploads/2024/09/20240906-05.png 1000w, https://iwacode-web.com/wp-content/uploads/2024/09/20240906-05-300x170.png 300w, https://iwacode-web.com/wp-content/uploads/2024/09/20240906-05-768x436.png 768w" sizes="(max-width: 1000px) 100vw, 1000px" /></figure>



<p>こちらを選択すると、以下のようにエディタに追加されます。</p>



<figure class="wp-block-image size-full"><img decoding="async" width="1000" height="489" src="https://iwacode-web.com/wp-content/uploads/2024/09/image-16.png" alt="" class="wp-image-1024" srcset="https://iwacode-web.com/wp-content/uploads/2024/09/image-16.png 1000w, https://iwacode-web.com/wp-content/uploads/2024/09/image-16-300x147.png 300w, https://iwacode-web.com/wp-content/uploads/2024/09/image-16-768x376.png 768w" sizes="(max-width: 1000px) 100vw, 1000px" /></figure>



<p><strong>+Add Row</strong>を押下して画像、スタッフ名、ひとことコメントを登録してきます。</p>



<figure class="wp-block-image size-full"><img decoding="async" width="946" height="747" src="https://iwacode-web.com/wp-content/uploads/2024/09/image-17.png" alt="" class="wp-image-1025" srcset="https://iwacode-web.com/wp-content/uploads/2024/09/image-17.png 946w, https://iwacode-web.com/wp-content/uploads/2024/09/image-17-300x237.png 300w, https://iwacode-web.com/wp-content/uploads/2024/09/image-17-768x606.png 768w" sizes="(max-width: 946px) 100vw, 946px" /></figure>



<p>３名分追加してみました。</p>



<figure class="wp-block-image size-full"><img decoding="async" width="955" height="818" src="https://iwacode-web.com/wp-content/uploads/2024/09/image-19.png" alt="" class="wp-image-1027" srcset="https://iwacode-web.com/wp-content/uploads/2024/09/image-19.png 955w, https://iwacode-web.com/wp-content/uploads/2024/09/image-19-300x257.png 300w, https://iwacode-web.com/wp-content/uploads/2024/09/image-19-768x658.png 768w" sizes="(max-width: 955px) 100vw, 955px" /></figure>



<h2 class="wp-block-heading">PHPファイルにて取得する</h2>



<p>今回作成したブロック、登録した値を取得するコードのサンプルとなります。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-php" data-lang="PHP"><code>&lt;?php
// ブロックデータを取得
$blocks = parse_blocks(get_the_content());

foreach ($blocks as $block) :
  if ($block[&#39;blockName&#39;] === &#39;lazyblock/block-staff&#39;) :

    $staff_list_json = urldecode($block[&#39;attrs&#39;][&#39;staff-list&#39;]);
    $staff_list = json_decode($staff_list_json, true);

    if (!empty($staff_list)) :
      foreach ($staff_list as $staff_item) :
        $staff_image = $staff_item[&#39;staff-image&#39;][&#39;url&#39;];
        $staff_name = $staff_item[&#39;staff-name&#39;];
        $staff_message = $staff_item[&#39;staff-message&#39;];
?&gt;
        &lt;div class=&quot;staff-introduction&quot;&gt;
          &lt;div class=&quot;staff-image&quot;&gt;
            &lt;img src=&quot;&lt;?php echo esc_url($staff_image); ?&gt;&quot; alt=&quot;スタッフ画像&quot;&gt;
          &lt;/div&gt;
          &lt;div class=&quot;staff-info&quot;&gt;
            &lt;h3 class=&quot;staff-name&quot;&gt;&lt;?php echo esc_html($staff_name); ?&gt;&lt;/h3&gt;
            &lt;p class=&quot;staff-message&quot;&gt;&lt;?php echo esc_html($staff_message); ?&gt;&lt;/p&gt;
          &lt;/div&gt;
        &lt;/div&gt;
&lt;?php
      endforeach;
    endif;
  endif;
endforeach;
?&gt;</code></pre></div>



<h3 class="wp-block-heading">主な処理内容</h3>



<h4 class="wp-block-heading">ブロックデータの取得</h4>



<p><code>$blocks = parse_blocks(get_the_content())</code>で、現在のページからすべてのデータを取得します。</p>



<h4 class="wp-block-heading">対象ブロックの判別</h4>



<p>取得したブロックデータの中から、<code>blockName</code>が<code>lazyblock/block-staff</code>であるブロックを判定します。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-php" data-lang="PHP"><code>  if ($block[&#39;blockName&#39;] === &#39;lazyblock/block-staff&#39;) :</code></pre></div>



<h4 class="wp-block-heading">データのデコード</h4>



<p><code>urldecode()</code>関数を使用して、エンコードされたスタッフリストデータをデコードし、<code>json_decode()</code>関数でJSON形式のデータをPHPの配列として変換します。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-php" data-lang="PHP"><code>    $staff_list_json = urldecode($block[&#39;attrs&#39;][&#39;staff-list&#39;]);
    $staff_list = json_decode($staff_list_json, true);</code></pre></div>



<p>データがエンコードされていたため、上記の処理にてデータが正常に見えるように調整しております。</p>



<h4 class="wp-block-heading">スタッフデータのループ処理</h4>



<p>デコードしたデータが存在する場合にのみ、各スタッフの情報をループ処理で展開します。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-php" data-lang="PHP"><code>if (!empty($staff_list)) :
  foreach ($staff_list as $staff_item) :</code></pre></div>



<h3 class="wp-block-heading">出力結果</h3>



<p>CSSは最低限とし、ページ上出力した結果が以下のようになります。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-css" data-lang="CSS"><code>  .staff-introduction {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #ddd;
    width: min(964px, 100%);
    margin: 0 auto;
    padding: 30px 0;
  }

  .staff-image img {
    width: 150px;
    border-radius: 50%;
    margin-right: 20px;
  }

  .staff-info {
    display: flex;
    flex-direction: column;
  }

  .staff-name {
    font-size: 1.2em;
    margin: 0;
    font-weight: bold;
  }

  .staff-message {
    margin-top: 10px;
    font-style: italic;
    color: #555;
  }</code></pre></div>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="498" src="https://iwacode-web.com/wp-content/uploads/2024/09/image-21-1024x498.png" alt="" class="wp-image-1029" srcset="https://iwacode-web.com/wp-content/uploads/2024/09/image-21-1024x498.png 1024w, https://iwacode-web.com/wp-content/uploads/2024/09/image-21-300x146.png 300w, https://iwacode-web.com/wp-content/uploads/2024/09/image-21-768x374.png 768w, https://iwacode-web.com/wp-content/uploads/2024/09/image-21.png 1163w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading">さいごに</h2>



<p>いかがでしたでしょうか。</p>



<p><strong><span class="swl-marker mark_yellow">Lazy Blocks</span></strong>の<strong><span class="swl-marker mark_yellow">繰り返し処理</span></strong>について解説させていただきました。</p>



<p>グーテンベルクの中でデータの登録などができるため、操作性も良く、カスタムフィールドについては<strong><span class="swl-marker mark_yellow">Lazy Blocks</span></strong>で運用したほうが良い気もします。</p>



<p>CFSは色々な方がブログでオススメしていたプラグインなので、使用されていた方、使用しているサイトも多いです。</p>



<p>プラグインの脆弱性が発見され、そのまま放置しておくとサイトの乗っ取りや個人情報の流出など、セキュリティ事故が発生してもおかしくありません。</p>



<p>現在CFSは公式からダウンロードができなくなっているため、影響範囲としては過去に制作したサイトが対象となり、できるだけ早い対応が望まれます。</p>



<p>今回の記事が少しでも参考になりましたら幸いです！</p>



<p>最後までご覧いただきありがとうございました！</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>【JavaScript】現在のページに対応するナビゲーションメニューにスタイルを追加する方法</title>
		<link>https://iwacode-web.com/style-current-page/</link>
		
		<dc:creator><![CDATA[岩村　彰斗]]></dc:creator>
		<pubDate>Mon, 29 Jul 2024 05:42:10 +0000</pubDate>
				<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web制作]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[コーディング]]></category>
		<guid isPermaLink="false">https://iwacode-web.com/?p=947</guid>

					<description><![CDATA[<p><img src="https://iwacode-web.com/wp-content/uploads/2024/07/blog_20240729.jpg" class="webfeedsFeaturedVisual" /></p>皆さんこんにちは！IWACODEの岩村です！ 今回は現在のページに対応するナビゲーションメニューのリンクに対して、「このリンクが今のページですよ～」といった感じでスタイルを適用する方法を解説いたします。 実際によくあるヘ [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><img src="https://iwacode-web.com/wp-content/uploads/2024/07/blog_20240729.jpg" class="webfeedsFeaturedVisual" /></p>
<p>皆さんこんにちは！IWACODEの岩村です！</p>



<p>今回は現在のページに対応するナビゲーションメニューのリンクに対して、「このリンクが今のページですよ～」といった感じでスタイルを適用する方法を解説いたします。</p>



<p>実際によくあるヘッダーデザインを用いて解説していきます！</p>



<p>今回は以下のようなヘッダーを作成します。</p>



<figure class="wp-block-image size-full"><img decoding="async" width="1000" height="133" src="https://iwacode-web.com/wp-content/uploads/2024/07/image-21.png" alt="" class="wp-image-951" srcset="https://iwacode-web.com/wp-content/uploads/2024/07/image-21.png 1000w, https://iwacode-web.com/wp-content/uploads/2024/07/image-21-300x40.png 300w, https://iwacode-web.com/wp-content/uploads/2024/07/image-21-768x102.png 768w" sizes="(max-width: 1000px) 100vw, 1000px" /></figure>



<p>トップページを開いている想定なので、TOPの文字がオレンジになっています。</p>



<p>WORKSを開いたらWORKSの文字がオレンジに・・・といったような制御を行います。</p>



<h2 class="wp-block-heading">HTML/CSS/JavaScriptの例</h2>



<h3 class="wp-block-heading">HTML</h3>



<p>今回使用するデザインのHTMLを構築していきます。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-html" data-lang="HTML"><code>&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;ja&quot;&gt;

&lt;head&gt;
  &lt;meta charset=&quot;UTF-8&quot;&gt;
  &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;
  &lt;title&gt;ナビゲーションメニューのスタイル&lt;/title&gt;
  &lt;link rel=&quot;stylesheet&quot; href=&quot;style.css&quot;&gt;
  &lt;link rel=&quot;preconnect&quot; href=&quot;https://fonts.googleapis.com&quot;&gt;
  &lt;link rel=&quot;preconnect&quot; href=&quot;https://fonts.gstatic.com&quot; crossorigin&gt;
  &lt;link
    href=&quot;https://fonts.googleapis.com/css2?family=Caveat:wght@400..700&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap&quot;
    rel=&quot;stylesheet&quot;&gt;
&lt;/head&gt;

&lt;body&gt;
  &lt;header class=&quot;header&quot;&gt;
    &lt;h1 class=&quot;header__logo&quot;&gt;iwacode&lt;/h1&gt;
    &lt;nav class=&quot;header__nav&quot;&gt;
      &lt;ul class=&quot;header__nav-list&quot;&gt;
        &lt;li class=&quot;header__nav-item&quot;&gt;&lt;a href=&quot;index.html&quot;&gt;toppage&lt;/a&gt;&lt;/li&gt;
        &lt;li class=&quot;header__nav-item&quot;&gt;&lt;a href=&quot;about.html&quot;&gt;works&lt;/a&gt;&lt;/li&gt;
        &lt;li class=&quot;header__nav-item&quot;&gt;&lt;a href=&quot;services.html&quot;&gt;srevice&lt;/a&gt;&lt;/li&gt;
        &lt;li class=&quot;header__nav-item&quot;&gt;&lt;a href=&quot;contact.html&quot;&gt;contact&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
    &lt;/nav&gt;
  &lt;/header&gt;
  &lt;script src=&quot;script.js&quot;&gt;&lt;/script&gt;
&lt;/body&gt;

&lt;/html&gt;</code></pre></div>



<h3 class="wp-block-heading">CSS</h3>



<p>一番下に<span class="swl-marker mark_yellow">JavaScriptでクラスが付与された際のスタイル</span>を記載しています。<br>※<strong><span class="swl-marker mark_yellow">.is-active</span></strong>が付与された際の指定</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-css" data-lang="CSS"><code>/* スタイルの初期化 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  list-style-type: none;
  text-decoration: none;
}

/* サイトの基本設定 */
html {
  color: #465572;
  font-size: 16px;
  letter-spacing: 0.03em;
}

.header {
  align-items: center;
  background-color: #E9ECEF;
  display: flex;
  height: 80px;
  justify-content: space-between;
  padding: 0 40px;
}

.header__logo {
  font-family: &quot;Caveat&quot;, cursive;
  font-size: 2rem;
  font-weight: bold;
}

.header__nav {
  font-family: &quot;Roboto&quot;, sans-serif;
  font-size: .925rem;
}

.header__nav-list {
  display: flex;
  gap: 2em;
}

.header__nav-item&gt;a {
  color: #465572;
  font-weight: bold;
  display: block;
  transition: .3s;
}

.header__nav-item&gt;a:hover {
  color: #FF983A;
}

/* ↓↓↓↓↓　今回のポイント　↓↓↓↓↓ */
/* JavaScriptにて.is-activeクラスが付与された場合のスタイル */
.header__nav-item&gt;a.is-active {
  color: #FF983A;
}
/* ↑↑↑↑↑　今回のポイント　↑↑↑↑↑ */</code></pre></div>



<h3 class="wp-block-heading">JavaScriptの記載</h3>



<div class="hcb_wrap"><pre class="prism line-numbers lang-js" data-lang="JavaScript"><code>const currentPath = window.location.pathname;
const navLinks = document.querySelectorAll(&quot;.header__nav-item a&quot;);

navLinks.forEach(link =&gt; {
  if (link.href === currentPath) {
    link.classList.add(&quot;is-active&quot;);
  }
});</code></pre></div>



<h4 class="wp-block-heading">JavaScriptの解説</h4>



<p>分かりやすいよう１行ずつコメントを入れました。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-js" data-lang="JavaScript"><code>// １）定数currentPathに現在開いているページのURLを格納
const currentPath = window.location.pathname;

// ２）定数navLinksに.header__nav-item a に該当する要素を格納
// 　　複数取得できるので配列となる
const navLinks = document.querySelectorAll(&quot;.header__nav-item a&quot;);

// ３）２で取得した要素をループで処理する
navLinks.forEach(link =&gt; {

  // ４）ここでのlink.hrefはaタグのhref属性に指定しているURL
  // 　　currentPathには現在開いているページのURLが入っているので、
  // 　　if文の===で比較し、一致している要素の場合、中の処理に入る
  if (link.href === currentPath) {

    // ５）linkにis-activeクラスを付与
    // 　　※linkはaタグのこと
    link.classList.add(&quot;is-active&quot;);
  }
});</code></pre></div>



<p>処理の概要としては、aタグで指定しているURLと現在開いているページのURLを比較して、同一であれば、一致するhref属性を持つaタグに対して.is-activeクラスを付与するといったものになります。</p>



<h2 class="wp-block-heading">さいごに</h2>



<p>いかがでしたでしょうか。</p>



<p>上記の処理を行うことで、現在開いているページが閲覧している方も一目でわかるため、ページの回遊性にも繋がります。</p>



<p>比較的簡単なJavaScriptの処理で実装可能なため、仕様を理解しぜひ組み込んでいってください！</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Bizメール＆ウェブ ビジネスにてWordPressをインストールする際の注意点｜管理画面でのエラーなど</title>
		<link>https://iwacode-web.com/bizmailweb-wordpress-install/</link>
		
		<dc:creator><![CDATA[岩村　彰斗]]></dc:creator>
		<pubDate>Sun, 28 Jul 2024 10:24:02 +0000</pubDate>
				<category><![CDATA[WordPress]]></category>
		<guid isPermaLink="false">https://iwacode-web.com/?p=926</guid>

					<description><![CDATA[<p><img src="https://iwacode-web.com/wp-content/uploads/2024/07/blog_20240728.jpg" class="webfeedsFeaturedVisual" /></p>今回ホームページの公開をBizメール＆ウェブ（NTTのホスティングサービス）というレンタルサーバにすることになりました。 XServerのように「WordPress簡単インストール」は用意されておらず、MySQLやphp [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><img src="https://iwacode-web.com/wp-content/uploads/2024/07/blog_20240728.jpg" class="webfeedsFeaturedVisual" /></p>
<p>今回ホームページの公開をBizメール＆ウェブ（NTTのホスティングサービス）というレンタルサーバにすることになりました。</p>



<p>XServerのように「WordPress簡単インストール」は用意されておらず、MySQLやphpMyAdminをインストール、有効化を自身で実施しなければなりません。</p>



<p>とはいうものの特に難しい操作は特になく、本記事にて紹介する手順で問題なくインストールができるかと思いますので、これからBizメール＆ウェブにWordPressを導入する際にはこちらの記事がご参考になりましたら幸いです。</p>



<h2 class="wp-block-heading">Bizメール＆ウェブとは</h2>



<p>NTTが提供しているレンタルサーバ（ホスティングサービス）の一つで、Xserverやロリポップなどと同様にホームページをアップし公開することが可能です。</p>



<p>上記のレンタルサーバと違うところは、マルチドメインが使用できないため、1つのサーバアカウントに対して、登録できるドメインは１つということ。</p>



<p>複数ドメインを取り扱うことが想定される際には、必然的にほかのサーバ会社を選ぶことになるかと思います。</p>



<p>WordPressの簡単インストールがないため、多少操作の工程が増えますが、WordPressを使用することは可能です。</p>



<p>ですが、ルートディレクトリやFTPの知識がないと、少し戸惑うことが出てくるかもしれません。</p>



<p>以下の流れで操作をすれば、迷わずにWordPressが使用できるようになりますので、ぜひ参考にされてください。</p>



<p class="u-mb-ctrl u-mb-0"><a href="https://www.ntt.com/business/services/cloud/rental-server/biz.html" data-wpel-link="external" rel="nofollow external noopener noreferrer">公式ページはこちら</a>↓</p>


<div class="swell-block-postLink">			<div class="p-blogCard -external -noimg" data-type="type3" data-onclick="clickLink">
				<div class="p-blogCard__inner">
					<span class="p-blogCard__caption">あわせて読みたい</span>
										<div class="p-blogCard__body">
						<a class="p-blogCard__title" href="https://www.ntt.com/business/services/cloud/rental-server/biz.html" target="_blank" rel="noopener noreferrer nofollow external" data-wpel-link="external">Bizメール＆ウェブ ビジネス | NTTドコモビジネス 法人のお客さま</a>
						<span class="p-blogCard__excerpt"><Bizメール＆ウェブ ビジネス | NTTドコモビジネス 法人のお客さま></span>					</div>
				</div>
			</div>
		</div>


<h2 class="wp-block-heading">WordPressのインストール手順について</h2>



<h3 class="wp-block-heading">MySQLの有効化（利用開始）</h3>



<p>WordPressではログイン情報や投稿情報、プラグインの情報など、様々なデータを保持する必要があるため、データベースを使用する必要があります。</p>



<h4 class="wp-block-heading">MySQLとは</h4>



<p>データを取り扱うデータベースシステムの一種で、大量のデータを効率よく保存し、管理し、検索できるシステムのことを指します。<br>簡単に言えば、MySQLは多くのデータを効率的に管理し、必要な情報をすばやく取り出すための便利なツールです。ウェブサイトのユーザーデータ、在庫管理システム、ブログの投稿管理など、さまざまな用途で使用されています。</p>



<h4 class="wp-block-heading">有効化の手順</h4>



<figure class="wp-block-image size-full"><img decoding="async" width="652" height="262" src="https://iwacode-web.com/wp-content/uploads/2024/07/image-8.png" alt="" class="wp-image-927" srcset="https://iwacode-web.com/wp-content/uploads/2024/07/image-8.png 652w, https://iwacode-web.com/wp-content/uploads/2024/07/image-8-300x121.png 300w" sizes="(max-width: 652px) 100vw, 652px" /></figure>



<p>アプリケーション→データベースをクリックします。</p>



<p>MySQLの利用開始ボタンがあるので、クリックします。</p>



<p>利用開始ボタンをクリックすると、パスワードを設定する画面が表示されるので、画面に沿ってパスワードを登録します。</p>



<p>※非常に大事なものになるため、別のテキストやパスワードを管理している媒体に保存しておきましょう。</p>



<h3 class="wp-block-heading">phpMyAdminの有効化</h3>



<p>ウェブブラウザ上で動作するMySQLデータベース管理ツールです。</p>



<figure class="wp-block-image size-full"><img decoding="async" width="682" height="263" src="https://iwacode-web.com/wp-content/uploads/2024/07/image-9.png" alt="" class="wp-image-928" srcset="https://iwacode-web.com/wp-content/uploads/2024/07/image-9.png 682w, https://iwacode-web.com/wp-content/uploads/2024/07/image-9-300x116.png 300w" sizes="(max-width: 682px) 100vw, 682px" /></figure>



<p>アプリケーション→データベースをクリックします。</p>



<p>phpMyAdminの有効化ボタンがあるので、クリックします。</p>



<figure class="wp-block-image size-full"><img decoding="async" width="658" height="255" src="https://iwacode-web.com/wp-content/uploads/2024/07/image-10.png" alt="" class="wp-image-929" srcset="https://iwacode-web.com/wp-content/uploads/2024/07/image-10.png 658w, https://iwacode-web.com/wp-content/uploads/2024/07/image-10-300x116.png 300w" sizes="(max-width: 658px) 100vw, 658px" /></figure>



<p>画面中央の矢印のアイコンから管理画面を開くことができますが、使用しているPHPのバージョンによってはエラーが発生します。</p>



<p>管理画面のバージョンを確認し、5.2を選択します。以下の画面にて既に5.2になっていれば特に操作する必要はありません。<br></p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="657" height="250" src="https://iwacode-web.com/wp-content/uploads/2024/07/image-11.png" alt="" class="wp-image-930" style="width:657px;height:auto" srcset="https://iwacode-web.com/wp-content/uploads/2024/07/image-11.png 657w, https://iwacode-web.com/wp-content/uploads/2024/07/image-11-300x114.png 300w" sizes="(max-width: 657px) 100vw, 657px" /></figure>



<figure class="wp-block-image size-full"><img decoding="async" width="880" height="294" src="https://iwacode-web.com/wp-content/uploads/2024/07/image-12.png" alt="" class="wp-image-931" srcset="https://iwacode-web.com/wp-content/uploads/2024/07/image-12.png 880w, https://iwacode-web.com/wp-content/uploads/2024/07/image-12-300x100.png 300w, https://iwacode-web.com/wp-content/uploads/2024/07/image-12-768x257.png 768w" sizes="(max-width: 880px) 100vw, 880px" /></figure>



<h4 class="wp-block-heading">エラーが発生した場合</h4>



<p>PHPのバージョンを確認します。確認しPHPのバージョンを8.1に変更します。</p>



<figure class="wp-block-image size-full"><img decoding="async" width="639" height="356" src="https://iwacode-web.com/wp-content/uploads/2024/07/image-13.png" alt="" class="wp-image-932" srcset="https://iwacode-web.com/wp-content/uploads/2024/07/image-13.png 639w, https://iwacode-web.com/wp-content/uploads/2024/07/image-13-300x167.png 300w" sizes="(max-width: 639px) 100vw, 639px" /></figure>



<p>アプリケーション→基本アプリを選択</p>



<figure class="wp-block-image size-full"><img decoding="async" width="658" height="354" src="https://iwacode-web.com/wp-content/uploads/2024/07/image-14.png" alt="" class="wp-image-933" srcset="https://iwacode-web.com/wp-content/uploads/2024/07/image-14.png 658w, https://iwacode-web.com/wp-content/uploads/2024/07/image-14-300x161.png 300w" sizes="(max-width: 658px) 100vw, 658px" /></figure>



<p>PHPの設定ボタンをクリック</p>



<figure class="wp-block-image size-full"><img decoding="async" width="983" height="366" src="https://iwacode-web.com/wp-content/uploads/2024/07/image-15.png" alt="" class="wp-image-934" srcset="https://iwacode-web.com/wp-content/uploads/2024/07/image-15.png 983w, https://iwacode-web.com/wp-content/uploads/2024/07/image-15-300x112.png 300w, https://iwacode-web.com/wp-content/uploads/2024/07/image-15-768x286.png 768w" sizes="(max-width: 983px) 100vw, 983px" /></figure>



<p><span class="swl-marker mark_yellow">バージョンの選択から8.1（CGI）をクリックして変更ボタンを押します。</span></p>



<p>これでPHPのバージョン変更が完了します。</p>



<p>変更が完了したら、再度phpMyAdminの開いてみましょう。</p>



<p>ログイン画面が表示されればOKです。</p>



<p class="is-style-icon_announce">phpMyAdminにログインするには、Bizメール＆ウェブのコントロールパネルにログインした際のIDと、MySQLを有効化した際に作成したパスワードが必要になります。</p>



<h3 class="wp-block-heading">WordPressのインストール</h3>



<p>アプリケーション→追加アプリを選択、WordPressの行のインストールボタンをクリックしてインストールを行います。</p>



<p>/www/htdocs/の中に「wordpress」フォルダが作成されます。</p>



<p class="is-style-big_icon_caution">既にフォルダが作成されている場合、していた場合は上書きされます。</p>



<figure class="wp-block-image size-full"><img decoding="async" width="649" height="232" src="https://iwacode-web.com/wp-content/uploads/2024/07/image-16.png" alt="" class="wp-image-935" srcset="https://iwacode-web.com/wp-content/uploads/2024/07/image-16.png 649w, https://iwacode-web.com/wp-content/uploads/2024/07/image-16-300x107.png 300w" sizes="(max-width: 649px) 100vw, 649px" /></figure>



<p>インストールを実行します。の子画面が表示されるので、「はい」をクリックしてインストールを実行します。</p>



<p>インストールが完了したら「インストールが完了しました」と子画面が表示されます。</p>



<p>大事な内容のため、内容を保管しておきましょう！</p>



<p>画面から選択してコピーができるので、マウスで選択状態にして、ctrl（command） + cでコピー、テキストエディタやメモ帳などに、ctrl（command） + vで張り付けておきましょう。</p>



<h4 class="wp-block-heading">ルートディレクトリについて</h4>



<p>Bizメール＆ウェブではhtdocsの直下が<span class="swl-marker mark_yellow"><strong>ルートディレクトリ</strong></span>となります。</p>



<p>ルートディレクトリとは、起点となるフォルダのことで、https://〇〇〇〇〇.jpといった形でホームページを開いた場合やhtdocsの中のindex.htmlが読み込まれます。</p>



<p>もしhtdocsの中にpublic_htmlのようなフォルダが存在し、その中にあるindex.htmlを開きたい場合は、https://〇〇〇〇〇.jp/public_htmlをURLとして呼び出します。</p>



<p>他社のレンタルサーバ（ホスティングサービス）では、上記のルートディレクトリを変更することが可能でしたが、Bizメール＆ウェブで変更する方法はわかりませんでした。<br>変更する方法はないのかもしれません。</p>



<h2 class="wp-block-heading">ホームページを開くURLを変更（ドメイン名で表示させたい）</h2>



<p>上記の流れでWordPressをインストールした場合、ホームページを開くためのURLがhttps://ドメイン名/wordpressとなってしまいます。</p>



<p>こちらを変更する方法を解説いたします。</p>



<p class="is-style-icon_announce"><strong>ここからの作業はFTPソフトを使用することを前提に解説いたします。<br></strong>　※ファイルのダウンロード作業が発生するため<br><br><strong>FTPソフト</strong>とはサーバとのファイルのやり取り（アップロード・ダウンロード）を行うためのソフトです。<br>アップロードだけの場合、コントロールパネルの機能で事足りるのですが、ダウンロードができないため、FTPソフトが必要となります。<br>ダウンロードするのは、サーバ上のファイルを修正する必要があるためです。直接編集ができないので、一旦ダウンロードする必要があります。</p>



<h3 class="wp-block-heading">手順１）WordPressの管理画面からパスを変更する</h3>



<figure class="wp-block-image size-full"><img decoding="async" width="639" height="158" src="https://iwacode-web.com/wp-content/uploads/2024/07/image-19.png" alt="" class="wp-image-939" srcset="https://iwacode-web.com/wp-content/uploads/2024/07/image-19.png 639w, https://iwacode-web.com/wp-content/uploads/2024/07/image-19-300x74.png 300w" sizes="(max-width: 639px) 100vw, 639px" /></figure>



<p>始めに管理画面からログインをして、設定画面を開くと、上記のようにパスが設定されています。</p>



<p>これを以下のように変更します。</p>



<figure class="wp-block-image size-full"><img decoding="async" width="645" height="137" src="https://iwacode-web.com/wp-content/uploads/2024/07/image-20.png" alt="" class="wp-image-940" srcset="https://iwacode-web.com/wp-content/uploads/2024/07/image-20.png 645w, https://iwacode-web.com/wp-content/uploads/2024/07/image-20-300x64.png 300w" sizes="(max-width: 645px) 100vw, 645px" /></figure>



<p>サイトアドレスの/wordpressの文言を削除しました。</p>



<p>管理画面での作業は以上です。</p>



<h3 class="wp-block-heading">手順２）ルートディレクトリは変更できないため、wordpress/index.phpを変更する</h3>



<p>作成されたwordpressフォルダの中にindex.phpファイルがあります。wordpressはこちらのファイルが起点となります。</p>



<p>FTPソフトにて、index.phpを一旦自身のPCにダウンロードし、中身を開きます。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-php" data-lang="PHP"><code>&lt;?php

/**
 * Front to the WordPress application. This file doesn&#39;t do anything, but loads
 * wp-blog-header.php which does and tells WordPress to load the theme.
 *
 * @package WordPress
 */

/**
 * Tells WordPress to load the WordPress theme and output it.
 *
 * @var bool
 */
define(&#39;WP_USE_THEMES&#39;, true);

/** Loads the WordPress Environment and Template */
require __DIR__ . &#39;/wp-blog-header.php&#39;;
</code></pre></div>



<p>一番下の行に、</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-php" data-lang="PHP"><code>require __DIR__ . &#39;/wp-blog-header.php&#39;;</code></pre></div>



<p><br>こちらを</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-php" data-lang="PHP"><code>require __DIR__ . &#39;/wordpress/wp-blog-header.php&#39;;</code></pre></div>



<p>と変更します。</p>



<p>変更したら、wordpressのフォルダではなく、一つ上の階層（htdocs）にアップロードしましょう。<br><span class="swl-marker mark_yellow">ここにアップロードするのは、こちらのフォルダがルートフォルダになっているからです。</span><br>www/htdocsにindex.htmlが存在する場合は、一旦自身のPCにダウンロードしておきましょう。<br>※初期導入の場合は必要ないと思われますが・・・</p>



<p>これで、ドメイン名を指定するだけでWordPressサイトが開けるようになりました。</p>



<p><strong>Bizメール＆ウェブ ビジネス</strong>ではマルチドメインが使用できないため、コントロールパネルからWordPressをインストールすると、サブディレクトリとして、WordPressがインストールされるようです。</p>



<h2 class="wp-block-heading">管理画面が正常に動かない！？</h2>



<p>WordPressの管理画面からログインをして<strong>All-in-One WP Migration</strong>などのプラグインを使用し、自身で構築したWordPressサイトをアップロードしようとすると、プラグインの画面が正常に動作しない可能性があります。</p>



<p>私の場合は、エクスポートやインポートの画面は表示されるものの、クリックしても反応しない状態でした。</p>



<p>調査したところ、デフォルトで選択されているテーマが古く、アップデートされていないことが原因でした。</p>



<p>デフォルトが<strong><span class="swl-marker mark_yellow">Twenty Twenty-Two</span></strong>が選択されており、<strong><span class="swl-marker mark_yellow">Twenty Twenty-Four</span></strong>を有効化にすることで解消されました。</p>



<p>これでエラーが解消され<strong>All-in-One WP Migration</strong>も使用できるようになっていると思います。</p>



<h2 class="wp-block-heading">さいごに</h2>



<p>WordPressのインストールについて解説させていただきました。</p>



<p>簡単インストールがない分、若干時間は要しますが、同様にWordPressを使用することはできます。</p>



<p>少しでも参考になりましたら幸いです。</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>【CSS】ファーストビューや画像上のテキストなど、要素を中央、真ん中に配置する方法</title>
		<link>https://iwacode-web.com/css-center-aligned/</link>
		
		<dc:creator><![CDATA[岩村　彰斗]]></dc:creator>
		<pubDate>Fri, 12 Jul 2024 11:17:46 +0000</pubDate>
				<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[Web制作]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[コーディング]]></category>
		<guid isPermaLink="false">https://iwacode-web.com/?p=911</guid>

					<description><![CDATA[<p><img src="https://iwacode-web.com/wp-content/uploads/2024/07/blog_20240712-1.jpg" class="webfeedsFeaturedVisual" /></p>皆さんこんにちは！IWACODEの岩村です。 今回はHTML/CSSコーディングにおいて避けては通れない、要素の真ん中寄せについて解説いたします。 真ん中寄せはWEBサイト上でかなりの頻度で実装する必要があるということと [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><img src="https://iwacode-web.com/wp-content/uploads/2024/07/blog_20240712-1.jpg" class="webfeedsFeaturedVisual" /></p>
<p>皆さんこんにちは！IWACODEの岩村です。</p>



<p>今回はHTML/CSSコーディングにおいて避けては通れない、要素の真ん中寄せについて解説いたします。</p>



<p>真ん中寄せはWEBサイト上でかなりの頻度で実装する必要があるということと、仕組みについて理解することで、コーディングの知識が大きく高まるのかなと個人的には感じております。</p>



<p>今回記事を読んでいただくことによって、もう真ん中寄せでは悩まなくなると思います！</p>



<p>ぜひ最後まで読んでいただけると嬉しいです！</p>



<h2 class="wp-block-heading">真ん中寄せをする方法について</h2>



<p>真ん中寄せをする方法は大きくわけて４つ方法があり、それぞれ解説させていただきます！</p>



<figure class="wp-block-image size-full"><img decoding="async" width="542" height="335" src="https://iwacode-web.com/wp-content/uploads/2024/07/image-3.png" alt="" class="wp-image-913" srcset="https://iwacode-web.com/wp-content/uploads/2024/07/image-3.png 542w, https://iwacode-web.com/wp-content/uploads/2024/07/image-3-300x185.png 300w" sizes="(max-width: 542px) 100vw, 542px" /></figure>



<h3 class="wp-block-heading">display:flexを使用する方法</h3>



<div class="hcb_wrap"><pre class="prism line-numbers lang-html" data-lang="HTML"><code>&lt;div class=&quot;box wrap&quot;&gt;
  &lt;div class=&quot;item&quot;&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;style&gt;
  .box {
    width: 500px;
    height: 300px;
    background-color: rgb(209, 252, 245);
  }

  .item {
    background-color: rgb(0, 200, 200);
    width: 100px;
    height: 100px;
  }

  .wrap {
    display: flex;
    justify-content: center;
    align-items: center;
  }
&lt;/style&gt;</code></pre></div>



<p>wrapクラスに以下のCSSを適用しています。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-css" data-lang="CSS"><code>.wrap {
  display: flex;
  justify-content: center;
  align-items: center;
}</code></pre></div>



<p>まずはwrapクラスの要素に対して、<strong>display:flex</strong>を適用させます。<br>そうすることによって<span class="swl-marker mark_yellow">子要素（.item）がflexボックス</span>として操作できるようになります。<br>これを利用し、<strong>justify-content: center</strong>で水平方向（←→）に対して真ん中寄せ、<strong>align-items: center</strong>; で垂直方向（↑↓）に対して真ん中寄せを行い、結果的に真ん中寄せを実現させています。</p>



<p>この方法でも特に問題はないのですが、真ん中寄せのためにCSSを３行使用しているため、可能であればもっと短い記載で実現させたいところです。<br>ということで次の方法が個人的にはオススメです！</p>



<h3 class="wp-block-heading">display:gridを使用する方法</h3>



<div class="hcb_wrap"><pre class="prism line-numbers lang-html" data-lang="HTML"><code>&lt;div class=&quot;box wrap&quot;&gt;
  &lt;div class=&quot;item&quot;&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;style&gt;
  .body {
    padding: 40px;
  }

  .box {
    width: 500px;
    height: 300px;
    background-color: rgb(209, 252, 245);
  }

  .item {
    background-color: rgb(0, 200, 200);
    width: 100px;
    height: 100px;
  }

  .wrap {
    display: grid;
    place-items: center;
  }
&lt;/style&gt;
</code></pre></div>



<p>wrapクラスに以下のCSSを適用しています。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-css" data-lang="CSS"><code>  .wrap {
    display: grid;
    place-items: center;
  }</code></pre></div>



<p>こちらでは上記の2行で真ん中寄せが実現可能です。</p>



<p><span class="swl-marker mark_yellow"><strong>display:grid</strong>にてgridレイアウト化</span>し、<strong>place-item: center</strong>でgridコンテンツかしている要素（.item）を真ん中に寄せています。</p>



<p>コーディングを行う上で、<span class="swl-marker mark_yellow"><strong>この方法が一番記述が短く、楽に実現ができる</strong></span>のでかなりオススメな方法になります！</p>



<h3 class="wp-block-heading">positionを使用する方法</h3>



<div class="hcb_wrap"><pre class="prism line-numbers lang-html" data-lang="HTML"><code>&lt;div class=&quot;box wrap&quot;&gt;
  &lt;div class=&quot;item&quot;&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;style&gt;
  .body {
    padding: 40px;
  }

  .box {
    width: 500px;
    height: 300px;
    background-color: rgb(209, 252, 245);
  }

  .item {
    background-color: rgb(0, 200, 200);
    width: 100px;
    height: 100px;
  }

  .wrap {
    position: relative;
  }

  .wrap .item {
    position: absolute;
    inset: 0; /* top: 0; right: 0; bottom: 0; left: 0; の略 */
    margin: auto;
  }
&lt;/style&gt;</code></pre></div>



<p>wrapクラスに<strong>position: relative</strong>を指定し、positionの基点にします。<br>子要素である.itemに対して、<strong>position: absolute; inset: 0; margin: auto; </strong>を指定します。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-css" data-lang="CSS"><code>  .wrap {
    position: relative;
  }

  .wrap .item {
    position: absolute;
    inset: 0; /* top: 0; right: 0; bottom: 0; left: 0; の略 */
    margin: auto;
  }</code></pre></div>



<p>こちらの方法でも真ん中寄せにはできるのですが、ちょっと記載量が多いです・・・</p>



<p><strong>inset</strong>プロパティはpositionプロパティと併用して使用する、top/right/bottom/leftのショートハンドプロパティです。</p>



<p><span class="swl-marker mark_yellow">上下左右に値を0</span>で指定し、さらに<span class="swl-marker mark_yellow">上下左右の余白をauto</span>にすることで、.itemを真ん中寄せにしています。</p>



<p>通常真ん中寄せにするのであれば、display:flexやdisplay:gridで指定する方がすっきりしますし見やすいのでそちらをオススメします。</p>



<p>ですが、<span class="swl-marker mark_yellow">子要素の方が親要素より大きい場合、上記の方法では実装ができません。</span></p>



<p>次に実装する方法では、親要素より子要素が大きい場合でも、真ん中寄せにすることが可能です。</p>



<h3 class="wp-block-heading">positionを使用する方法（親要素より子要素が大きい場合）</h3>



<div class="hcb_wrap"><pre class="prism line-numbers lang-html" data-lang="HTML"><code>&lt;div class=&quot;box wrap&quot;&gt;
  &lt;div class=&quot;item&quot;&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;style&gt;
  .body {
    padding: 40px;
  }

  .box {
    width: 500px;
    height: 300px;
    background-color: rgb(209, 252, 245);
  }

  .item {
    background-color: rgb(0, 200, 200);
    width: 100px;
    height: 100px;
  }

  .wrap {
    position: relative;
  }

  .wrap .item {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
  }
&lt;/style&gt;</code></pre></div>



<p>wrapクラスに<strong>position: relative</strong>を指定し、positionの基点にします。<br>子要素である.itemに対して、<strong>position: absolute; inset: 50% auto auto 0; transform: translate(-50%, -50%); </strong>を指定します。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-css" data-lang="CSS"><code>  .wrap {
    position: relative;
  }

  .wrap .item {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
  }</code></pre></div>



<p>これを説明すると、insetプロパティにてtop: 50%,left50%で.itemを移動させます。この状態では以下のようになります。</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="769" height="473" src="https://iwacode-web.com/wp-content/uploads/2024/07/image-6.png" alt="" class="wp-image-918" style="width:537px;height:auto" srcset="https://iwacode-web.com/wp-content/uploads/2024/07/image-6.png 769w, https://iwacode-web.com/wp-content/uploads/2024/07/image-6-300x185.png 300w" sizes="(max-width: 769px) 100vw, 769px" /></figure>



<p>これでは不完全なので、transform: translate(-50%, -50%);の指定で、.itemの縦横の半分の大きさ（-50%）だけずらして調節します。</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="774" height="473" src="https://iwacode-web.com/wp-content/uploads/2024/07/image-7.png" alt="" class="wp-image-919" style="width:550px;height:auto" srcset="https://iwacode-web.com/wp-content/uploads/2024/07/image-7.png 774w, https://iwacode-web.com/wp-content/uploads/2024/07/image-7-300x183.png 300w, https://iwacode-web.com/wp-content/uploads/2024/07/image-7-768x469.png 768w" sizes="(max-width: 774px) 100vw, 774px" /></figure>



<p>この方法であれば、もし子要素が親要素より大きい場合でも対応ができるため、より汎用的に対応が可能です！</p>



<h2 class="wp-block-heading">さいごに</h2>



<p>今回は真ん中寄せについて４種類解説させていただきました。</p>



<p>最後に解説した方法だけで特に困ることはないのですが、コードが長くなると複雑になってわかりにくくなってしまうため、出来るだけ簡潔にコーディングを済ませたいところです。</p>



<p>そのため、可能な範囲でdisplay:gridなどで調節できるとよりきれいにコーディングが進めれると思います！</p>



<p>今回の記事が少しでも参考になりましたら幸いです。</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>【HTML】TABLEタグで線が2重になる-線が重ならないとき</title>
		<link>https://iwacode-web.com/table-border-collapse/</link>
		
		<dc:creator><![CDATA[岩村　彰斗]]></dc:creator>
		<pubDate>Thu, 11 Jul 2024 12:26:30 +0000</pubDate>
				<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[Web制作]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[コーディング]]></category>
		<category><![CDATA[初心者向け]]></category>
		<guid isPermaLink="false">https://iwacode-web.com/?p=902</guid>

					<description><![CDATA[<p><img src="https://iwacode-web.com/wp-content/uploads/2024/07/blog_20240711.jpg" class="webfeedsFeaturedVisual" /></p>皆さんこんにちは！IWACODEの岩村です。 今回はTABLEタグの罫線について解説いたします。 WEBサイト上で料金表や時間割などの表を作成する際に使用するTABLEタグですが、 TABLEタグで罫線を引いたとき以下の [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><img src="https://iwacode-web.com/wp-content/uploads/2024/07/blog_20240711.jpg" class="webfeedsFeaturedVisual" /></p>
<p>皆さんこんにちは！IWACODEの岩村です。</p>



<p>今回はTABLEタグの罫線について解説いたします。</p>



<p>WEBサイト上で料金表や時間割などの表を作成する際に使用するTABLEタグですが、</p>



<p>TABLEタグで罫線を引いたとき以下のような表示になったことはないでしょうか。TABLEタグにはとあるプロパティの初期値の影響で、borderプロパティで罫線を引くと以下のような状態になってしまいます。</p>



<figure class="wp-block-image size-full"><img decoding="async" width="531" height="210" src="https://iwacode-web.com/wp-content/uploads/2024/07/image.png" alt="" class="wp-image-903" srcset="https://iwacode-web.com/wp-content/uploads/2024/07/image.png 531w, https://iwacode-web.com/wp-content/uploads/2024/07/image-300x119.png 300w" sizes="(max-width: 531px) 100vw, 531px" /></figure>



<div class="hcb_wrap"><pre class="prism line-numbers lang-html" data-lang="HTML"><code>  &lt;table&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;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;

  &lt;style&gt;
    table {
      width: 500px;
    }

    th,
    td {
      padding: 1em 0;
      background-color: #eee;
      border: 1px solid #999;
    }

    td {
      text-align: center;
    }
  &lt;/style&gt;</code></pre></div>



<h2 class="wp-block-heading">border-collapseプロパティについて</h2>



<p>セルとセルの間に謎の間隔が生まれるのは、TABLEタグの<strong>border-collapse</strong>プロパティが影響しています。</p>



<p><strong>border-collapse</strong>プロパティの値が<span class="swl-marker mark_yellow">初期値では<strong><span class="swl-inline-color has-swl-deep-01-color">separate</span></strong></span>になっているため間隔があいています。</p>



<p>間隔を埋めるためにはTABLEタグに以下のように指定します。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-html" data-lang="HTML"><code>  &lt;table&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;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;

  &lt;style&gt;
    table {
      width: 500px;
      border-collapse: collapse;  /* 追加 */
    }

    th,
    td {
      padding: 1em 0;
      background-color: #eee;
      border: 1px solid #999;
    }

    td {
      text-align: center;
    }
 &lt;/style&gt;</code></pre></div>



<figure class="wp-block-image size-full"><img decoding="async" width="538" height="200" src="https://iwacode-web.com/wp-content/uploads/2024/07/image-1.png" alt="" class="wp-image-905" srcset="https://iwacode-web.com/wp-content/uploads/2024/07/image-1.png 538w, https://iwacode-web.com/wp-content/uploads/2024/07/image-1-300x112.png 300w" sizes="(max-width: 538px) 100vw, 538px" /></figure>



<div class="hcb_wrap"><pre class="prism line-numbers lang-css" data-lang="CSS"><code>border-collapse: collapse;</code></pre></div>



<p>このプロパティ、値を指定することで、セルとセル間の間隔を消すことができます。</p>



<p>セルとセルの線が重なって見栄えがスッキリしますね。</p>



<h2 class="wp-block-heading">セルとセルの間隔を空けて見せるには</h2>



<p>WEBサイトのデザインにもよりますが、基本的にTABLEタグでは<strong><span class="swl-marker mark_yellow">border-collapse: collapse</span></strong>で指定してコーディングすることが多いです。</p>



<p>セルとセルの間隔があいているような表をデザインすることもありますが、そのような場合でも<strong><span class="swl-marker mark_yellow">border-collapse: collapse</span></strong>を指定して、罫線を白にするなど間隔があいているように見せることもできます。</p>



<p>以下はborderプロパティで白線で間隔を空けています。</p>



<figure class="wp-block-image size-full"><img decoding="async" width="532" height="204" src="https://iwacode-web.com/wp-content/uploads/2024/07/image-2.png" alt="" class="wp-image-907" srcset="https://iwacode-web.com/wp-content/uploads/2024/07/image-2.png 532w, https://iwacode-web.com/wp-content/uploads/2024/07/image-2-300x115.png 300w" sizes="(max-width: 532px) 100vw, 532px" /></figure>



<div class="hcb_wrap"><pre class="prism line-numbers lang-html" data-lang="HTML"><code>  &lt;table&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;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;

  &lt;style&gt;
    table {
      width: 500px;
      border-collapse: collapse;
      /* 追加 */
    }

    th,
    td {
      padding: 1em 0;
      border: 3px solid #fff;
    }

    th {
      background-color: bisque;
    }

    td {
      text-align: center;
      background-color: #f5f5f5;
    }
  &lt;/style&gt;</code></pre></div>



<p>このように記載することによって間隔を空けて見せることも可能です。</p>



<h2 class="wp-block-heading">さいごに</h2>



<p>今回はborder-collapseについて解説いたしました。</p>



<p>初心者のうちはハマりやすいところでもあるので、TABLEタグを使用する際にはぜひ参考にしていただければと思います。</p>



<p>TABLEタグについては以下の記事でも解説しております。</p>



<p>少しでも参考になれば幸いです♪</p>


<div class="swell-block-postLink">			<div class="p-blogCard -internal" data-type="type1" data-onclick="clickLink">
				<div class="p-blogCard__inner">
					<span class="p-blogCard__caption">あわせて読みたい</span>
					<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://iwacode-web.com/wp-content/uploads/2024/02/blog_20240221-300x169.jpg" alt="" class="c-postThumb__img u-obf-cover" width="320" height="180"></figure></div>					<div class="p-blogCard__body">
						<a class="p-blogCard__title" href="https://iwacode-web.com/html-tabletag-join/" data-wpel-link="internal">【初心者向け】tableタグの使い方！部分的に結合、セルを結合した表を作成する</a>
						<span class="p-blogCard__excerpt">こんにちは。IWACODEの岩村彰斗です。 今回はtableタグの使い方ということで、部分的に結合された表の作成方法について解説させていただきます。 見出しなどが2行になっ&#8230;</span>					</div>
				</div>
			</div>
		</div>

<div class="swell-block-postLink">			<div class="p-blogCard -internal" data-type="type1" data-onclick="clickLink">
				<div class="p-blogCard__inner">
					<span class="p-blogCard__caption">あわせて読みたい</span>
					<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://iwacode-web.com/wp-content/uploads/2024/02/blog_20240219-1-300x169.jpg" alt="" class="c-postThumb__img u-obf-cover" width="320" height="180"></figure></div>					<div class="p-blogCard__body">
						<a class="p-blogCard__title" href="https://iwacode-web.com/tabletag-how-to/" data-wpel-link="internal">tableタグは使わない？どんな時に使う？使用するケースについて解説</a>
						<span class="p-blogCard__excerpt">こんにちは。IWACODEの岩村彰斗です。 今回はtableタグについて、どのようなときに使用するのが良いのか、tableタグを使用しない場合はどのようにするのかについて解説&#8230;</span>					</div>
				</div>
			</div>
		</div>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>【フリーランス/WEBデザイナー】コーディングができないとダメなのか &#8211; HTML/CSS/JavaScriptの勉強</title>
		<link>https://iwacode-web.com/webdesign-htmlcss-coding/</link>
		
		<dc:creator><![CDATA[岩村　彰斗]]></dc:creator>
		<pubDate>Fri, 31 May 2024 10:42:30 +0000</pubDate>
				<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[Web制作]]></category>
		<category><![CDATA[YouTube]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[コーディング]]></category>
		<guid isPermaLink="false">https://iwacode-web.com/?p=896</guid>

					<description><![CDATA[<p><img src="https://iwacode-web.com/wp-content/uploads/2024/05/サムネイル.jpg" class="webfeedsFeaturedVisual" /></p>こんにちは！IWACODEのいわむらあきとです。 今回はYouTubeでフリーランスのWEBデザイナーはコーディング（HTML/CSS）ができないとダメなのかということをテーマにおいて、お話しております。 「フリーランス [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><img src="https://iwacode-web.com/wp-content/uploads/2024/05/サムネイル.jpg" class="webfeedsFeaturedVisual" /></p>
<p>こんにちは！IWACODEのいわむらあきとです。</p>



<p>今回はYouTubeでフリーランスのWEBデザイナーはコーディング（HTML/CSS）ができないとダメなのかということをテーマにおいて、お話しております。</p>



<p>「フリーランス」として活動する上で、どのような立ち位置で、どのような仕事を取っていくかによっても方向性が変わってきます。</p>



<p>WEBデザイナーの方で、</p>



<p>コーディングには手を付けていない方</p>



<p>苦手だから今後どうしようかな</p>



<p>といった方はぜひチェックをしてみてください。</p>



<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe title="【フリーランスのWEBデザイナー】コーディングができないとダメなのか" width="500" height="281" src="https://www.youtube.com/embed/ieeV2Z5hrJI?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</div></figure>



<p>本ブログ内でも記事にしておりますので、よろしければこちらもご覧ください。</p>


<div class="swell-block-postLink">			<div class="p-blogCard -internal" data-type="type1" data-onclick="clickLink">
				<div class="p-blogCard__inner">
					<span class="p-blogCard__caption">あわせて読みたい</span>
					<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://iwacode-web.com/wp-content/uploads/2024/02/blog_20240228-300x169.jpg" alt="" class="c-postThumb__img u-obf-cover" width="320" height="180"></figure></div>					<div class="p-blogCard__body">
						<a class="p-blogCard__title" href="https://iwacode-web.com/freelance-webdesigner-coding/" data-wpel-link="internal">フリーランスのWEBデザイナーにコーディングスキルは必要なのか？</a>
						<span class="p-blogCard__excerpt">こんにちは！IWACODEの岩村彰斗です。 今回はフリーランスのWEBデザイナーに、コーディングスキルはあったほうがよいのか？について考えてみました。 コーディングとい&#8230;</span>					</div>
				</div>
			</div>
		</div>]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
