/ / Decoration of a web page and font size in HTML

Decoration of a web page and font size in HTML

Beginning web designers will be useful to know about the ways in which the text of the web page is designed. These include alignment, color, font size and much more.

Several tags are associated with formatting. The most commonly used "p" - paragraph. It has optional parameters that specify the appearance of the text.

font size
The first and main parameter is "align". It defines the alignment of the text and can take the values ​​"left", "right", "center" and "justify" - alignment on the left side, on the right, center and along the entire width of the block, respectively. Note that the position of the text is not set with respect to the screen borders, but within the paragraph.

Next are the "class" and "id" parameters. They determine which class this object and its identifier belong to. This also includes the "style" attribute. - it sets the built-in block style. All these properties are related to CSS, which we will discuss below.

The tag "p" there is one drawback - it can not be usedSpecify the appearance of the font, for example, its color or size. For these purposes, another tag is intended - "font". All its parameters determine how the text will look.

html font size
The first attribute of this tag is "color".As you guessed it, the color is set in it. This parameter can accept both names ("white", "yellow", "magenta"), and values ​​in the RGB system. This is done like this: first put the sign of #, and then specify three numbers in hexadecimal notation from 00 to ff or from 0 to 255 - in decimal - the number of red, green and blue in the final color. For example, to use red color, you need to write "# ff0000", yellow - "# ffff00".

The next attribute is "face". It defines the typeface font. For example, it can be given the value "Times New Roman" or "Tahoma".

And finally, the size parameter in HTML is responsible for the size parameter. It takes a numeric value - size.

For example, to display text in blue and in the "Comic Sans MS" font of the fifteenth point, you need to define the "p" tag with the parameters:

color = "# 6666ff" face = "Comic Sans MS" size = "15"

font size in html
There are also several tags that allow you to specify one specific type of formatting: "b" - bold, "i" - italic, "u" - underline. All of them have no parameters.

Set text attributes in HTML - font size,Headset - quite uncomfortable. Imagine that you need to alternate blocks with different types of text. Then for each of the tags you will have to define the same attributes. Much more conveniently, this can be implemented using CSS – cascading style sheets. For example, to create a class of pictures called "myclass" with a design like the previous example, add the following line to the "style" tag:

#myclass {font: rgb (102,102,255) "Comic Sans MS" 15pt;}

Here "rgb (102,102,255)" sets the color, "ComicSans MS "- a headset, and" 15pt "- the font size. Color can also be set by name, and the font - both in pins and pixels (for this you need to write, for example," 20px ").

To use this design you need to write in the tag "p":

class = "myclass"

In the same way you can arrange any other text. It is enough to set the parameter "class" with the value of the class you want to use.

And to create an identifier with the name "myid", you need to write in the "style":

#myid {font: rgb (102,102,255) "Comic Sans MS" 15pt;},

and in the tag "p" set the attribute "id" with the value "myid".

Class and ID are almost the same. In this case, one tag can have both the first and second tags declared:

class = "myclass" id = "myid"

There are two ways to change the appearanceText - HTML and CSS. If you need to make one or two blocks, use HTML. And for a large number of paragraphs with the same formatting, CSS is more convenient.

As you can see, changing the font size in HTML is a snap. The main thing in programming is practice, so try to train more, and you will succeed!