# Text component adds extra vertical space compared to HTML

**URL:** <https://forums.realmacsoftware.com/t/text-component-adds-extra-vertical-space-compared-to-html/57047>\
**Category:** Elements\
**Created:** [July 18, 2026, 4:09pm UTC](https://forums.realmacsoftware.com/t/text-component-adds-extra-vertical-space-compared-to-html/57047 "2026-07-18T16:09:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sandro67](https://avatars.discourse-cdn.com/v4/letter/s/9e8a1a/32.png) [@Sandro67](https://forums.realmacsoftware.com/u/Sandro67)\
**Post date:** [July 18, 2026, 4:09pm UTC](https://forums.realmacsoftware.com/t/text-component-adds-extra-vertical-space-compared-to-html/57047/1 "2026-07-18T16:09:50Z")

</div>

Hi,  
I noticed a difference between the built-in **Text** component and the **HTML** component when rendering the same heading.

In the attached screenshot:

- **The first “Treatments”** is an **HTML** component.
- **The second “Treatments”** is the built-in **Text** component.

Both display the same word using the same font, size, weight and line height.

I also verified that:

- Text margins = **0**
- Text padding = **0**
- Parent Flex margins = **0**
- Parent Flex padding = **0**
- Parent Flex vertical gap = **0**
- Line Height = **None**

Despite this, the built-in Text component reserves noticeably more space above the text, while the HTML version produces a much tighter bounding box.

The HTML used for the comparison is simply:

## Treatments

Is this intentional, or should the built-in Text component produce the same vertical metrics as a standard HTML heading?  
Regards

 ![Screenshot 2026-07-18 alle 5.49.03 PM](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/f/7/f7e81d95616cb6d5ce53eba80a6f6097612d4c3c.png)

---

<div class="post-metadata">

**Author:** ![dan](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/dan/32/28516_2.png) [@dan](https://forums.realmacsoftware.com/u/dan)\
**Post date:** [July 18, 2026, 5:54pm UTC](https://forums.realmacsoftware.com/t/text-component-adds-extra-vertical-space-compared-to-html/57047/2 "2026-07-18T17:54:04Z")

</div>

That shouldn’t be the case, can you share a sample project via Elements Cloud so we can take a look for you?

---

<div class="post-metadata">

**Author:** ![Sandro67](https://avatars.discourse-cdn.com/v4/letter/s/9e8a1a/32.png) [@Sandro67](https://forums.realmacsoftware.com/u/Sandro67)\
**Post date:** [July 18, 2026, 6:06pm UTC](https://forums.realmacsoftware.com/t/text-component-adds-extra-vertical-space-compared-to-html/57047/3 "2026-07-18T18:06:49Z")

</div>

Hi Dan,

Sure, here’s the project:

elementsapp://downloadDocument/jbYUjrwwwB1F

I use Elements 2.4.4

While investigating, I found something that might be useful.

Using Safari Web Inspector:

- The **HTML component** renders a single `<h2>` with a computed **font-size of 36px** and **line-height of 40px**.
- The **built-in Text component** renders an outer `<h2>` with **font-size 48px** and **line-height 56px** , while the visible text is inside a nested `<span>` computed at **36px / 40px**.

This seems to explain why the Text component reserves more vertical space, although I’m not sure whether it’s expected behaviour or just a clue.

Hopefully this helps.

Thanks!

---

<div class="post-metadata">

**Author:** ![dan](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/dan/32/28516_2.png) [@dan](https://forums.realmacsoftware.com/u/dan)\
**Post date:** [July 19, 2026, 8:41am UTC](https://forums.realmacsoftware.com/t/text-component-adds-extra-vertical-space-compared-to-html/57047/4 "2026-07-19T08:41:57Z")

</div>

Ah, I see what’s going!

You’re styling the text twice, as you’ve also set an inline style on the text, watch the video below to see how to fix it:

Hope that helps clear things up ☺

---

<div class="post-metadata">

**Author:** ![Sandro67](https://avatars.discourse-cdn.com/v4/letter/s/9e8a1a/32.png) [@Sandro67](https://forums.realmacsoftware.com/u/Sandro67)\
**Post date:** [July 19, 2026, 9:16am UTC](https://forums.realmacsoftware.com/t/text-component-adds-extra-vertical-space-compared-to-html/57047/5 "2026-07-19T09:16:28Z")

</div>

Hi Dan,

Thank you! You were absolutely right.

It was my mistake — I had accidentally applied inline formatting to the text, so it was being styled twice without me realising it.

After clearing the inline formatting, everything works exactly as expected.

Thanks for the quick response and for taking the time to record the video. I really appreciate it!

Regards  
Sandro

---

<div class="post-metadata">

**Author:** ![dan](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/dan/32/28516_2.png) [@dan](https://forums.realmacsoftware.com/u/dan)\
**Post date:** [July 19, 2026, 11:45am UTC](https://forums.realmacsoftware.com/t/text-component-adds-extra-vertical-space-compared-to-html/57047/6 "2026-07-19T11:45:23Z")

</div>

No problem, glad we got it sorted for you ☺
