CSS3-Text and fonts

Source: Internet
Author: User

1,text-overflow and Word-wrap

Text-overflow is used to set whether to use the ellipsis tag (...) Overflow of text within the indicated object

However, Text-overflow is only used to illustrate how the text overflows when displayed, to achieve an ellipsis effect when overflow, but also to define mandatory text to be displayed on one line (white-space: nowrap) and overflow content is hidden (Overflow:hidden), the only way to achieve overflow text display ellipsis effect, the code is as follows:

At the same time,Word-wrap can also be used to set the text behavior If the current line exceeds the bounds of the specified container.

Normal is the browser default,Break-word set to wrap within a long word or URL address , this property is not commonly used, with the browser default value.

2, embedded font @font-face

@font-face is able to load the server-side font file, allowing the browser to display fonts that are not installed on the user's computer.

Grammar:

@font-face {    font-family: font name;    SRC: The relative or absolute path of the font file on the server;}

Once this is set, you can set the font style in (font-*) as you would with normal fonts.

Like what:

p {    font-size:12px;    font-family: "My Font";    /* must item, set font-family same value in @font-face */}
3, Text Shadow Text-shadow

Text-shadow can be used to set the shadow effect of text.

Grammar:

Text-shadow:x-offset y-offset blur color;

X-offset: Represents the horizontal offset distance of the shadow, whose value is positive when the shadow is offset to the right, and vice versa;

Y-offset: Represents the vertical offset distance of the shadow, whose value is positive when the shadow is shifted downward, whereas the offset is upward;

Blur: Indicates the degree of blurring of the shadow, its value cannot be negative, and if the value is larger, the shadow is blurred, and the shadow becomes clearer, and if shadow blur is not required, the Blur value can be set to 0;

color: Colors that represent shadows, which can use the RGBA color.

CSS3-Text and fonts

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.