MENU service case
 Website construction website design Beijing website construction high-end website production company Shangpin China
We create by embracing change
360 ° brand value__
simplified Chinese character
Simplified Chinese English

Shangpin China Joins Hands with Beisheng Internet to Create a New Chapter in Website Construction

Type: Shangpin Dynamic Learn more

How can the CSS code of website construction do line breaking and its method?

Source: Shangpin China | Type: website encyclopedia | Time: March 5, 2019

We can often see that an element in a web page has words that exceed its own width. As a result, there will be a very long url, which will cause us an unsightly and troubled page. How can we solve this problem? Next, I will tell you how to deal with this problem.

1. You can use the forced line break symbol<br/>to break lines. Add<br/>at the place where the article needs to be wrapped to achieve automatic wrapping. As shown in the figure:

2. You can use the<p.>tag to achieve line breaking. If you need to break into new lines in an article, you can use the<p>tag to achieve new lines, but you should pay attention to the use of the p tag. As shown in the figure:

3. You can use CSS to set width auto wrap. We can add a div to a div and add a css style. You can set the corresponding css width for the added div to automatically wrap lines.

4. CSS is used for line breaking of continuous English letters and numbers. The used css attribute word wrap: break word attribute and value in word wrap. You may encounter this problem, but we use the third method to set the width to make the content line break, which is invalid for consecutive numbers and English. At this time, we need to set the css style of the corresponding div in the div css to force the line break element, word wrap: break word; Or word wrap: break all; Implement forced line break

5. The most violent way is to add overflow: hidden on the container; Can prevent text or anything from overflowing the container. Although it can solve the visual effect, it makes the text inaccessible.

The above are several ways of handling super long text overflow containers in css. I hope they can help you.

This article comes from Shangpin China: Website construction

Source Statement: This article is original or edited by Shangpin China's editors. If it needs to be reproduced, please indicate that it is from Shangpin China. The above contents (including pictures and words) are from the Internet. If there is any infringement, please contact us in time (010-60259772).
TAG label:

What if your website can increase the number of conversions and improve customer satisfaction?

Make an appointment with a professional consultant to communicate!

* Shangpin professional consultant will contact you as soon as possible

Disclaimer

Thank you very much for visiting our website. Please read all the terms of this statement carefully before you use this website.

1. Part of the content of this site comes from the network, and the copyright of some articles and pictures involved belongs to the original author. The reprint of this site is for everyone to learn and exchange, and should not be used for any commercial activities.

2. This website does not assume any form of loss or injury caused by users to themselves and others due to the use of these resources.

3. For issues not covered in this statement, please refer to relevant national laws and regulations. In case of conflict between this statement and national laws and regulations, the national laws and regulations shall prevail.

4. If it infringes your legitimate rights and interests, please contact us in time, and we will delete the relevant content at the first time!

Contact: 010-60259772
E-mail: [email protected]

Communicate with professional consultants now!

  • National Service Hotline

    400-700-4979

  • Beijing Service Hotline

    010-60259772

Please be assured to fill in the information protection
Online consultation

Disclaimer

Thank you very much for visiting our website. Please read all the terms of this statement carefully before you use this website.

1. Part of the content of this site comes from the network, and the copyright of some articles and pictures involved belongs to the original author. The reprint of this site is for everyone to learn and exchange, and should not be used for any commercial activities.

2. This website does not assume any form of loss or injury caused by users to themselves and others due to the use of these resources.

3. For issues not covered in this statement, please refer to relevant national laws and regulations. In case of conflict between this statement and national laws and regulations, the national laws and regulations shall prevail.

4. If it infringes your legitimate rights and interests, please contact us in time, and we will delete the relevant content at the first time!

Contact: 010-60259772
E-mail: [email protected]