In an earlier post, I mentioned that there was a way that you could modify the appearance of default tags in HTML â€“ like the <H1> headline tag. As a default, this tag is typically displayed in a very large, serif font â€“ which isnâ€™t the most attractive way to put a headline on a page.
To change this, youâ€™ll need to work with CSS â€“ Cascading Style Sheets. This might sound scary, but it really isnâ€™t. A style sheet is just a text file that you link to your HTML file. In the style sheet, you list out the various types of text tags youâ€™re going to use on your website – <H1>, <H2>, <P>, etc. â€“ and then for each type of text tag, you list the style elements youâ€™d like that tag to display. You can set the font face, the color of the text, the weight of the text (bold or normal), the spacing between lines, etc.
And, if you want to have several types of text â€“ for example, paragraphs that are left-justified, and paragraphs that are centered â€“ you can set different classes of paragraph tags for each style of text.
Now, itâ€™s true that you can modify the appearance of your HTML text throughout your HTML document, without creating a CSS file. You can do this using <font face> and <font color> tags. But, then, youâ€™d have to individually specify characteristics throughout all of your code â€“ which is a pain to write, and an even bigger pain to modify later.
Say you code your whole website, and then you decide that instead of black headlines youâ€™d like to spice things up a bit with green headlines. If you code your site with <font color> tags, youâ€™d have to scroll through each and every HTML file on your site to find the headlines and change your colors. With a CSS file, you just open up the file, change the color, and save it â€“ youâ€™re done. CSS makes adjusting your text styles really easy.