In css3, word-wrap is allowed in the word and how to deal with the word-break, css3word-wrap
First, let's talk about the default behavior of the browser. When a long word is too long to exceed its region, it is first moved to the next line.
1. word-wrap: break-word
In the w3school manual, long words or URL addresses are allowed to
String truncation Assembly wrap approaching Textview wrap
Abnormal requirements Textview can only display line breaks with more than 10 English characters. Default android Textview can only be mandatory line breaks of width, or is there a linefeed "/n" in the String, but what if there is no linefeed for the String?
Here, we need to modify it as determined by ourselves.
// Set the name
String test = "abc
1. If print does not automatically wrap the line, puts will automatically wrap the line. If one line is not enough to write, you can add "\" to connect.Ruby code
Puts 6/2 print 6/1 puts 'Hello world' puts. We are all '\ 'China'Running result:
Ruby code
36 hello world we are all Chinese2. =, eql ?, Equal? Differences
= Equal Value eql? Equal value, equal type equal? Equal value, equal memory address
A =
1. If print does not automatically wrap the line, puts will automatically wrap the line. If one line is not enough to write, you can add "\" to connect to ruby code.
Puts 6/2 print 6/1 puts 'Hello world' puts. We are all '\ 'China'
Running result:
Ruby code
36 hello world we are all Chinese
2. =, eql ?, Equal? Differences
= Equal Value eql? Equal value, equal type equal? Equal value, equal memory addre
Previously summed up the DIV and do not change the line of CSS. But for a table cell to know only one property nowrap can make it not wrap.
Recently there is such a need, but found that plus nowrap in some cases will be changed line! Helpless, does not have a force does not change the line method?
Baidu a bit, so I am very relieved, and really found a way to solve the problem.
use CSS to implement table cell data wrapping or no line wrapping
1,
Force No Line wrapping
div{ white-space:nowrap; }
Wrap Line
div{ word-wrap:break-word; word-break:normal; }
Force word breaking in English
div{ word-break:break-all; }
CSS settings do not change careers:
Overflow:hidden Hide
White-space:normal Default
Pre newline and other whitespace characters will be protected
NoWrap forces all text to be displayed in the same line until the text ends or the BR object is encountered
To set the line breaki
Force No Line wrappingdiv{White-space:nowrap;}Wrap Linediv{Word-wrap:break-word;Word-break:normal;}Force word breaking in Englishdiv{Word-break:break-all;}============================================CSS settings do not change careers:Overflow:hidden HideWhite-space:normal DefaultPre newline and other whitespace characters will be protectedNoWrap forces all text to be displayed in the same line until the text ends or the BR object is encounteredSet up
The default value of white-space is normal and the line feed is automatically generated.Word-break: break-all and word-wrap: break-word indicate forced line breaks. If the former is too long, it is automatically truncated. Otherwise, the entire English word will wrap!However, I usually use the following:Word-wrap: break-word; overflow: hidden;There is no problem
When the list of comments is displayed because there is a fixed width, but the content of the display is more than the width of the Div, in which case we need to wrap it, implementing the CSS code below in the work of the comment content test encountered comments on the comments: " Dddddddddddddddddddddddddddddddddddddddddddddddddd ", the wrong comment, when the list of comments is displayed because there is a fixed width, but the content of the displ
Force do not wrap div{white-space:nowrap; automatic line wrapping div{word-wrap:break-word; woForce No Line wrappingdiv{White-space:nowrap;}Wrap Linediv{Word-wrap:break-word;Word-break:normal;}Force word breaking in Englishdiv{Word-break:break-all;}
CSS settings do not change careers:
Overflow:hidden HideWhite-space:normal DefaultPRe newline and other whitespace characters will be protectedNoWrap forces a
font size is 20, and the font is Arial. The results are as follows:As you can see, four lines of text are added, each line having a length of 120 pixels. Appendmultitext automatically added The return value of Appendmultitext () is the selection set of the var str = "Green son Geumcheon, leisurely my heart, but for June so, pondered so far." "; var multext = Appendmultitext (svg,str,30,100,120,20," SimSun "); Multext.attr (" Transform "," rotate (-20) ");The text rotates counterclockwise 20 deg
The following are the support scenarios for common browsers:
Face is the support of common browsers:
IE6/7/8[1]
FIREFOX2/3[2]
Firefox3.5
opera9+
Safari9.5+/chrome
{Word-wrap:break-word;}
TD elements need to set their widthSee Example 4 and Case 5
does not support
TD Element not supportedSee Example 4 and Case 5
does not support
TD Element not supportedSee Example 4 and Case 5
{Word-break:break-all;}
Consecutive symb
1.print does not automatically wrap, puts will automatically wrap, one line is not enough to write, you can add "\" to connect
Ruby Code
Run Result:
Ruby Code
2.==,eql?,equal? Difference
= = value equal EQL value equal, type equal equal value equal, memory address equal
The principle is basically this, if the incoming is a string, then let them become an element node, but this element node can also have many layers, in the most inner layer of the elements to be wrapped in. There are several ways to turn a string into an element node.
1,createelement,ie can also be created with element properties, but only one layer is created.
2,innerhtml, but you need to deal with the original string, IE and FF have a lot of unexpected default behavior, you can add something o
What exactly are Word-wrap and word-break? Why do you have to repeat this problem? Is the question a problem?
We often need to "fix" a cliché "bug", which is the text of the automatic line wrapping problem. In professional terms, this expected rendering is called "word wrap", which means that the text processor is capable of automatically uploading the entire word beyond the page to the next line.
In real-
Attribute Value
Blank Space Character
Line Break
Automatic line feed
First appeared in
Normal
Merge
Ignore
Allow
CSS 1
Nowrap
Merge
Ignore
Not Allowed
CSS 1
Pre
Retained
Retained
Not Allowed
CSS 1
Pre-wrap
Retained
Retained
Allow
CSS 2.1
Pre-line
Merge
Retained
Allow
CSS 2.1
Source from
We often need to "fix" a cliché "bug", which is the text of the automatic line wrapping problem. In professional terms, this expected rendering is called "word wrap", which means that the text processor is capable of automatically uploading the entire word beyond the page to the next line.
In real-world projects, especially in the testing phase, given that tests use very extreme test cases, we often need to "fix" the problem as shown in
Title wrapping simply add line breaks where you need to wrap the linesuch as "Product \ncode"The other tomorrow said
Title wrapping simply add line breaks where you need to wrap the linesuch as "Product \ncode"The other tomorrow said
$objActSheet->setcellvalue (' A2 ', ' Shoes picture '); $objActSheet->setcellvalue (' B2 ', ' Product code '); $objActSheet->setcellvalue (' C2 ', ' Original Retail price (
first, Word-wrap use:Grammar: Break-wordvalue Description:1, Normal is the default value, when its value for the normal control of continuous text wrapping (allow the content to open the boundaries of the container, in other words, the content can burst container);2, Break-word The content within the boundaries of the line ( do not truncate the English word wrap , truncated English word wrapping needs to
Badminton clap glue how to wrap? This experience shares with you the method of wrapping the sweat band.
The most disturbing some novice even some veteran's thing, may be Shing gum. "To prevent you from going forward is sometimes not in front of the mountain but in the shoes of a sand," is to say that some of the recent details of their own can not be ignored. The Ancients and cloud: "If people drinking water, Lengnuanzizhi", Shing glue or to learn the
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.