Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a tip named: Word-wrap for title Wraping #171

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ A collection of tips to help take your CSS skills pro.
1. [Use Pointer Events to Control Mouse Events](#use-pointer-events-to-control-mouse-events)
1. [Set `display: none` on Line Breaks Used as Spacing](#set-display-none-on-line-breaks-used-as-spacing)
1. [Use `:empty` to Hide Empty HTML Elements](#use-empty-to-hide-empty-html-elements)
1. [Use `word-wrap` to Wrap a Title into a Respective Multiline heading](#use-word-wrap-to-wrap-a-title-into-a-respective-multiline-heading)



### Use a CSS Reset
Expand Down Expand Up @@ -637,6 +639,16 @@ If you have HTML elements that are empty, i.e., the content has yet to be set ei

**Note:** Keep in mind that elements with whitespace aren't considered empty, e.g., `<p class="error-message"> </p>`.

### Use `word-wrap` to Wrap a Title into a Respective Multiline heading

`word-wrap: break-word;` makes sure the long string will wrap and not bust out of the container. You might as well use word-wrap as well because as the spec says, they are literally just alternate names for each other. Some browsers support one and not the other. Firefox (tested v43) only supports word-wrap. Blink (tested Chrome v45) will take either one.

```css
.dont_brk {
word-wrap: break-word;
}
```

<sup>[back to table of contents](#table-of-contents)</sup>


Expand Down