Book Top Rank with Contact Details visibility for your Business, Profession, Products or Services

How to wrap the div text in CSS

Question by Saravana s On 14 August 2022, 10:55:53

(Page Views: 184)

Answer by Saravana s On 14 August 2022, 10:56:43

What is wrap text

If we write content in an element, we wrap the text so that the content does not come out of the element, that is wrap text or wrap word. For example, if we create a box and write long words inside it, the word will be displayed in one line without wrapping the long words. If you wrap it using CSS property then the next line will display

Before using the word-wrap property:

If you use a longword it will display correctly on the desktop screen but the mobile screen will display like the below image

before using word-wrap property

After using the word-wrap property:

So, if you use the CSS word-wrap attribute to fix it you will get results like the below image. The text will wrap to fit the responsive screen.

after using the word-wrap property

Read more>>