Cascading Style Sheets (CSS) is another way for web designers to tell a web browser what a website should look like. HTML already does this, but CSS has more advantages.

With HTML, you usually describe a paragraph with a tag followed by delimiters such as color, size, face, etc. If you need other font changes, it makes sense that it’s not a font tag selector. They will have their mark, eg bold or italic.

Why CSS?

The old way to change the appearance of text in HTML is deprecated. The new way to do this is to use style sheets. Learning CSS (Cascading Style Sheets) is worth the effort. One of the main reasons is consistency – you don’t have to remember all the details of how to set up each line. There is also the readability factor when you look at the raw code. It also saves a lot of work. Instead of having to enter all the font attributes every time you need to change the layout, all you have is a simple ‘span’ or ‘p’ tag. And all it takes to change the appearance of fonts throughout the site is just to change the themes in the cascading style sheet.

Basic definitions of CSS text styles:

The style definition begins with a period (.), followed by the name of the style. Make it descriptive and easy to remember. (Inline tags like H1 tags do not start with a period.)

The definition is surrounded by curly braces { and }, and the individual attributes are separated by semicolons (;).

To set the font family, size, and weight:

.smalltext {“Times New Roman”, Times, serif;

font-size: 10px;

font-weight: normal;

}

You can change the color and make it dark:

.redtext {“Times New Roman”, Times, serif;

font-size: 12px;

font-weight: wide;

Color: #FF0000;

}

You can make it a sans serif font and increase the line spacing:

.spacedtext {

font-size: 12px;

font-weight: wide;

line-height: 150%;

color: #000000;

}

You can make it look like it was written:

.couriertext { “Courier New”, Courier, monospace;

font-size: 14px;

font-style: plain;

line-height: 100%;

font-weight: normal;

}

You can center the text, and align it left or right:

Text alignment: left

Text alignment: true

Text alignment: center

Text alignment: justified

To apply styles to the text, you may start a paragraph with a “p” tag (p class = “normaltext”), for example separating the formatting in the middle of the sentence if you wish with the “span” tag (extension class). = “redtext”), resume normal font use by closing the extension tag. NB. The above tags are surrounded by a greater than () sign, but they cannot be displayed correctly in this article.

CSS overcomes the flawed logic of the original design of the people who created the HTML. In CSS, you can describe the font of a paragraph using something like the following:

s {

Black color;

text alignment: center;

font-size: large;

font-family: Arial;

font-weight: wide;

}

As you can see, we defined the paragraph tag with the letter “p” before “{“, described what the text should look like, then how to handle the font, and closed everything with “}”. This makes more sense because the appearance of what was typed was described by ‘text’ selectors – the text was defined as the word being written and thus its appearance, while the designation and size were controlled by ‘font’ selectors – the font was defined as a complete set of fonts of the same size and style.

Adding Paragraph

Now let’s look at the above. To start writing CSS, we need to tell the web browser what we are selecting. This is usually an HTML tag. The above defines a ‘p’ paragraph tag, but you can also use a ‘span’ span tag or any table tag like ‘td’. Having said what to select, we must open the script dialog. We do this by putting “{.” We can then enter our definitions. HTML is very limited in definitions. You can only select the bold font, size, and color. With CSS, we can determine not only the weight but also the degree of weight. We can define volume in terms of not only pitch but also percentages, pixels, width, height, etc. We can also specify what the text does, such as character spacing or even blinking.

Read also: How to Customize Your WorPress Site With Custom CSS

Conclusion

In addition to its advanced styling features, CSS has other practical purposes. When you write HTML, it takes up space. Of course, a web page will have a file size, right? Well, when people are browsing your site, they download information and that consumes “bandwidth” and some web hosts can restrict that. Not only that but even if you publish your site on your server, you will be concerned about bandwidth as it increases labor costs, in addition to many other issues. CSS helps because it reduces the number of HTML tags that define the same basic design for a single definition. Also, because of this, it reduces the file size of many web pages, which saves bandwidth. Also, web visitors can download a CSS file once to view all pages. Finally, a separate CSS file can be configured to select all web pages on your site. This means that you make one change to one document and the entire website will look different. Now that’s awesome!

Most of the CSS I have explained above was created while I developed the website GSMdaddy.com.