The jury is still out—but the Artificial one isn’t

Introduction

I’m still waiting. Still no verdict. Despite my plea for twelve qualified jurors to weigh in on the deceptively simple question—padding-left or margin-left?—the case remains unresolved. And while I haven’t given up hope, my jury remains silent. No comments but one. A lone voice in the courtroom—just enough to remind me the jury isn’t entirely asleep at the bench.

So, to buy a little more time—and perhaps as part of a desperate fallback strategy—I decided to run a small experiment (beware: this “small” experiment turned into a very long post). A literary one, if you will. Instead of turning to readers, I turned to reasoning engines, the so-called Artificial Intelligences (AI): Copilot and Gemini. Six of them, to be precise: Copilot in Quick response, Think Deeper, Smart (GPT-5), and Search modes, and Gemini in 2.5 Flash and 2.5 Pro. I gave them all the same prompt (see below), carefully crafted to be neutral, precise, and rich in context. Then I sat back and watched the artificial jury deliberate.

What follows isn’t the final verdict. It’s a filler post, yes—but one with purpose. A chance to compare how different AI modes reason through a nuanced CSS decision. And maybe, just maybe, uncover new evidence while the real jury takes its time.

Problem statement—the prompt

I’m working on a long-form blog with deeply nested sections. Each section is wrapped in a <section> element with an id for deep linking, following accessibility and semantic best practices. These sections are not landmarks (no role="region" or similar)—they’re structural units within the post, used to group headings and related content.

<section id="topic-a">
  <h2>Topic A</h2>
  <p>Content for topic A.</p>

  <section id="subtopic-a1">
    <h3>Subtopic A.1</h3>
    <p>Content for subtopic A.1</p>

    <section id="detail-a1a">
      <h4>Detail A.1.a</h4>
      <p>Content for detail A.1.a</p>
    </section>

    <section id="detail-a1b">
      <h4>Detail A.1.b</h4>
      <p>Content for detail A.1.b</p>
    </section>
  </section>

  <section id="subtopic-a2">
    <h3>Subtopic A.2</h3>
    <p>Content for subtopic A.2</p>
  </section>

  <p>This paragraph belongs to Topic A, not Subtopic A.2</p>
</section>

<section id="topic-b">
  <h2>Topic B</h2>
  <p>Content for topic B.</p>
</section>

For sighted readers, I want to visually reflect the hierarchy of these nested sections using indentation—specifically, a horizontal shift to the right. This is not about vertical spacing or margin collapse. The goal is to make the structure—such as the placement of a paragraph that belongs to a higher-level section but visually follows a lower-level one—visible without relying on disruptive visual elements like borders or backgrounds.

I’m deciding between using padding-left or margin-left to implement this indentation.

Important constraints and clarifications:

  • The content lives inside a fixed-width column (525px). When indentation is applied, the available space shrinks—whether by margin-left or padding-left. In practice, both reduce the visible content width.
  • Visually, the result is identical. The difference lies in semantics, layout behavior, and how the box model interprets the shift.
  • I will not indent sections at the H2 level. Indentation begins at H3 and increases consistently with each deeper heading level.
  • I use CSS selectors like section section for H3-level sections, section section section for H4-level sections, and so on. Each level is indented further from the left edge of the column.
  • I’m not looking for what most developers do. I want the technically correct, recommended solution for this specific use case.
  • Please prioritize reasoning grounded in authoritative sources such as the CSS specifications, WHATWG, MDN, W3C/WAI, or Google’s developer documentation. Avoid relying on blog posts or popular opinion unless clearly justified.

Please analyze which property is more appropriate for this use case, based on:

  • Semantic alignment with the box model
  • Responsiveness and layout behavior
  • Accessibility implications
  • Practicality across screen sizes and zoom levels
  • How each affects the perceived containment and hierarchy of nested sections

Walk through the reasoning clearly and thoroughly. I want to understand why one choice is better than the other—not just what to use.

The Artificial Jury hands in their papers

To run this experiment, I opened six separate windows—one for each AI—pasted the prompt directly into the input field, and hit Return. No greetings, no warm-up, no fioriture. Just the raw challenge. What follows are their unedited responses—each “copy” handed in exactly as received, including the decorative icons Copilot insists on using.

