October 2014 Xin Xing interprets css section 3

Source: Internet
Author: User

October 2014 Xin Xing interprets css section 3

In section 2, we talk about almost all CSS selectors. In this section, we will talk about CSS color and text. Although I am not very sensitive to color, however, we are still interested in colors.

***********

1. Speaking of color, I had to look at Newton. It was great, the dispersion of light, and a great breakthrough. It can be said that he did not finish the work for several generations.

2. next, let's talk about the three primary colors: red, green, and blue, that is, RGB. we can define a color in CSS to use this three primary colors for color, and we can also use red, green and so on.

3. if we want to set the color scheme, we first need to start with #, and then follow the hexadecimal format of the three double-digit numbers. The so-called hexadecimal format is that each digit ranges from 0 to F, that is, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.

4. where #000000 is black, # FFFFFF is white, # FFFF00 is yellow, # CCCCCC is a classic gray, about how to color, I have no good experience to share with you. In short, the larger the value, the lighter the color, the smaller the value, and the deeper the color.

5. The combination of CSS colors can produce about 0.16 million colors, and most of these can be correctly explained by the browser.

* ********** Text style *********

1. Although the layout of the website is diversified, text information is still indispensable. Let's talk about the use of CSS in the text below.

2. You can use the color attribute to specify the color of the text. I think you should know how to use it.

3. the text-align attribute refers to the method of text. It can be set to left, right, and center) and justfy (each row is expanded and the width is equal, and the left and right margins are aligned ).

4. text-decoration is used to set or delete the decoration of text. Its most typical application is to delete the underline Of a hyperlink. The following code:

a {text-decoration:none;}

5. The underline Of the hyperlink is deleted. For example, you can set it as follows:

1 p {text-decoration:overline;}2 p {text-decoration:line-through;}3 p {text-decoration:underline;}

The first one is to add the upper line, the second is to strike the middle line, and the third is to add the underline, but the underline is widely used and is acceptable to everyone, the dashes and hyphens are a little strange.

6. We can also set uppercase and lowercase letters, indentation, and so on. I feel that these are of little significance to Chinese, but they are suitable for English websites.

* ************* Font **************

1. We can set the font relatively freely in CSS. We can use font-family to specify the font name. I don't have much research on the font, so I know a few.

2. We can use font-size to specify the font size. We can use the px representation, that is, the pixel format. The browser has a default size. The size of common text is 16 PX. We can use font-size to specify the font size.

3. in addition to using px to specify the font size, you can also use em to specify the size. The unit of em size is recommended by W3C. 1em is equivalent to 16px, that is, when we want to use 40px, is to use 2.5em.

4. We can use font-style to set the font style. The two classic styles of the font are italic, that is, skew. The code below:

p {font-style:italic;}

5. The following is a hodgedge:

First, create a my.html file with the following content:

    2014 X-star CSS teaching summer edition    
     

Xin Xing of the blog Park, delivering warmth

After that, create a my.css file with the following content:

p{color: red;text-align: center;    font-size: 13px;font-style: italic;}

***************

1. This section mainly involves the color and font layout and font style.

2. It should be noted that a text class is used for typographical layout and is a layout of a group of texts.

3. font is the format of each word, such as the font, font size, and whether the font is skewed.

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.