Skip to content

HTML for greens - HTML

Combining parameters

How do you change the appearance of text on a web page?

All of the above parameters (attributes and tags) related to text can be combined. For example, if you input the following in an editor:

<p style="text-align: center"><span style="font-size: large; color: red"><b><i><u>
This is some text

You will get:

This is some text

Notice that you should close the tags in the reverse order in which you opened them. This means you first close the tag that was opened last (in our example, it's <u>), and finally, close the tag that was opened first (in this case, <p>).

Additionally, the values of the style="..." attribute related to the same tag (in our example, it's the <span> tag) can be combined by listing them one after another, separated by semicolons (in our example, the values are: "font-size: large; color: red"). The order of entering both attribute values and tags (opening tags) is arbitrary.

Questions and Answers

How to make text bold and italic in HTML?

To do this, you need to enclose the selected text within both the bold and italic tags simultaneously: <b><i>...</i></b>. It's important to remember that tags must be closed in the reverse order they were opened!

How to change the font size and color in HTML?

To do this, you need to enclose the text within a tag with attributes set to appropriate values. For example: <span style="font-size: large; color: red">...</span> will set a very large font size and a red text color.