How to use text-indent in CSS

Source: Internet
Author: User
Tags function examples html br
CSS in the use of text-indent is very simple, mainly to see text-indent indentation grammar and structure, then we will explain to you and give a small case,

Text-indent indentation syntax and structure

. div{text-indent:25px}

The first line of the paragraph in the Div object is indented at the beginning of the text 25 pixels.

CSS text-indent text indent style attribute words, text-indent values are indented with numbers + units. Usually the Text-indent indent property indents the text text at the beginning of the first line of the paragraph. If you use an HTML BR wrap label, the second line break starts without indentation. If you use the HTML p paragraph label paragraph wrapping, will appear each p paragraph wrapping beginning will be indented, here we give you through the case demonstration to everyone, hope through the Div case Master CSS text-indent indentation style.

1. CSS Code

. div{text-indent:35px}html Code snippet <div class= "div" > <p> first paragraph start indent effect <br/> Line lines with BR labels are not indented </p> <p > second paragraph use P label the first line of the paragraph is also indented <br/> The second line uses the BR does not indent <br/> Third row Bhakta uses BR and does not indent </p> </div>

First line Paragraph text indent text-indent summary

We want to indent each paragraph, and we can control the indent distance I use text-indent to indent words. If you don't want to indent using the text-indent style, I can do it using spaces, but I need to make a few more HTML space characters "&nbsp;" To implement space-character placeholder indentation, you can learn more about HTML multi-space character applications.

Text-indent the use of so much, the need for friends can be saved, but also please keep your attention to other updates on this site.

Related reading:

What is CSS


A few small-function examples of pure CSS production


Why sometimes the div CSS fails to load

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.