Code using css to force line breaks for English words
This article mainly introduces the code about using css to force English words to break lines. It has a certain reference value. Now I share it with you. Friends in need can refer to the
first version of the corporate English version of the website. This will happen: due to insufficient space left in the English word, the entire word will wrap, causing the gap between the words to be too large, which directly affects the aesthetics of the layout. How to solve this problem? Interested friends can Please pay attention to this article, maybe it can help you
When making the English version of the corporate website, the English words have insufficient space left, causing the entire word to wrap, resulting in too many gaps between the words. big. As shown below :
The effect after using css attribute word-break:break-all; : as shown below :
Force no line wrapping
{ white-space:nowrap; }
Automatic line wrapping
{ word-wrap: break-word; word-break: normal; }
Force English words to break
{ word-break:break-all; }
CSS settings do not break lines:
overflow: hidden hide
white-space: normal default
pre line breaks and other whitespace characters All will be protected
nowrap Forces all text to be displayed on the same line until the end of the text or encounters the br object
Settings force line break:
word-break:
normal; according to Asia Text rules for languages and non-Asian languages that allow line breaks within words
break-all: This behavior is the same as normal for Asian languages. Breaks within any word of a line of non-Asian language text are also allowed. This value is suitable for Asian text that contains some non-Asian text
keep-all : Same as normal for all non-Asian languages. For Chinese, Korean, and Japanese, word breaks are not allowed. Suitable for height solutions between non-Asian text containing a small amount of Asian text
English does not wrap
Add word-break: break-all; in CSS to solve the problem. This problem only occurs in IE. When tested under FF, FF can add scroll bars by itself, which does not affect the effect.
It is recommended that when doing Skin, remember to add word-break: break-all; in the body. This can solve the problem of IE. The problem of the frame being opened by English
The following quotes the description of word-break. Note that word-break is a proprietary property of IE5
Syntax:
word-break : normal | break-all | keep-all
Parameters:
normal: According to Asian languages and Text rules for non-Asian languages, allowing line breaks within words
break-all: This behavior is the same as normal for Asian languages. Breaks within any word of a line of non-Asian language text are also allowed. This value is suitable for Asian text that contains some non-Asian text
keep-all : Same as normal for all non-Asian languages. For Chinese, Korean, and Japanese, word breaks are not allowed. Suitable for non-Asian text that contains a small amount of Asian text
Description:
Set or retrieve the intra-word wrapping behavior of the text within the object. Especially when multiple languages appear.
For Chinese, break-all should be used.
The corresponding script feature is wordBreak. Please see other books I have written.
Example:
{word-break : break-all; }
The above is the entire content of this article. I hope it will be helpful to everyone's learning. For more related content, please pay attention to the PHP Chinese website!
Related recommendations:
How to implement the special effects of css list rankings
Use CSS3 click Button to achieve the effect of background gradient animation
The above is the detailed content of Code using css to force line breaks for English words. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to change Chinese to English in Google Chrome? Some friends want to set Google Chrome to English so that they can continuously improve their English during use. So how to set it to English? Google Chrome is Chinese by default. Below, I will show you how to set the language of Google Chrome to English. Let’s take a look. Setting steps: 1. Open [Google Chrome], as shown in the figure below. 2. Click the [three dots] menu in the upper right corner of the Google Chrome interface, as shown in the figure below. 3. After entering the menu page, find [Settings], as shown in the figure below. 4. After entering the settings page, click the [Language] option, as shown in the figure below. 5. Select [Add Language] in the language interface, as shown in the figure below.

Many users use the BarTender software in their offices. Recently, some new users have asked how to wrap lines in BarTender. Below, the editor will bring you the method of wrapping lines in BarTender. Let us take a look below. 1. In BarTender, click the Create Text button in the toolbar, select Create Single Line Text, and enter the text content. 2. Double-click the created text object to open the text properties dialog box. Switch to the "Text Format" tab and select "Paragraph" for "Type" on the right. 3. Click Close, adjust the size of the text box or enter more text, or wrap the text according to actual requirements.

In the process of using Excel, we have to perform many different operations. Sometimes we need to wrap a line in a cell. So what exactly do we need to do to wrap a cell? Let’s take a look at how to wrap lines in a computer excel table. [Collection of excel table operation methods] How to wrap rows in excel table? Answer: You can do this by automatically wrapping rows and setting cell formats. 1. Automatic line wrapping 1. We select the area that needs to be wrapped in the table and click [Automatically wrap] on the [Start] page; 2. Then we adjust the width of column A to an appropriate value; 2. Set the cells Format 1. First, we select the area that needs to be wrapped, right-click the mouse, and click [Set Cell Format]; 2. Then in the pop-up

Many friends always encounter various problems when using computers. For example, after turning on the computer, they find that the entire computer has changed to English. Many friends do not know how to set it back to Chinese. The editor below will teach you how to set up a win10 computer. How to solve the problem of English appearing when turning on the computer. 1. After turning on the computer, click "Start - Settings" in the lower left corner. As shown in the figure: 2. After entering the Windows settings interface, click "Time and Language". As shown in the figure: 3. After entering the time and language interface, click "Region and Language". As shown in the figure: 4. After entering the region and language interface, click "Manage Language Settings". As shown in the figure: 5. After entering the management interface, click "Copy Settings". As shown in the figure: 6. Enter the welcome screen settings

Apple's iPhone 15, iPhone 15 Plus, iPhone 15 Pro and iPhone 15 Pro Max have the same size options as last year's iPhone 14 series and share similar design elements with Apple's 2022 models, such as an all-screen design, a dynamic island, and no home button on the front. Therefore, the method of hard reset or force restart does not change from the previous series. Still, if you're upgrading from a device with a home button, read on to learn how to hard reset or force reset your iPhone 15, as this process will come in handy if your device malfunctions or stops responding for any reason. How to Hard Reset iPhone 15 (All Models) Press and Release Quickly

Wrapping lines in cells in Apple's Excel Apple's Excel software is a powerful spreadsheet tool that provides many convenient functions to help users with data processing and analysis. When using Excel, sometimes we need to enter multiple lines of text in cells to better organize and present the data. However, since Excel for Apple computers is slightly different from the Windows version of Excel, the method of wrapping lines is also different. In the Windows version of Excel, we can directly

Some friends do not need to use the English keyboard, but only need to use the Chinese keyboard. At this time, they will find the English keyboard very troublesome and want to hide it. However, we cannot hide it, but we can directly delete the English input method. Let’s follow the editor. Take a look. How to hide the English keyboard in win11 1. The English keyboard cannot be hidden, but we can delete it directly in the input method. 2. First enter "Settings" through the start menu 3. Then select "Time & Language" 4. Then enter "Language & Region" and click "Addakeyboard" below to add keyboard shortcuts. 5. Then click on the input method we want, and then click the arrow in the lower left corner to move it to

Title: An in-depth discussion of several common Linux system restart commands. In Linux systems, restarting is a common operation, and the selection and use of restart commands are also crucial. This article will delve into several common Linux system restart commands and provide specific code examples to help readers better understand and master these commands. 1. Shutdown command The shutdown command is a very commonly used and powerful command in Linux systems. It can be used to shut down, restart or perform these operations regularly. under
