html text

HTML

HTML Text

.

Text. Webpages and blogs are full of text. In the past text color, size and type of text (ie: Times New Roman) where defined in the font tag. However, the advent of cascading style sheets has made the font tag obsolete or as it is commonly referred to "depreciated".

We will start with examples of how to use CSS font attributes in a webpage so that you get an idea of how these attributes work. As time goes on more HTML tags will be depreciated so it is a good idea to learn all about Cascading Style Sheets.

First we will start with controling the size of your text. We will need to use the Style attribute in CSS.

This HTML Code Produces This
<p style="font-size: 120%;">Hello There</p">

Hello There

The paragraph tag <p> contains an attribute called style. This attribute can then contain CSS commands like font-size which you can use to make text larger or smaller.

CSS has to basic items in it displayed like this -

Property: value;

Our Property is font-size: our value; is 120%;

The Property is separated from the value by a colon, and a semi-colon is used to indicate that the css property is complete.

We can also change the color of our font by using the color attribute like this.

This HTML Code Produces This
<p style="font-size: 120%; color: green; ">Hello There</p">

Hello There

.

Home | About | Contact Us | Sitemap

HTML tables