Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

CSS | overflow-wrap Property

  • Last Updated : 13 May, 2020

The overflow-wrap property in CSS is used to specify that the browser may break lines of text inside any targeted element to prevent overflow when the original string is too long to fit. This property was earlier known as word-wrap that still supported by some browsers but it was renamed to overflow-wrap in a CSS3 draft.


    overflow-wrap: break-word;


  • normal: The lines will break according to the original line breaking rules.
  • break-word: Words that are too long to fit in a container-element break into parts.
  • inherit: It allows the element to inherit value from its parent.
  • initial: It makes the property to use its default value.


<!DOCTYPE html>
        CSS overflow-wrap property
        p {
            color: green;
        .gfg {
            margin: auto;
            padding: 15px 15px;
            color: white;
            background-color: green;
            font-size: 20px;
            width: 60px;
            overflow-wrap: break-word;
        div {
            text-align: justify;
        h2 {
            color: green;
        h2 {
            text-align: center;
    <h2>overflow-wrap property</h2>
    <div class="gfg">
        A computer science portal for geeks.


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!