CSS3 Tutorial-Text effects

Source: Internet
Author: User
CSS3 offers a number of new and advanced design features that have revolutionized web front-end development, many of the complexities that require JavaScript to achieve, and are now easy to implement with CSS3. This article introduces you to the CSS3 tutorial-text effect, hoping to help improve your CSS skills.

CSS3 Text effects:

The CSS3 contains several new text attributes.

In this article, you will learn the following two text attributes:

1, Text-shadow

Text-shadow adds shading to text and uses the CSS3 property to add texture to the text without using any images.

Grammar:

Text-shadow:h-shadowv-shadowblurcolor;

2, Word-wrap

The Word-wrap property of CSS is used to indicate whether a browser is allowed to segment within a word, which is to prevent overflow when a string is too long and cannot find its natural segmentation point. Allow long words to wrap to the next line:

Grammar:

p.test {Word-wrap:break-word;}

Browser support:

Internet Explorer 10, Firefox, Chrome, Safari, and Opera support the Text-shadow property.

All major browsers support the Word-wrap property.

Note: Internet Explorer 9 and earlier versions do not support the Text-shadow property.

CSS3 Text Shadow:

In CSS3, Text-shadow can apply a shadow to text.

You can specify the horizontal shadow, the vertical shadow, the blur distance, and the color of the shadow:

Instance:

Add a shadow to the title:

h1{text-shadow:5px 5px 5px #FF0000;}

CSS3 Line Wrapping:

If the word is too long, you may not be able to go beyond an area:

In CSS3, the Word-wrap property allows you to allow text to force text to wrap-even if that means splitting the word:

Here is the CSS code:

Instance:

Allows splitting of long words and wrapping to the next line:

p {Word-wrap:break-word;}

New Text properties:

The above is CSS3 Tutorial-text effect content, more relevant content please pay attention to topic.alibabacloud.com (www.php.cn)!

  • Related Article

    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.