css text text

CSS  text formatting

 

text format

This text is styled with some of the text formatting properties. The heading uses the text-align, text-transform, and color properties. The paragraph is indented, aligned, and the space between characters is specified. The underline is removed from the "尝试一下" link.


Text Color

Color attribute is used to set the color of the text.

The color is most often specified by CSS:

  • Hexadecimal values - such as:  # FF0000
  • An RGB value - such as:  RGB (255,0,0)
  • The names of colors - such as:  Red

See the complete CSS color values ​​of the color value.

A background color of the page means within the body of the options:

Examples

body {color:red;} h1 {color:#00ff00;} h2 {color:rgb(255,0,0);}

try it"

Remark For the W3C standard CSS: If you define a color attribute, you must define the background color attribute.


Alignment of the text

Text flow attribute is used to set the horizontal alignment of the text.

Text can be centered or aligned to the left or right justification.

When set to text-align "justify", each line of equal width is expanded, the left and right margins are aligned (e.g., magazines and newspapers).

Examples

h1 {text-align:center;} p.date {text-align:right;} p.main {text-align:justify;}

try it"

 


Text-decoration

text-decoration property is used to set or remove decorative text.

See text-decoration property from the perspective of the main design is used to remove the underlining of links:

Examples

a {text-decoration:none;}

try it"

Also you can decorate this text:

Examples

h1 {text-decoration:overline;} h2 {text-decoration:line-through;} h3 {text-decoration:underline;}

try it"

Remark We do not recommend emphasized that the text is not a link, because it is often confused users.


Text Conversion

Text conversion property is used to specify upper and lowercase letters in a text.

Initials can be used for everything becomes uppercase or lowercase letters, or each word.

Examples

p.uppercase {text-transform:uppercase;} p.lowercase {text-transform:lowercase;} p.capitalize {text-transform:capitalize;}

try it"

 


Text-indent

Text-indent property is used to specify the indentation of the first line of text.

Examples

p {text-indent:50px;}

try it"

 


Examples

More examples

The space between the specified character
This example demonstrates how to increase or decrease the space between characters. Which is good linear module

Specifies the space between the rows and rows
This example demonstrates how to specify the space between the rows in a paragraph

Setting text orientation element
This example demonstrates how to change the direction of text elements.

Increase the blank space between words
This example demonstrates how to add white space between paragraphs in a word.

Disabling the text in the elements surrounding
this example demonstrates how to disable text within an element surround.

Vertically aligned image
This example demonstrates how to set the vertical alignment of the text image.

Adding text shadows
This example demonstrates how to set text shadows.

Guess you like

Origin www.cnblogs.com/furuihua/p/11866850.html