CCS text

CSS text:

h1 {
  text-align: center;
  text-transform: uppercase;
  color: #4CAF50;
}

p {

  text-indent: 50px;
  text-align: justify;
  letter-spacing: 3px;
}

a {

  text-decoration: none;
  color: #008CBA;
}
</style>
</head>
<body>

<div>

  <h1>text formatting</h1>
  <p>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 this colored

  <a target="_blank" href="tryit.asp?filename=trycss_text">"Try it Yourself"</a> link.</p>h1 { text-align: center; text-transform: uppercase; color: #4CAF50; } p { text-indent: 50px; text-align: justify; letter-spacing: 3px; } a { text-decoration: none; color: #008CBA; }

Text Color

The color property is used to set the color of the text. The color is specified by:
  • a color name - like "red"
  • a HEX value - like "#ff0000"
  • an RGB value - like "rgb(255,0,0)"
Look at CSS Color Values for a complete list of possible color values.
The default text color for a page is defined in the body selector.

<h1>
text formatting</h1>
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 this colored
  <a href="https://www.blogger.com/tryit.asp?filename=trycss_text" target="_blank">"Try it Yourself"</a> link.</div>
body {
  color: gray;
}

h1 {
  color: green;
}
</style>
</div>
<body>

<h1>
I have green eyes</h1>

This paragraph is gray<br />


Text Alignment

The text-align property is used to set the horizontal alignment of a text.
A text can be left or right aligned, centered, or justified.
The following example shows center aligned, and left and right aligned text (left alignment is default if text direction is left-to-right, and right alignment is default if text direction is right-to-left):

I have green eyes

This paragraph is gray
h1 { text-align: center; } h2 { text-align: left; } h3 { text-align: right; }

(they will be different with another template)

Heading 1 (center)

Heading 2 (left)

Heading 3 (right)

The three headings above are aligned center, left and right.

0 коммент.