English text more than fixed width, do not change their own line of question must have met, in the past is used Overflow:hidden or JavaScript to control, when CSS3 appear, we can use CSS3 text line word-wrap to solve this problem
We sometimes encounter English text more than fixed width in the production, do not change their own line of issue. This sort of problem is mostly controlled by Overflow:hidden or JavaScript in the past, making it look close to perfection. When CSS3 appears, we can use the text of CSS3 to change lines word-wrap to solve this problem. Here is a brief introduction to CSS3 text line Word-wrap bar.
the grammar of a word-wrap
1. Grammar
Copy Code code as follows:
Word-wrap:normal | | Break-word
2, take the explanation
(1) Normal and Break-word, where normal is the default value, and when its value is normal controls continuous text wrapping (allowing the content to top open the container's boundary, in other words, the contents can burst the container);
(2) Break-word wrap the contents within the boundary
ii. compatibility of Word-wrap
iii. Examples of word-wrap
CSS code:
Copy Code code as follows:
Div {width:300px;height:200px;border:1px solid #ccc; word-wrap:break-word;}
HTML code:
Copy Code code as follows:
<div>menglongxiaozhan Menglongxiaozhan Dream Dragon Station Menglongxiaozhan Menglongxiaozhan Menglongxiaozhan Menglongxiaozhan Menglongxiao
Zhan Menglongxiaozhan Menglongxiaozhanmenglongxiaozhanmenglongxiaozhan Menglongxiaozhan menglongxiaozhan</ Div>
Preview Effect:
CSS3 Text line Word-wrap for you to introduce here, this property is basically compatible with all the mainstream browser, is a good attribute yo. More CSS3 attribute aspects of the introduction, enjoy the update of this blog.