Copilot in Quick response

For visually conveying nested hierarchy in a fixed-width column, using margin-left is the technically correct and semantically appropriate choice over padding-left.


🧠 Semantic Alignment with the Box Model

  • margin-left adjusts the element’s position relative to its container, creating visual separation between nested sections. This aligns with your goal of expressing structural hierarchy without implying internal containment.
  • padding-left increases the internal spacing of the element, suggesting that the content is offset within its own box. This implies containment or emphasis, which is not your intent.

According to the CSS Box Model specification:

Margins are used to create space between elements, while padding creates space inside an element.

Since your sections are structural—not visual containers—margin better reflects their role as layout units.


📱 Responsiveness and Layout Behavior

  • margin-left preserves the internal content width, making it more resilient across screen sizes and zoom levels. The content remains fully readable and doesn’t risk overflow unless the margin is excessive.
  • padding-left reduces the usable content width, which can lead to cramped text or horizontal scrolling in deeply nested sections—especially problematic in a fixed-width layout.

The W3C Reflow technique G224 emphasizes that indentation should not compromise readability or require two-dimensional scrolling. Margin avoids this risk more effectively.


♿ Accessibility Implications

  • margin-left is neutral in terms of accessibility. It visually shifts the element without affecting its perceived role or content boundaries.
  • padding-left may imply emphasis or grouping, which could mislead users relying on visual cues or screen magnification. It can also interfere with assistive technologies that interpret layout semantics.

The WAI Technique C18 encourages using margin for layout control rather than padding when the goal is spacing between elements.


🧩 Practicality Across Screen Sizes and Zoom Levels

  • Margin scales predictably. It doesn’t interfere with internal content flow and is easier to manage with media queries or relative units like em.
  • Padding can cause layout shifts, especially when combined with borders or background styles. It also complicates box-sizing calculations unless explicitly set to border-box.

The W3C CSS best practices recommend using scalable units like em for layout spacing—which works well with margin-based indentation.


🧱 Perceived Containment and Hierarchy

  • Margin visually separates nested sections, reinforcing their structural depth without implying containment.
  • Padding suggests that content is nested inside a visual box, which could confuse readers about which section a paragraph belongs to—especially in cases like your final paragraph under Topic A.

By using margin-left, you preserve the visual hierarchy while maintaining clarity about section ownership.


✅ Recommended Implementation

section section {
  margin-left: 1em;
}
section section section {
  margin-left: 2em;
}
section section section section {
  margin-left: 3em;
}
/* Continue as needed */

Use em units to ensure scalability with font size and accessibility zoom.


🧭 Final Verdict

Use margin-left for indentation in deeply nested structural sections. It aligns with the CSS box model, supports accessibility and reflow, preserves content width, and accurately reflects the semantic role of your sections.

Copilot in Think Deeper

Summary recommendation

Use padding on the section element to create the visual horizontal indentation — preferably the logical property padding-inline-start — and keep the section’s width handling explicit with box-sizing: border-box. Padding better matches the semantic meaning of “content inset”, avoids margin-collapsing and flow surprises, preserves hit area and focus outlines, and gives more predictable, accessible behavior across sizes and zoom levels.


Semantic alignment with the box model

  • Padding represents space inside a box between the border and the box’s children. Indentation here is conceptually “move the content inward while keeping the section box where it belongs,” so padding aligns with the intent: you are offsetting the content within the section, not shifting the section box itself.
  • Margin moves the box in relation to siblings and its container; using margin-left would shift the whole section box and change how that element participates in the outer layout. That is semantically different from “I want the children to be indented to show nesting.”
  • Practical consequence: padding preserves the section’s logical placement while visually conveying nesting; margin changes the layout relationships (affecting siblings, hit tests, scroll position, etc.).

Responsiveness and layout behavior

  • Padding reduces the available content area inside the box but keeps the element’s box in the same position relative to siblings and the column container. That makes the indentation predictable inside a fixed-width column: you know the section box still starts at the column’s left edge.
  • Margin-left reduces the available visible width in the same way (because the box is shifted right inside the fixed column), but it also changes the element’s position in the flow. That can cause:
    • Unexpected overlap or reflow behavior when combined with percentage widths or floats.
    • Different stacking or alignments with sibling elements, because margins affect external spacing.
  • Use box-sizing: border-box when using padding: that keeps width calculations predictable (padding included in the element’s rendered width) so you control the layout precisely inside fixed columns.

