white-space: nowrap;
width: 400px;
border: 1px solid #000000;
overflow: hidden;
text-overflow: clip;
}
p.test2 {
white-space: nowrap;
width: 400px;
border: 1px solid #000000;
overflow: hidden;
text-overflow: ellipsis;
}
Results show:
Full code:
The following paragraph contains long text that spills out of the box containing it.
TipsMake.com is a social network about science and technology
TipsMake.com is a social network about science and technology
Example 2: Display the overflowed content when hovering over the element:
div.test:hover {
overflow: visible;
}
Hover over the two divs below, to see the entire text.
The word-wrap attribute allows text to be downstream if it's too long, which can cause a word break.
The two most typical values are:
Example: Processing text too long
p1 {
word-wrap: normal;
}
p2 {
word-wrap: break-word;
}
Results show:
Full code:
WebsiteTransportation Network Web SiteVietnamese Network is a social network about science
learn technology.
WebsiteTransportation Network Web SiteVietnamese Network is a social network about science
learn technology.
Word-wrap determines whether or not the line is down, and the work-break attribute determines the type of flow.
Common values are:
If it is normal text, we will use break-word more, and break-all is usually used only for numbers (if any).
For example: The work-break attribute determines the type of flow
pa {
word-break: normal;
}
pb {
word-break: keep-all;
}
pc {
word-break: break-all;
}
pd {
word-break: break-word;
}
WebsiteTransporting Network Web SiteVietnamese Network is a social network of science
technology.
WebsiteTranslation Website Web Site Network is a network-society-about-science-
technology.
Website QuanTruongMay is a social network of science and technology.
Website QuanTruongMay is a social network of science and technology.
Writing-mode properties are used to style text that is placed horizontally or vertically.
Values of writing-mode:
Example: Using writing-mode
p.test1 {
writing-mode: horizontal-tb;
}
p.test2 {
writing-mode: vertical-rl;
}
p.test3 {
writing-mode: vertical-lr;
}
Results show:
Full code:
You can become a part of TipsMake.com by
Submit articles, experience your technology to the content management team
of the social network via email info@meta.vn or register an account
and post directly on TipsMake.com.
You can become a part of TipsMake.com by
Submit articles, experience your technology to the content management team
of the social network via email info@meta.vn or register an account
and post directly on TipsMake.com.
You can become a part of TipsMake.com by
Submit articles, experience your technology to the content management team
of the social network via email info@meta.vn or register an account
and post directly on TipsMake.com.
Last lesson: Shadow effect in CSS
Next lesson: Using Web Font in CSS