Text Color

Posted on

gfdgdfgText Color

We can give the color to the text with help of color property.

With CSS, a color is most often specified by:

  • a HEX value – like “#ff0000”
  • an RGB value – like “rgb(255,0,0)”
  • a color name – like “red”

We can give the color to the text like above values.

If we want to define the default color to the website we declare the color in body.

Example

body {
color: blue;
}

h1 {
color: #00ff00;
}

h2 {
color: rgb(255,0,0);
}

 Text Alignment

With the help of text-align property we can set the horizontal alignment of a text.

We can set text  centered, or aligned to the left or right, or justified.

When text-align is set to “justify”, each line is stretched so that every line has equal width, and the left and right margins are straight (like in magazines and newspapers).

Example

h1 {
text-align: center;
}

p.date {
text-align: right;
}

p.main {
text-align: justify;
}

 Text Decoration

With the help of  text-decoration property we can  set or remove decorations from text.

It  is mostly used to remove underlines from links for design purposes:

Example

a {
text-decoration: none;
}

It can also be used to decorate text:

Example

h1 {
text-decoration: overline;
}

h2 {
text-decoration: line-through;
}

h3 {
text-decoration: underline;
}

 Text Transformation

With the help of text-transform property we can specify uppercase and lowercase letters in a text.

It  turn everything into uppercase or lowercase letters, or capitalize the first letter of each word.

Example

p.uppercase {
text-transform: uppercase;
}

p.lowercase {
text-transform: lowercase;
}

p.capitalize {
text-transform: capitalize;
}

Text Indentation

With the help of  text-indent property we can specify the indentation of the first line of a text.

Example

p {
text-indent: 50px;
}

For more details and queries please feel free to email, visit or call us. Wishing you the very best for all your future endeavors.

Helpline: 9814666333, 8699444666

Email:info@technocampus.co.in

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

Please fill the FORM and we shall contact you soon.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s