Practical guidance:

  • Use logical padding (padding-inline-start) rather than physical padding-left for better internationalization (writing-mode / direction).
  • Use relative units (rem or em) or responsive functions (clamp()) for indentation so it scales with font size and viewport.

Example pattern (conceptual):

section { box-sizing: border-box; width: 525px; /* your fixed column */ }
section section { padding-inline-start: 1rem; }
section section section { padding-inline-start: 2rem; }
/* or use a variable and multiply, or clamp for responsive scaling */

Accessibility implications

  • Focus rings, keyboard navigation, and skip links rely on element positions and hit targets. Padding preserves the element’s outer box so:
    • Focus outlines remain positioned consistently relative to the column; users who rely on keyboard focus or visual outlines see predictable behavior.
    • Click / touch hit areas are preserved because padding is inside the box and does not shrink the clickable area of ancestors in confusing ways.
  • Margin-left can move the element’s outer box, which changes where focus lands visually and can confuse keyboard users if outer boxes no longer align logically with the rest of the content (for example, an H2 sibling may remain at left while an H3 box is shifted).
  • Screen readers and semantic structure are unaffected by either property because accessibility tree is derived from DOM/semantics not CSS. The difference is visual: for users who depend on visual layout (low-vision users, cognitive disabilities), predictable and stable visual containment is important; padding provides that.
  • Use of logical properties helps when the writing-direction changes, preserving correct visual indentation for RTL readers.

Practicality across screen sizes and zoom levels

  • Padding scales naturally with font-size when using relative units (em, rem), so zooming (browser zoom or user font-size change) keeps indentation proportional to text, which usually preserves readable line lengths and visual hierarchy.
  • Margin shifting can interact poorly with responsive breakpoints: if an element’s margin pushes it into or out of wrapping or triggers overflow, layout changes may be less predictable.
  • Because padding-inset reduces inner content width, ensure text line-length does not become unreadably narrow at deep nest levels. Use media queries, clamp(), or a maximum indentation depth to maintain usable line length on small viewports.
  • For fixed-width columns, use box-sizing: border-box with padding so your intended column width remains consistent and predictable when adding nest levels.

Suggested approach for responsive control:

  • Define a base indent variable and multiply by nesting level.
  • Cap the indent (max-indent) or switch to a different layout at small widths (collapse visual indentation, use a different visual affordance).

Example conceptual CSS:

:root { --indent-step: 1rem; --indent-max: 3rem; }
section section { padding-inline-start: min(var(--indent-step), var(--indent-max)); }
section section section { padding-inline-start: min(calc(var(--indent-step) * 2), var(--indent-max)); }
@media (max-width: 480px) {
  /* reduce or remove indentation on very small screens */
  section section { padding-inline-start: 0.5rem; }
}

Perceived containment and hierarchy of nested sections

  • Padding visually keeps content “inside” the parent section. A paragraph that belongs to the parent but appears after a child section will still align with the parent’s content edge; the indentation shows the child is nested while the parent content remains visually connected to the parent.
  • Margin-left would move the child’s entire box; the visual relationship between child and parent can become ambiguous because boxes no longer share the same left edge. That can create the misleading impression that the parent ended earlier or that the child is an independent block rather than nested content.
  • For semantic grouping, choose the visual model that communicates “this is still part of the parent but inset” — padding matches that communicative intent.

Other technical details and pitfalls

  • Margin collapse: vertical margins between parent and first/last child can collapse; while margin-left is not part of margin-collapsing issues, using margins for structural spacing has more layout side effects than padding (margins interact with siblings and the outside flow).
  • Hit areas and interactive children: padding keeps the parent’s clickable region whole; margin shifts can change hit targets relative to surrounding content.
  • Scroll anchoring and deep linking: shifting the box via margins changes the element’s position relative to the viewport. While deep linking to an id will still land at the element, the visual context (the element’s outer box) will be shifted. Padding keeps the element’s box in place, which tends to be more predictable for scroll-to-anchor behavior when you expect anchors to align to the column left.
  • Printing: padding is included in printable box content; margins can cause different page breaks or widows/orphans behavior. Padding-based indentation is more consistent when printing to preserve the column layout.

