# Letters getting cut off to the leftmost in posts

**URL:** https://meta.discourse.org/t/letters-getting-cut-off-to-the-leftmost-in-posts/81681
**Category:** UX
**Created:** [27 februari 2018 om 17:30 UTC](https://meta.discourse.org/t/letters-getting-cut-off-to-the-leftmost-in-posts/81681 "2018-02-27T17:30:25Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Kumirei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kumirei/32/120279_2.png) [@Kumirei](https://meta.discourse.org/u/Kumirei)
#### Post date: [27 februari 2018 om 17:30 UTC](https://meta.discourse.org/t/letters-getting-cut-off-to-the-leftmost-in-posts/81681/1 "2018-02-27T17:30:25Z")

</div>

I hope none of you recognize me from my last bug report, I have a history of noticing stupid details…

I just noticed that letters are getting cut off to the leftmost in posts. At first I thought I was going crazy, but upon closer inspection it turned out I was somewhat sane.

Have a look at these two letters:

A A

Notice that the left leg of the first A is not _quite_ as thick at the bottom as the left leg of the second? I won’t blame you if you don’t. Here’s a closeup (images captured on the forum of which I am a member):

 ![image](https://global.discourse-cdn.com/meta/original/3X/7/1/71be49f0af66b373c03bfb7354903886fa9fe622.png) ![image](https://global.discourse-cdn.com/meta/original/3X/4/f/4f86b946944119a46d98b7012416a341fabcea02.png)

Now, this is even more noticable if you have a theme with white text  
 ![image](https://global.discourse-cdn.com/meta/original/3X/b/8/b8e9ed57df0ed4ecbd781cc587e1e503d45ba14e.png)

This is so frustrating now that I know it’s there. Hopefully someone clever will be equally frustrated and have a look at it.

> **The rest of the letters, if you want to have a look at them**
>
> A A  
> B B  
> C C  
> D D  
> E E  
> F F  
> G G  
> H H  
> I I  
> J J  
> K K  
> L L  
> M M  
> N N  
> O O  
> P P  
> Q Q  
> R R  
> S S  
> T T  
> U U  
> V V  
> W W  
> X X  
> Y Y  
> Z Z

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [27 februari 2018 om 17:34 UTC](https://meta.discourse.org/t/letters-getting-cut-off-to-the-leftmost-in-posts/81681/3 "2018-02-27T17:34:53Z")

</div>

Do you see that problem here on or [try.discourse.org](http://try.discourse.org)? Do you see it on that site if you use [example.com/safe-mode](http://example.com/safe-mode)?

---

<div class="post-metadata">

### Author: ![Kumirei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kumirei/32/120279_2.png) [@Kumirei](https://meta.discourse.org/u/Kumirei)
#### Post date: [27 februari 2018 om 17:44 UTC](https://meta.discourse.org/t/letters-getting-cut-off-to-the-leftmost-in-posts/81681/4 "2018-02-27T17:44:04Z")

</div>

Yep, same thing on here. As you see below it is consistent on all pages. The left A is getting cut off by a pixel.

Same comparison here on the meta:

 ![image](https://global.discourse-cdn.com/meta/original/3X/2/d/2d4404f5563635ab3900f4bbcf41dcc05d1a9ef3.png) ![image](https://global.discourse-cdn.com/meta/original/3X/8/2/82b3459c573529be5ec31e5f97df4c38221cf8a8.png)

Comparison on try:

 ![image](https://global.discourse-cdn.com/meta/original/3X/8/5/85af7ceccc5d740603a8c361ed7cbd404754321f.png) ![image](https://global.discourse-cdn.com/meta/original/3X/0/4/04ad3c84e8e0b696ba8dd7266ddf4fe31e7c696b.png)

Comparison in [safe mode](https://meta.discourse.org/t/53504?silent=true):

 ![image](https://global.discourse-cdn.com/meta/original/3X/3/0/30bdb8c1241b0e8b52b68a7f56b7c0c93d43cb08.png) ![image](https://global.discourse-cdn.com/meta/original/3X/6/a/6a8359d6917e737655505014459c6874efa89f9c.png)

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [27 februari 2018 om 18:25 UTC](https://meta.discourse.org/t/letters-getting-cut-off-to-the-leftmost-in-posts/81681/5 "2018-02-27T18:25:31Z")

</div>

Good catch, it’s incredibly slight. Looks as though the `overflow: hidden;` on `.cooked` is what’s causing it to be cut off, but I’m not entirely sure _why_ the text would be overflowing by 1px to begin with… will investigate.

---

<div class="post-metadata">

### Author: ![Kumirei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kumirei/32/120279_2.png) [@Kumirei](https://meta.discourse.org/u/Kumirei)
#### Post date: [7 maart 2018 om 17:40 UTC](https://meta.discourse.org/t/letters-getting-cut-off-to-the-leftmost-in-posts/81681/6 "2018-03-07T17:40:42Z")

</div>

Sorry to bump this topic, but I found an example which makes it much clearer what is happening

`*j j*` becomes  
_j j_

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [6 juni 2018 om 18:08 UTC](https://meta.discourse.org/t/letters-getting-cut-off-to-the-leftmost-in-posts/81681/8 "2018-06-06T18:08:41Z")

</div>

> [@Kumirei](#):
>
> Notice that the left leg of the first A is not _quite_ as thick at the bottom as the left leg of the second? I won’t blame you if you don’t. Here’s a closeup (images captured on the forum of which I am a member):
> 
> ![image](https://global.discourse-cdn.com/meta/original/3X/4/f/4f86b946944119a46d98b7012416a341fabcea02.png) ![image](https://global.discourse-cdn.com/meta/original/3X/4/f/4f86b946944119a46d98b7012416a341fabcea02.png)

Small update on this, I tested it out a little bit more (in Chrome on Windows 10) and it’s definitely an issue that’s more pronounced on Windows specifically… and if you change the width of your browser window sometimes it happens, sometimes it doesn’t. I don’t really see it on my screen in OSX.

Seems like that would have something to do with subpixel rendering… I think the only way to solve that would be to add a small amount of padding to the left side of `.cooked` or remove the `overflow: hidden` (it’s there to protect content like images in deeply nested lists from overflowing the post container, but we might be able to apply it only to the nested containers?)

> [@Kumirei](#):
>
> Sorry to bump this topic, but I found an example which makes it much clearer what is happening
> 
> `*j j*` becomes  
> _j j_

This issue is a _little_ different. When a font is italicized, it overflows outside of its reserved space (and also its parent div) - so it’s getting cut off by our same `overflow: hidden` rule.

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [6 mei 2020 om 22:26 UTC](https://meta.discourse.org/t/letters-getting-cut-off-to-the-leftmost-in-posts/81681/9 "2020-05-06T22:26:14Z")

</div>

Closing this out because it was fixed quite a while ago. There were some other clipping issues cause by `overflow: hidden` and that fix also solved this.

Overflow is still hidden, but it was moved and some padding was added, which gives text a little extra space in cases where it naturally overflows a little bit.

[https://github.com/discourse/discourse/commit/fa21b398755ccf3c523d0e0262567dbdc510de05](https://github.com/discourse/discourse/commit/fa21b398755ccf3c523d0e0262567dbdc510de05)

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [6 mei 2020 om 22:26 UTC](https://meta.discourse.org/t/letters-getting-cut-off-to-the-leftmost-in-posts/81681/10 "2020-05-06T22:26:18Z")

</div>



---

<div class="post-metadata">

### Author: ![cvx](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cvx/32/152146_2.png) [@cvx](https://meta.discourse.org/u/cvx)
#### Post date: [7 mei 2020 om 18:26 UTC](https://meta.discourse.org/t/letters-getting-cut-off-to-the-leftmost-in-posts/81681/12 "2020-05-07T18:26:32Z")

</div>

Btw. we have a similar issue with topic title. See: current (#1) vs an example without `overflow: hidden` in `h1` (#2)

#1

 ![image](https://global.discourse-cdn.com/meta/original/3X/6/3/636769dd72ee1f6e989d3cf607d16d88635e6799.png)  
#2 ![image](https://global.discourse-cdn.com/meta/original/3X/4/3/437bcd2c753fc9e54534a953d56b355ac38cd74c.png)

We do want to hide the overflow, so the best solution I had so far was to add a “positive padding, negative margin” combo on the X axis to give it a breathing room. But that’s a bit hacky. @awesomerobot?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [8 juli 2020 om 03:09 UTC](https://meta.discourse.org/t/letters-getting-cut-off-to-the-leftmost-in-posts/81681/14 "2020-07-08T03:09:43Z")

</div>



---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [27 juli 2020 om 21:53 UTC](https://meta.discourse.org/t/letters-getting-cut-off-to-the-leftmost-in-posts/81681/15 "2020-07-27T21:53:31Z")

</div>

The un-scrolled page title was a straightforward fix. That title can wrap to multiple lines, so overflow was only there to prevent long unborken words from breaking the width. Removing the overflow and adding `overflow-wrap: break-word;` will break words when there isn’t enough space.

When the title docks to the header on scroll we use `overflow: hidden` along with `text-overflow: ellipsis` to truncate titles that are longer than one line… we can’t as easily remove overflow there, so I added some padding and re-align to the left with a negative margin. Not the prettiest CSS, but it works.

[https://github.com/discourse/discourse/commit/89f6ff1574d15c9d654472f9cd3536d6da833182](https://github.com/discourse/discourse/commit/89f6ff1574d15c9d654472f9cd3536d6da833182)

* * *

A little more detail on _why_ this happens. Within a font there’s the concept of an em-box (also called an em-square). These boxes are the same size for each character and it serves as the base used for scaling, adjusting line-height, letter-spacing, etc.

Characters can extend outside of the em-box in any direction… sometimes it’s necessary for certain characters, sometimes it’s just what the font designer wanted to do. In the browser there’s no way to tell that this oveflowed content exists, so there’s nothing that can be done to account for it dynamically.

As far as I know the only options are to avoid overflow on text when possible or add a little additional padding when you can’t.
