In the HTML to write the page, in order to make the content of the Web page looks neat and smooth, we need to wrap the text content, then, HTML How to change the line? This article will introduce you to the HTML text wrapping method.
There are many ways of wrapping in HTML, the simplest of which is the use of
1, the HTML line-wrapping code is
The effect is as
The text wrapping property is newly defined in CSS3, Word-wrap:
The Nomal property value indicates that continuous text wrapping is controlled.
The Break-word property value indicates that the content will wrap within the bounds. Word Wrapping (Word-break) also occurs if desired.
Comparative analysis
Three CSS related to text wrapping:
1 white-space
Attribute setting: how to process the blank space in the element.
This attribute declares how to process the blank characters in the element during layout creation.
Possible values:
Normal: The default value is ignore. The blank line character is ignored. Automatic line feed with no scroll bars
Pre: retain blank characters; Retain line breaks, that is, retain the original format
Nowrap:
Php text to image wrap method. Today, when I accidentally browsed the web, I found a long microblog that could convert text into png images. so I decided to study the PHP text conversion method, in fact, as long as a long microblog is found when PHP extensions are used to browse the web page accidentally today, it can
When we set my div, or a fixed width of another text box, the text will overflow (shown outside the area without wrapping).At this point we can use several of the CSS in the solution. There are three of the following that can solve the problem:The 1,word-break property specifies how the wrap is handled.Word-break:normal|break-all|keep-all;Value DescriptionNormal
Automatic line-wrapping problem, normal character line is more reasonable, and continuous digital and English characters are often the container brace big, it is a headache, the following is how CSS to achieve change
Method of the line
For block-level elements such as Div,pLine wrapping for normal text (Asian and non-Asian text) elements have default white-space:normal, and
In the process of data processing today, in the database used a \ n line-break symbol, the purpose is to do in the same table data multi-line display, such as
Field Name 1
Field Name 2
Field Name 3
1
Data rowData two rowsData three rows
The example is the result after the SQL query
2
Example above
Data not exported
Originally after the SQL query is so displayed, but later exported
By judging the string and intercepting the string and then splicing it together, the text image will automatically wrap the line. the following code is used to paste the text into a png image when you accidentally browse the web page, as a matter of fact, as long as the PHP Extension library is used, the GD library is used to generate images, and then the image f
1. Make text wrap by browserThe browser itself comes with the ability to wrap text in its own line.2. Specify how the line wrap is handledIn CSS3, you can use the Word-break property to decide for yourself how to handle the wrap.div{Word-break:break-all;}
The value
1. You will die the width of the table, which gives the table a width value (is the value, not the percentage)2. Force No Line breakdiv{White-space: Do not wrap, normal default; nowrap forces all text to be displayed in the same line until the text ends or the BR object is encounteredWhite-space:nowrap; }Wrap Linediv{W
Today, when I accidentally browsed the web page, I found a long microblog that could convert text into png images, so I just studied the PHP text conversion method. In fact, as long as I used the PHP extension library, the GD library is used to generate images, and then the image function is used to generate images. After the code is written, it is found that if there are too many texts, the image will exce
"Problem description"
The drawstring in the Javame graphics class does not support text wrapping, so when you draw a longer string, the text is drawn on the same line, and the string that exceeds the screen portion is truncated. How do I make text that is drawn automatically wrap?
Analysis
DrawString cannot implemen
Today, when I accidentally browsed the web page, I found a long microblog that could convert text into png images, so I just studied the PHP text conversion method. In fact, as long as I used the PHP extension library, the GD library is used to generate images, and then the image function is used to generate images. After the code is written, it is found that if there are too many texts, the image will exce
1.style>Div{White-space:Normal;Word-break:Break-all;Word-wrap:Break-word; } style> Divstyle= "width:100px; border:1px solid Red">I am a DOIBIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIDiv>Pre-CSS effect:-------> Add Effect:2. These three sentences focus on: Word-break and Word-wrapThe A:word-break property specifies how the wrap is handled.tip : By using the Word-break property, you can let your browser implement line breaks anywhere.
First, for the Div force line break1. (ie browser) white-space:normal; Word-break:break-all; The former follows the standard.#wrap {white-space:normal; width:200px;}Or#wrap {word-break:break-all;width:200px;}2. (Firefox browser) white-space:normal; Word-break:break-all;overflow:hidden;The same FF also does not have a good implementation method, can only hide or add scroll bar, of course, no scroll bar effec
Why does the text layout of Android TextView wrap appear uneven?
Today, there is no progress in the project, and there is a problem in the background of the company. After reading the notes when I was learning Android, I found that TextView will automatically wrap and the typographical text is uneven. I checked the inf
floating on it, it is not quite simple.
Second, the problems encountered
When you replace the middle text with a sequential English letter, there is a problem.
Then find the relevant information, test results found that:
When the browser parses English or numbers by default, it is parsed according to the words.
That is, each word is a whole, and when you encounter a lack of space, the word is not split.
That's why the above is happening.
Last compar
Use JavaScript to wrap text element nodes and javascript nodesOriginal article link: Wrapping Text Nodes and Elements with JavaScript original Article Date: Translated by: TieWhen your application depends on a specific JavaScript class library, you will always try to solve the problems of some class libraries rather than the language. For example, when I try to
Use JavaScript to wrap text element nodes with a DIV, and use javascriptdiv
When your application depends on a specific JavaScript class library, you will always try to solve the problems of some class libraries rather than the language. For example, when I try to wrap text (which may also contain HTML elements) with a
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.