Neova高機能SEOプラットフォーム

画像のwidthとheightが設定されていない

Neovaでは クロールそのものから実行されます。設定は不要です。

ルールの最終確認:2026年10月17日 · ガイドの更新:2026年7月7日

サイズが確保されていないと、画像の読み込み時にレイアウトが動き、Cumulative Layout Shift が増えます。Google の Core Web Vitals の目標値は、CLS が 0.1 未満であることです。

できること

img 要素に width 属性と height 属性を設定するか、CSS の width と height、または aspect-ratio でサイズを設定してください。

Neovaがフラグを立てる理由

  • サイズが確保されていないと、画像は読み込まれたときにコンテンツを押し下げ、Cumulative Layout Shiftに加算されます。
  • GoogleのCore Web VitalsはCLSを0.1以下に保つことを目標とし、0.25を超えると「不良」です。
  • widthとheightの属性があれば、ブラウザはファイルが届く前に場所を確保できます。

出典

完全ガイド

この部分は現在、英語のみです。

What "Add Dimensions to Images" Actually Flags

Your audit tripped this check because at least one <img> on the page ships without a width and height attribute (or the CSS equivalent). When the browser meets an image with no declared size, it has no idea how much space to reserve, so it lays the page out as if the image were zero pixels tall, then yanks everything downward the instant the file arrives. That yank is a layout shift, and it feeds straight into your Cumulative Layout Shift (CLS) score.

The stakes: CLS is a ranking-relevant Core Web Vital, and layout shift is the metric users feel most viscerally. Nobody rage-quits faster than the reader who taps a button that jumps out from under their thumb because a header image finally loaded.

A Real Failing Example (And the Fix)

Here is the pattern the check hates. No dimensions anywhere, so the browser reserves no vertical space:

<!-- Reserves 0px height until the file downloads, then jolts the page -->
<img src="/checks/img/hero-banner.jpg" alt="Product hero">

<figure>
  <img src="/checks/img/author.png" alt="Author photo">
</figure>

The fix is boring and permanent: put the image's intrinsic pixel dimensions in the markup. The browser computes the aspect ratio from those two numbers and reserves the correct box before a single byte of the image arrives.

<!-- Box is reserved instantly; zero shift on load -->
<img src="/checks/img/hero-banner.jpg" alt="Product hero"
     width="1600" height="900">

<figure>
  <img src="/checks/img/author.png" alt="Author photo"
     width="240" height="240">
</figure>

Key point people miss: the numbers are the intrinsic file dimensions, not the display size. Your CSS can still stretch or shrink the image responsively. Add this one rule so the height scales with the width instead of locking to the attribute value:

img {
  height: auto;      /* let height track the responsive width   */
  max-width: 100%;   /* never overflow its container            */
}

With width/height present, modern browsers derive aspect-ratio automatically, so the reserved box stays correct at every viewport width.

Why the Attributes Work: The Aspect-Ratio Trick

Modern browsers turned width and height attributes into something smarter than fixed pixels. When both are present, the browser computes an internal aspect-ratio from them and uses it to reserve the correct box the instant it parses the tag, before the image file has downloaded at all. So an image declared width="1600" height="900" reserves a 16:9 slot immediately, and your height: auto CSS lets that slot scale fluidly with the column width. The result is the best of both: a placeholder that is exactly the right shape, and an image that still stretches responsively. Leave the attributes off and the browser has no ratio to work with, so it reserves nothing and pays for it with a shift the moment the bytes arrive.

Attribute vs. CSS vs. Missing: What the Browser Does

Markup on the Image Space Reserved Before Load? CLS Risk
width + height attributes Yes, correct aspect box None
CSS aspect-ratio on the element Yes, if width is constrained Low
Fixed width/height in CSS only Yes, but breaks responsiveness Low
No dimensions anywhere No, collapses to 0px High
Background image via CSS Depends on container sizing Variable

How to Detect It on Your Own Site

  1. Lighthouse (Chrome DevTools): open DevTools, run a Lighthouse Performance audit, and look under diagnostics for "Image elements do not have explicit width and height." It lists the exact offending elements.
  2. PageSpeed Insights: paste your URL at pagespeed.web.dev. The same audit appears, plus real-user CLS from the field (CrUX) so you know whether shifts are actually hurting visitors, not just the lab test.
  3. DevTools Performance panel: record a page load, then check the "Layout Shift" markers on the timeline. Click one and it highlights the element that moved, usually an image whose box appeared late.
  4. WebPageTest: run a test and open the filmstrip. Frame-by-frame you can watch content jump when an unsized image resolves. The waterfall pins the exact request.

How to Fix It, Step by Step

  1. Pull the intrinsic pixel dimensions of every flagged image (any editor, or the file's Get Info / Properties panel).
  2. Add matching width and height attributes to each <img> tag.
  3. Add the global img { height: auto; max-width: 100%; } rule so responsive scaling still works.
  4. For CSS background images, give the container an explicit height or an aspect-ratio so it holds its space.
  5. On a CMS, fix it at the source: modern WordPress and most builders inject dimensions automatically, so the culprit is usually a hand-coded template, a page builder module, or an old post. Patch the template, not one post at a time.
  6. Re-run Lighthouse and confirm CLS from images drops toward 0.

FAQ

Do Width and Height Attributes Force My Image to a Fixed Size?

No, as long as you pair them with height: auto; max-width: 100%; in CSS. The attributes only tell the browser the aspect ratio up front; the CSS controls the actual rendered size.

What Numbers Do I Put If I Serve Responsive Images With Srcset?

Use the intrinsic dimensions of the image referenced in the plain src fallback. All variants in a well-built srcset share the same aspect ratio, so one set of width/height reserves the right box for all of them.

Does This Help Largest Contentful Paint Too?

Indirectly. Reserving space keeps the layout stable, which stops your LCP element from being pushed around mid-load. For loading speed itself, see how to improve LCP.

What About Lazy-Loaded Images Below the Fold?

They still need dimensions. A lazy image that loads on scroll will shift content just as badly, so keep the attributes. See defer offscreen images for doing lazy loading without introducing shift.

Is CLS Really a Ranking Factor?

It is part of Core Web Vitals, which Google uses as a page experience signal. It rarely outweighs relevance, but between two comparable pages the stable one wins. Read the full CLS guide for the ranking context.

自分のサイトで見つける

Neovaはこのチェック項目とほかのすべてをクロールのたびに実行し、修正内容をチーム向けのチケットとして書き出します。

  • Mac、Windows、Linux用のデスクトップアプリ
  • 696項目のチェックすべてに出典付き
  • Search ConsoleとAnalytics 4を読み取り専用で接続
  • Jira、Linear、Asanaへのチケット

Neovaをダウンロード Desktop Freeプラン、またはSoloを14日間無料、カード不要。

画像のチェック項目すべて · ガイド · チェック項目一覧

執筆:Neova Labs · チェック項目一覧に戻る