Get the App
SLTechnology News&Howtos  ›  Development  › 

The method of forced automatic line wrapping in css

Shulou Source: shulou.com Published: 2022-06-01 06:54:24 10月02日 Update

This article introduces the relevant knowledge of "css forced automatic wrapping method". In the operation process of actual cases, many people will encounter such difficulties. Next, let Xiaobian lead you to learn how to deal with these situations! I hope you can read carefully and learn something!

I. Introduction to word-wrap

Word-wrap is to set whether the ink in the equipment object can accept the newline typesetting structure when it meets the top edge of the object.

1. Grammar

word-wrap:normal--Allow content to open the specified container inland, encounter breaks without spaces English or without spaces Numbers do not newline (default, do not set equipment objects also have default pattern)

word-wrap:break-word --pattern will wrap within boundaries, and forms will wrap automatically when too many forms top the object's hinterland.

2. Think of the empty and see the situation

When there are too many numbers or letters in an object, the top edge of the pattern will not wrap after the object container, but overflow will continue without wrapping. With Chinese characters or spaces difference, Chinese characters will freeze the container hinterland will take the initiative to newline.

3. Application syntax

p{word-wrap:break-word}

Set html paragraph p text top box container edge to actively wrap

II. Active word-wrap attribute example tutorial

1. Code

css forces CSS5 instances to wrap.bos{ width:200px; height:80px; border:1px solid #F00; word-wrap: break-word; }

83480348023802ufjflsjfds843820483048jfdljfsl

Configure class=bos object width, borders, and continuous ink and digital content inside. Suppose you don't set word-wrap: break-word or if your reader looks up the first image at the end of article 1 of this tutorial and sees the continuation of the number form without breaking over the overflow box.

Here is the object configuration word-wrap: break-word forced newline pattern.

2. Whether the dabbler test can change the screenshot

"css forced automatic word wrapping method" content is introduced here, thank you for reading. If you want to know more about industry-related knowledge, you can pay attention to the website. Xiaobian will output more high-quality practical articles for everyone!

Tags: Objects contents containers numbers forms methods examples furnishings tutorials articles more patterns patterns knowledge pen and ink hinterland grammar Chinese characters configuration learning achievements Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Huawei vpn NVidia Microsoft