Style Text With Css
CSS or Cascading Style Sheets is basically a stylesheet language which is used to describe to describe the presentation of a document or web pages. CSS offers many benefits like quicker download time, improved accessibility and easier site management. You can visit css-faq.com and browse the pages there to gain knowledge about the language.
Styling text with CSS is really simple. We can start with some very basic stuff. We will start by defining the HTML that we will be working with
This is the text
Now we can change the attributes of the text.
• Color your text - select the P tag and add some styles to it.
p {
color: red;
}
This will change the color of the text to red.
We can select the P tag and add some styles to it. You can choose any color code from a set of 16 standard color names. The 16 color names are aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple, red, silver, teal, white and yellow.
• Define the size of your text
p {
font-size:12px;
}
We can define the size of the text in pixals
• Make the text bold or Italic
Use the font-style property to create these effects.
Bold:
p {
font-weight:bold;
}
AND
Italic
p {
font-style:italic;
}
• We can use the text decoration property to create Overline, Underline, strike-through and none effects. The basic syntax is
p {
text-decoration:underline;
text-decoration:line-through;
text-decoration:overline;
text-decoration:none;
}
The text doesn’t have any lines except for the link by default. You can remove the underline by using the decoration text-decoration: none
It is this easy to use a styling sheet to describe the presentation of a document it also has the added advantage the you can do it all in a separate stylesheet!
Tagged with: Cascading Stylesheets Create CSS layout Css CSS help style sheets stylesheet Stylesheets