CSS beginners: text attributes

Source: Internet
Author: User

Text attributes
You can set the color, size, font, and width of a text.
Original Code
<STYLE>
SPAN. c1 {color: red; position: relative; font-size: 12px; font-family: Arial; font-weight: 700}
SPAN. c2 {color: blue}
SPAN. c3 {color: green}
SPAN. c4 {color: pink}
</STYLE>
<Span class = c1> A </SPAN>
<Span class = c2> B </SPAN>
<Span class = c3> C </SPAN>
<Span class = c4> D </SPAN>
Display result
A
B
C
D
Text COLOR {COLOR}
Syntax: {COLOR: (color )}
Original Code
<STYLE>
SPAN. test {color: red}
</STYLE>
<Span class = test> a B C D </SPAN>
Display result
A B C D
Text category {FONT}
Set font style, case sensitivity, width, size, text row and column height, font
Syntax: {FONT: (font-style )? (Font-variant )? (Font-weight )? (Font-size )? (Font-family )? /(Line-height )}
Original Code
<STYLE>
SPAN. test {FONT: italic bold 12pt/18pt}
</STYLE>
<Span class = test> a B C D </SPAN>
Display result
A B C D
Download FONT {@ FONT-FACE}
Syntax: @ FONT-FACE {FONT-FAMILY: (font-family); SRC: URL (url )}
Original Code
<STYLE>
@ FONT-FACE {FONT-FAMILY: (not fixed); SRC: URL (Download address )}
</STYLE>
Display result
No results
Text FONT {FONT-FAMILY}
Syntax: {FONT-FAMILY: (font-name )? (Generic-family )}
Original Code
<STYLE>
SPAN. test {FONT-FAMILY: "Arial Black "}
</STYLE>
<Span class = test> a B C D </SPAN>
Display result
A B C D
Text SIZE {FONT-SIZE}
Set the font size (unit properties: point pt, inch in, cm, pixel px, percentage %)
Syntax: {FONT-SIZE: LARGE? MEDIUM? SMALLER? (Length )? (Percentage )}
Original Code
<STYLE>
SPAN. test1 {FONT-SIZE: LARGE}
SPAN. test2 {FONT-SIZE: 10pt}
SPAN. test3 {FONT-SIZE: 50%}
</STYLE>

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.