Implementation checklist and recommended CSS

  1. Use padding-inline-start (logical) not padding-left, for writing-mode/direction safety.
  2. Set box-sizing: border-box on the sections or globally to keep width stable.
  3. Use relative units (rem/em) or clamp() to make indentation respond to text scaling and zoom.
  4. Cap indentation depth or switch to a simplified layout on narrow viewports to keep line-length usable.
  5. Avoid adding role=”region” or other ARIA landmarks unless these are real landmarks; the visual indentation alone is purely presentational.
  6. Test keyboard focus outlines, high-contrast modes, and RTL to ensure the visual hierarchy remains clear.

Concise example:

/* global */
* { box-sizing: border-box; }

/* base column container is fixed width 525px */
.column { width: 525px; }

/* indentation step and max */
:root { --indent-step: 1rem; --indent-max: 3rem; }

/* H3-level */
.column section section {
  padding-inline-start: clamp(0.75rem, 1rem, var(--indent-max));
}

/* H4-level */
.column section section section {
  padding-inline-start: clamp(1.5rem, calc(2 * 1rem), var(--indent-max));
}

Final verdict

Padding (logical padding-inline-start) is the technically correct and recommended choice for this use case because it semantically represents insetting content inside the section, keeps layout and hit areas predictable, behaves more robustly across zoom and responsive changes, and better preserves the perceived containment/hierarchy of nested sections. Use box-sizing: border-box, logical properties, relative units, and a cap or responsive fallback to keep indentation practical and accessible on all viewports.

Copilot in Smart (GPT-5)

Choosing indentation for nested sections

You’re doing something thoughtful: using visual indentation to mirror semantic hierarchy without turning sections into landmarks. The crux is whether that leftward offset should be “inside” the section (padding) or “outside” it (margin). Here’s the technically correct choice and why it fits your constraints.


Recommendation

Use padding-inline-start (not margin-left) for indentation at H3+ levels.
Logical padding communicates “content is contained within this section and starts indented,” scales correctly with writing modes and directions, and preserves the perception of nested containment. Prefer logical properties over physical ones for future-proof responsiveness and internationalization.


Box model semantics

  • Containment vs separation:
    Padding is part of the box’s interior; it moves the content inward while keeping the section’s edge as the reference frame. This matches your intent: each nested section’s content is visually “inside” its parent, reinforcing hierarchy. Margin sits outside the box and depicts separation between boxes; using it to indent suggests spacing between siblings rather than content being nested inside a parent, which weakens the containment signal.
  • Background, borders, and hit area:
    Padding increases the clickable and perceivable area of the section (including background/border if you later add subtle cues), aligning with containment. Margin creates external whitespace that doesn’t belong to the section’s interactive area, which can subtly undermine the “this content belongs to this section” feel.
  • Logical directionality:
    Use padding-inline-start instead of padding-left so indentation follows writing mode (LTR/RTL, vertical flows). This is the recommended pattern per CSS logical properties guidance, mapping flow-relative sides rather than physical axes.

Responsiveness and layout behavior

  • Fixed column width (525px):
    Both margin-left and padding-left reduce the visible content width in practice. With padding, the section’s content area shrinks in a way that clearly communicates nesting depth without shifting the section’s outer edge. Margin shifts the entire box right, visually detaching it from the parent’s left edge and can make sibling alignment inconsistent.
  • Deep nesting:
    Padding composes cleanly: each level indents content without displacing the ancestor edges. That consistent inner offset visually stacks the hierarchy. Margins accumulate “outside,” risking misalignment of parent edges and making it harder to visually parse which elements remain within higher-level sections when interleaved content appears (like your paragraph after Subtopic A.2).
  • Writing-mode resilience:
    padding-inline-start automatically adapts for RTL and vertical writing without reauthoring rules or flipping values, which is a best practice for robust layouts Mozilla Developer.

