CSS to achieve the layout of the paragraph before empty two words, do not use space

Source: Internet
Author: User
Tags empty relative
Css

Empty two words before the paragraph, do not use the space again. You should use the first line indent text-indent.

Text-indent can make the first line in the container indent a certain unit. For example, Chinese paragraphs usually empty two characters before each paragraph.

Here we need to know a length unit em. EM is the relative length unit. The font size relative to the text within the current object.

We usually empty two Chinese characters before each paragraph. In fact, the first line is indented 2em.

Look at the following example:

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 strict//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >< HTML xmlns= "http://www.w3.org/1999/xhtml" ><pead><meta http-equiv= "Content-type" content= "text/html"; Charset=utf-8 "/><title>webjx.com</title><style type=" text/css "><!--p{text-indent:2em; * EM is relative unit, 2EM is now a word size twice times */}--></style></pead><body><p> paragraph front empty two words of distance, do not use space again. You should use the first line indent text-indent. Length Unit em. The font size relative to the text within the current object. Our first line was indented 2em. 2EM is now twice times the size of a word. I learned a lot of new knowledge in the Web teaching network </p></body></ptml>

[Ctrl + A ALL SELECT hint: You can modify some of the code, and then run]



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.