How to set the character spacing in HTML? CSS style settings Text alignment summary

Source: Internet
Author: User
We often use the HTML character spacing is always bad settings, HTML text alignment will not be set, now this article to help you, here is about the HTML character spacing adjustment, as well as the text alignment settings, now let's take a look at this article

First, let's look at how the character spacing in HTML is set:

Let's look at what our normal text looks like:

This is a normal text, our article first to understand is the HTML character spacing settings, so we certainly can not follow the text to design, let us change the character spacing: (This is a complete code, including CSS style)

<!doctype html>

The effect of this is obvious, we set the application of the CSS style class in the head: letter-spacing:10px: This is to set the character spacing to pixel 10, let's look at the effect shown in the browser

We can obviously see, this character spacing is a lot bigger, of course, I have deleted a lot of words, this is to make it more obvious, here we can clearly see this content, feel the space is too big, you can also change the CSS style pixel value, let it reach the pixel you want. (Learn more please visit topic.alibabacloud.com CSS Video tutorial section)

Set the spacing of characters and now let's talk about the text alignment of HTML:

    • Text-align: Aligns text in the Element (center center; left: Ieft: right)

    • Direction: Sets the text direction (the default is LTR value, from left to right, RTL is right to left.) )

    • Text-transform: The letters in the control element capitalize,upercase: all uppercase English; lowercase: all lowercase English

These three are the properties of the three underlying CSS styles that we want to master. Let's take a look at the text orientation setting:

Here is an example of a text direction:

<!doctype html>

A small class is added, so that labels with this category name are right-aligned. Let's look at the effect in the browser:

Under normal circumstances, the text is left-aligned, so that we can set the right alignment of the text.

What do we do when we want to center the text? Yes, it is the first property of the above three properties, a CSS style, or such text, we set the code, the above code to copy up, to see the code:

<title>topic.alibabacloud.com</title><style>.you_1{text-align:center}.you_2{text-align:right }</style>

In CSS style I set two style values, in order to facilitate everyone, we look at the effect:

The effect should be obvious, should no one see the effect bar, the above text in the middle center, the following text in the left direction. Speaking so much, we should all understand the application of these properties, remember to practice a few more times. There is also a property and the above usage, I will not say more, the introduction is also very detailed, the attribute values are put up.

This article about HTML set character spacing and HTML text alignment to this is almost, there are questions can be left in the comments below.

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.