Accessibility implications

  • Perceived grouping:
    Padding strengthens the mental model that content belongs to the section by nesting it inside the section’s box. Screen magnification and low-vision users benefit from consistent edge references; padding keeps section edges aligned while moving content inward, aiding orientation.
  • Focus outlines and interactions:
    If headings or interactive elements get focus outlines, padding ensures those outlines remain visually “within” the section’s area. Margins can yield odd gaps where outlines appear separated from their parent section edge, which can subtly confuse context.
  • Assistive tech semantics unaffected:
    Neither choice changes semantics for AT (since you’re not using landmarks). But visual semantics matter for cognitive accessibility; padding better conveys hierarchy through consistent insets without implying sibling separation.

Practicality across screen sizes and zoom

  • Zoom and reflow:
    With increasing zoom, indentation should remain proportional and readable. Use relative units (rem) for padding so indentation scales with text. Padding preserves the left reference edge; even when line lengths shorten, users can track indentation depth reliably.
  • Overflow control:
    If you later introduce backgrounds or borders, padding avoids awkward external gaps. Margins can create unexpected horizontal scroll if combined with other layout constraints, whereas padding typically keeps the section within its parent’s box without protrusion.

Visual hierarchy and containment

  • Hierarchical signal:
    Padding-inline-start produces an “inside” offset per level, clearly stacking depth while maintaining parent edge continuity. This makes cases like “paragraph belongs to Topic A but follows Subtopic A.2” visually legible: the paragraph’s lack of additional padding indicates it’s at Topic A’s content depth, not at the subtopic’s depth.
  • Consistency for mixed content:
    When headings, text, and nested sections interleave, padding maintains predictable inner gutters at each level. Margins can stagger outer edges, blurring which content is still within a higher-level section when read visually.

Implementation notes

Use logical padding with level-based selectors

/* Base: no indentation at H2-level sections */
section { /* top-level styles for the column’s content if needed */ }

/* H3-level sections (one nesting deep) */
section section {
  padding-inline-start: 1.25rem; /* adjust to taste */
}

/* H4-level sections (two levels deep) */
section section section {
  padding-inline-start: 2.5rem;
}

/* H5-level sections, etc. */
section section section section {
  padding-inline-start: 3.75rem;
}

Prefer relative units and clamp for readability

/* Example scaling that respects zoom and small screens */
:root {
  --indent-step: clamp(0.75rem, 2vw, 1.5rem);
}

section section { padding-inline-start: var(--indent-step); }
section section section { padding-inline-start: calc(2 * var(--indent-step)); }
section section section section { padding-inline-start: calc(3 * var(--indent-step)); }

Use logical properties for future-proofing

  • Why: Flow-relative properties (inline/block start/end) follow writing modes and directions without changing your CSS, which is the recommended approach in modern layouts.

Sources: Mozilla Developer (external link)

This box is not part of Copilot’s answer — it’s here only to highlight a side effect of placing an aside right within a section. Since this section ends with just a short line, the aside still reserves its room but cannot extend into the next section. The result is a blank area to the right — replaced here with this layout note — until the aside’s vertical space is cleared.

Gemini 2.5 Flash

For the specific use case of visually indenting a nested, structural block element like a <section> to reflect hierarchy, margin-left is the technically superior and more appropriate property.

While the visual outcome appears identical, the choice hinges on the semantic purpose of the indentation within the CSS Box Model and its effect on layout behavior. You are shifting the entire structural block, not creating an internal buffer for its content.


1. Semantic Alignment with the Box Model

The choice between margin-left and padding-left is fundamentally about the Box Model and whether the space is external or internal to the element’s primary function.

  • margin-left (External Space): Margin defines the space outside the element’s border, separating it from adjacent or containing elements. In your scenario, using margin-left signals:
    • “This nested <section> block is being pushed away from the left edge of its parent container.”
    • This is semantically aligned with the goal of visually offsetting a structural unit (the entire nested section) that is distinct from its sibling content (like the paragraph following it that belongs to the parent section). The entire block is shifted to the right.
  • padding-left (Internal Space): Padding defines the space inside the element’s border, separating the element’s content from its own edges. Using padding-left would signal:
    • “The content inside this <section> is starting further in from this section’s own left edge.”
    • While this achieves the visual effect, it is more commonly used for formatting the internal content flow (e.g., ensuring text doesn’t abut a border). Shifting an entire structural block is not the primary semantic purpose of padding.

