Default text formatting with CSS

When we load a web page in our browser, the text format that will be used by default will be the one indicated by the browser properties. This will happen as long as the website does not indicate anything about it. That is why we are going to see how we can define the default text format with CSS.

In this way the normal thing will be to establish some text format by default on our page. To do this we will rely on the CSS style sheets.

To define the default text format with CSS the first thing we have to know are the properties CSS that affect formatting. These will be those related to the text and the font. Among them we have the following:

Now we will only have to apply them to the element body
of the page. This will become the default text format for our page.

To do this we insert the style CSS in the header of the page as follows:

body {
 font-family: Arial, sans-serif;
 font-size: 10pt;
 color: #f00;
}

We see that we have used the name of the element HTML in question, i.e.
body
.

What we have to do is give values ​​to the different properties. Now we will only have to insert text into the page, in such a way that all the text will appear with the format specified in the header. And we already have our default text format with CSS .

Leave a Comment