---
title: "Discussion on \"TIL: Hyphenate when you justify text\" | Hashnode"
description: "Discussion on \"TIL: Hyphenate when you justify text\". Sometimes, when you set text-align to justify, you see the irregular spacing between letters so that the text can be properly justified. Take a look at the below picture.\np {\n    text-align: justify;\n}\n\n\nYou can easily fix this by just hyphenating th..."
url: "https://hashnode.com/posts/til-hyphenate-when-you-justify-text/5f469843a639932bd830f8c0"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [TIL: Hyphenate when you justify text](https://blog.bhanuteja.dev/til-hyphenate-when-you-justify-text?utm_source=hashnode&utm_medium=feed)

Sometimes, when you set text-align to justify, you see the irregular spacing between letters so that the text can be properly justified. Take a look at the below picture. p { text-align: justify; } You can easily fix this by just hyphenating th...

Aug 26, 2020 · 1 min read · blog.bhanuteja.dev  
Updated Nov 1, 2022  
Read the article

-   [#til](https://hashnode.com/tag/til)
-   [#css](https://hashnode.com/tag/css)
-   [#css3](https://hashnode.com/tag/css3)
-   [#2articles1week](https://hashnode.com/tag/2articles1week)

## Written by

[Bhanu Teja Pachipulusu](https://hashnode.com/@pbteja1998)

@pbteja1998 · India

  
[View profile](https://hashnode.com/@pbteja1998)

Full-Stack Developer & Entrepreneur

Full-Stack Developer, Entrepreneur and Co-Founder of Coderplex. Building https://coderplex.in Checkout my portfolio at https://bhanuteja.dev

## Responses 2

Markdown supported · ⌘↵ to post

[Deng Beny](https://hashnode.com/@dengbeny)

[Aug 28, 2020](https://hashnode.com/posts/til-hyphenate-when-you-justify-text/5f469843a639932bd830f8c0/comment/5f48c544d5cea73bd1150254)

Lol I was struggling with this and now you just save my life by reminding me. Thank you.

[Bhanu Teja Pachipulusu](https://hashnode.com/@pbteja1998)

[Aug 28, 2020](https://hashnode.com/posts/til-hyphenate-when-you-justify-text/5f469843a639932bd830f8c0/comment/5f48c544d5cea73bd1150254#reply-5f48c642d5cea73bd115026b)

Awesome. Glad, I was able to help.

[Prateek Aher](https://hashnode.com/@prateek_aher)

[Aug 26, 2020](https://hashnode.com/posts/til-hyphenate-when-you-justify-text/5f469843a639932bd830f8c0/comment/5f46e5c0b3e09a2eded7e704)

That's a nice piece of info [Bhanu Teja Pachipulusu](https://hashnode.com/@pbteja1998). But with `hyphens: auto` , long words look weird if hyphenated at the wrong place. We can use it in conjunction with `<wbr>` tag.

[Bhanu Teja Pachipulusu](https://hashnode.com/@pbteja1998)

[Aug 27, 2020](https://hashnode.com/posts/til-hyphenate-when-you-justify-text/5f469843a639932bd830f8c0/comment/5f46e5c0b3e09a2eded7e704#reply-5f470df0b3e09a2eded7e769)

[Prateek Aher](https://hashnode.com/@prateek_aher) Good suggestion.

But, When you use `<wbr>` along with `hyphens: auto`, the browser will still break the word using hyphens at random places(chrome), so that the text will remain justified (or) it will not break the word at all and moves the text to next line and the irregular spacing will appear again.(firefox)

For example, try to see the result of the following in yout chrome and firefox browsers.

```
<p>I recently set out to implement user registration for a project<wbr>isgood that I'm working on in Elixir/Phoenix. It wasn't long before I could finish It wasn't long before I could finish</p>
```

```
p {
    text-align: justify;
    hyphens: auto;
    width: 570px;
    font-size: 24px;
    margin: 0 auto;
}
```

In chrome, 

In firefox,