Conclusion: Since you are shifting an independent, block-level structural unit, margin-left correctly uses external spacing to position the box relative to its container.


2. Responsiveness and Layout Behavior

In a fixed-width column environment (like your 525px container), margin-left offers a simpler, more robust layout behavior.

  • Behavior of margin-left:
    • A block element (like your <section>) defaults to a width: 100% of its container’s content area.
    • Applying margin-left shifts the element’s start position to the right. The block element will automatically shrink its computed width to fill the remaining space (container width - margin-left).
    • It is a pure positional shift that automatically handles the necessary width reduction without requiring any additional CSS (like box-sizing adjustments).
  • Behavior of padding-left:
    • Applying padding-left to a block element with the default box-sizing: content-box causes a layout problem: the element’s total width becomes 100% + padding-left, resulting in horizontal overflow beyond the 525px container.
    • To fix this, you would need to either:
      1. Explicitly reduce the section’s width (width: calc(100% - IndentValue)), which complicates the CSS.
      2. Set box-sizing: border-box on the sections, which is a popular modern technique but an extra step not strictly necessary for a pure block shift.

Conclusion: margin-left avoids the complexity of the default box-sizing behavior for indentation, leading to cleaner, more predictable layout behavior for a block shift.


3. Accessibility and Perceived Hierarchy

  • Accessibility (W3C/WAI):
    • Both properties are purely presentational CSS. They have no direct impact on how screen readers or other assistive technologies interpret the content hierarchy.
    • The accessibility and semantic hierarchy are correctly established by your HTML structure: the nesting of <section> elements and, most importantly, the sequential, nested use of headings (<h2>, <h3>, <h4>). This is what defines the relationship for non-sighted users.
  • Perceived Hierarchy:
    • margin-left reinforces the structure cleanly when the nested section ends.
    • Consider the paragraph: <p>This paragraph belongs to Topic A, not Subtopic A.2</p>
    • When the nested Subtopic A.2 <section> ends, the following paragraph (which belongs to the parent Topic A section) will visually align with the parent <h2> because it has no indentation applied.
    • Since margin-left moves the entire box (and all its children) as a single unit, the visual “return” to the parent’s alignment is crisp and accurately reflects the closing of the nested structural unit.

Conclusion: margin-left is a more effective visual tool for indicating that a block structure (the nested section) has completed its domain, and the following content has returned to the previous level of hierarchy.

Gemini 2.5 Pro

Based on your specific constraints and desire for a solution grounded in CSS specifications, the more appropriate and robust property for your use case is padding-left.

The primary reason is that padding-left correctly aligns with the content-within-content semantic model of your nested sections and, as a direct result, provides a vastly more elegant and maintainable CSS implementation.

Here is a detailed breakdown based on your criteria.

1. Semantic Alignment with the Box Model

This is the most important distinction.

  • margin is for creating space outside an element’s border. According to the W3C specification, its primary purpose is to “separate the element from its neighbors.” It’s about an element’s position relative to other blocks.
  • padding is for creating space inside an element’s border, between the edge and the element’s content.

Your HTML structure is a series of nested “thematic groupings” (<section>). The content of <section id="topic-a"> is its <h2>, its paragraphs, and the entire <section id="subtopic-a1"> block.

