| |

VerySource

 Forgot password?
 Register
Search
View: 690|Reply: 3

How to make Chinese not wrap automatically and spread div?

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-13 19:40:01
| Show all posts |Read mode
I want to make the width of the div like the undefined width of the table, which can grow with the inner text
Reply

Use magic Report

0

Threads

29

Posts

19.00

Credits

Newbie

Rank: 1

Credits
19.00

 China

Post time: 2020-1-18 06:54:01
| Show all posts
style = "white-space: nowrap;"
nowrap does not wrap lines unless <br /> forced line breaks are encountered
Generally, the width is not defined. The div will adapt to the width.
Reply

Use magic Report

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

 Author| Post time: 2020-2-10 20:00:02
| Show all posts
If you do not define the width, it will become 100%.
Reply

Use magic Report

0

Threads

8

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

Post time: 2020-2-12 16:30:01
| Show all posts
width: 100px; table-layout: fixed; word-wrap: break-word; word-break: break-all;
width must be set
This can also handle the problems in FF, but just let the text flow out without affecting the layout
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list