Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App

Related Articles

CSS | overflow-wrap Property

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

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.


Supported Browsers:

  • Chrome 23
  • Edge 18
  • Firefox 49
  • Opera 12.1
  • Safari 7

My Personal Notes arrow_drop_up
Last Updated : 24 Aug, 2022
Like Article
Save Article
Similar Reads
Related Tutorials