When you apply padding-left to section section (e.g., #subtopic-a1), you are semantically saying: “The content of this section should be indented.” This is correct. The content of #subtopic-a1 is its <h3> and its child section, #detail-a1a. The padding correctly pushes both of these items to the right.

If you used margin-left, you would be semantically saying: “This entire block’s position should be shifted.” While visually similar, it treats the block as an independent object being positioned, rather than as content being indented within its parent. The padding-a model more accurately reflects the nested, content-within-content relationship.

2. Practicality and Layout Behavior (The “Killer Feature”)

This is where the padding-left choice becomes a clear winner. Because of its “content-first” semantic model, it allows for a “cumulative” CSS rule that is far more elegant and maintainable.

To achieve your goal, you only need <b>one CSS rule</b>:

/* * Indent the content of any section that is
 * nested inside another section.
 */
section section {
  padding-left: 1.5em; 
}

Note: Using em units is crucial for accessibility, as it scales with the user’s font size.

Here is why this single rule works for infinite nesting:

  1. H3-Level (<section id="subtopic-a1">): This element matches section section. It gets 1.5em of padding-left. Its content (the <h3> and the detail-a1a section) is indented by 1.5em.
  2. H4-Level (<section id="detail-a1a">): This element also matches section section. It also gets 1.5em of padding-left.
  3. The Result: The <h4> inside detail-a1a is indented by its own section’s padding (1.5em) plus its parent’s padding (1.5em). The total visual indentation is 3em, exactly as you’d want.

This cumulative behavior is the correct visual and structural representation of your hierarchy.


The margin-left Alternative (and its flaw)

To achieve the same effect with margin-left, you would have to write a new, overriding rule for every single level of nesting, calculating the indentation yourself.

/* The 'margin-left' way (brittle and verbose) */
section section {
  margin-left: 1.5em;
}

section section section {
  margin-left: 3em; /* Manually calculate 1.5 + 1.5 */
}

section section section section {
  margin-left: 4.5em; /* Manually calculate 1.5 + 1.5 + 1.5 */
}

/* ...and so on, forever... */

This is clearly less practical, harder to maintain, and breaks if you add a new nesting level without updating the CSS. The padding-left solution is “set it and forget it.”

3. Handling Sibling Content

Your padding-left solution perfectly handles your example of a paragraph that belongs to a parent section.

<section id="subtopic-a2">
  <h3>Subtopic A.2</h3> <p>Content for subtopic A.2</p> </section>

<p>This paragraph belongs to Topic A, not Subtopic A.2</p>

The padding-left is applied inside subtopic-a2. The box of subtopic-a2 itself is not shifted. The final <p> tag is its sibling and is not affected by the rule, so it correctly aligns at the 0-indent level. This creates the exact visual distinction you need.

4. Accessibility and Responsiveness

  • Accessibility: As discussed, using a relative unit like em (or rem) is non-negotiable. It ensures your visual indentation scales with the user’s text-size and zoom preferences, which is a core WAI (Web Accessibility Initiative) guideline.
  • Responsiveness: Both padding and margin will consume horizontal space. In your fixed-width 525px column, this is fine. If this column were to shrink on a smaller screen, you would want to use a media query to reduce or remove the indentation to preserve space for content. This is easy to do.
section section {
  padding-left: 1.5em; 
}

/* At narrow widths, remove the visual indentation */
@media (max-width: 525px) {
  section section {
    padding-left: 0;
  }
}

Final Verdict

Use padding-left with em units.

It is the semantically correct choice because it treats the nested elements as content to be indented. This correct semantic model, in turn, unlocks a far more practical, maintainable, and elegant CSS solution that handles all nesting levels with a single rule.

The follow-up question

Thanks for sticking with me through the post so far—and for reading all six AI responses! You’ve officially reached the halfway point (yes, I know… it’s a hefty 30-minute read).

That’s the halfway mark of the original draft, to be precise. But given the length of this post, I’ve decided to cut the extended “right of reply” section. Which means—you’re now much closer to the end.

In other words, I’m diving straight into my analysis of the experiment—where everything really starts to come together. Maybe.

What I have learned

Running this experiment with six AI models didn’t just expose their quirks—it revealed how they interpret, assert, and occasionally misfire. This isn’t a technical postmortem, nor a ranking of intelligence. It’s a synthesis of patterns, contradictions, and surprises that emerged when I asked machines to reason like humans. What follows isn’t a transcript—it’s what I learned from how they said it.

All six models leaned heavily on the box model to justify their conclusions—“according to the box model…” became a familiar refrain. This was no accident; my prompt explicitly asked them to evaluate the semantic alignment of each property with the box model. And yet, despite this shared foundation, their verdicts diverged. One model confidently endorsed padding-left, another insisted on margin-left, both citing the same conceptual framework. How does that happen? The answer, I suspect, lies in their interpretation of my intent—a subtle but telling clue that surfaced in their right of reply. So, does the box model help? Eventually, yes—but only once I’d asked the right question. After months of back-and-forth, and thanks in part to the AI responses in this very post, I may have finally reached a clear understanding. Maybe.

What’s even more striking than their disagreement is the confidence with which each model asserts visual superiority. Consider the paragraph that belongs to Topic A, not Subtopic A.2, in my prompt. The goal is to help sighted readers intuit its proper placement through indentation alone. Whether that indentation is achieved via margin or padding, the visual cue remains identical. Yet, whichever side they land on—padding-left or margin-left—they tend to frame it as the option that will “look right” or “render correctly,” subtly implying that the alternative would somehow fail to do so.

This is especially important for your use case: the paragraph after Subtopic A.2 belongs to Topic A, not Subtopic A.2. Using padding ensures it aligns with Topic A’s indentation level, avoiding visual misinterpretation.

This is, frankly, nonsense. Both approaches produce the same visual result in this context. The difference is semantic, not perceptual. It’s a gentle reminder that confidence, especially in machine-generated prose, doesn’t always correlate with correctness. Excuse my French—but sometimes, it’s just beautifully formatted bullshit.

Confidence. A fool’s substitute for intelligence.Dr. Robotnik

When it comes to sourcing, the models are surprisingly lax. Except for Copilot in “Quick response” and “Search”, none of them provided actual links—and even when they did, the sources were irrelevant or generic. I’ll admit that’s partly on me. I thought I had asked for citations explicitly in my prompt, but I hadn’t. Mea culpa. Still, it’s telling how quickly they default to vague gestures at authority: “according to best practices,” “as recommended by MDN,” “based on the CSS specification”—without ever showing their work. It’s the AI equivalent of name-dropping at a party: impressive until you ask a follow-up.

Despite their differences, the models revealed an unexpected pattern: consistency across camps. Copilot “Quick response” and Gemini 2.5 Flash—both designed for speed—tended to align in their reasoning. Meanwhile, the more deliberative modes—Copilot Think Deeper, Smart (GPT 5.0), and Search, along with Gemini 2.5 Pro—formed a second, distinct cluster. And they didn’t budge. Unlike past experiences where a gentle “Are you sure?” could trigger a flip, this time—even when I pointed out that another model disagreed—they held their ground. I had hoped my “right of reply” would spark reconsideration. It didn’t.

Now, it might be tempting to assume that the larger group, or the “smarter” one, holds the correct answer. But that would be a mistake. If I’ve learned anything from my use of AIs, it’s that they aren’t particularly clever—just well-informed, assuming they have access to the right information. All the models made mistakes—no matter their mode. Most notably, nearly all of them brought up margin collapsing, despite my prompt explicitly stating that it wasn’t relevant. And it truly isn’t, at least not for margin-left in this context. This kind of error isn’t just a misreading; it’s a failure to reason. They can parse syntax, echo documentation, and simulate confidence with unnerving fluency. But true understanding remains out of reach.

One unexpected insight came from Copilot “Think Deeper”, which flagged the importance of box-sizing: border-box when using padding-left. Its explanation—that this setting keeps width calculations predictable by including padding within the element’s total width—triggered a recall of the box-sizing exercise I mentioned in a previous post. Remember the counterintuitive behavior I noted—why padding reduced content width without expanding the box? Turns out, thanks to Gutenberg, my sections already default to border-box (instead of content-box). So not only did I learn something new, I also learned I don’t need to worry about it. A rare win. Interestingly, none of the other “smart” models—Copilot Smart, Search, or Gemini Pro—mentioned it. Yet Copilot Quick did, framing it as a reason to avoid padding: “Padding can cause layout shifts… unless explicitly set to border-box.” Even Gemini Flash chimed in, warning that content-box would cause horizontal overflow beyond the 525px container.

One last word, I titled this post “The jury is still out—but the Artificial one isn’t” with the idea that AI might help settle the debate. But in truth, these models weren’t acting as jurors. They were more like expert witnesses—verbose, occasionally contradictory, sometimes insightful. The real jury is you, the readers. And while these artificial witnesses didn’t deliver a unanimous verdict, they’ve certainly given you plenty to deliberate. So go ahead—cast your decision in the comments. The court is still in session.