ComputersProgramming

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.

The first and the 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 comes the "class" and "id" parameters, which determine which class the object belongs to and its identifier, including 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 - with its help you can not set 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.

The first attribute of this tag is "color". As you guessed it, the color is set in it. This parameter can take 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 font headset. For example, you can set it to "Times New Roman" or "Tahoma".

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

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

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

There are also several tags that allow you to specify one particular type of formatting: "b" - bold, "i" - italic, "u" - underscore. All of them have no parameters.

Specify the attributes of the text in HTML - the font size, the headset - is quite inconvenient. Imagine that you need to alternate blocks with different text design. Then to each of the tags you will have to define the same attributes. Much more convenient it can be implemented using CSS-cascading style sheets. For example, to create a picture class called "myclass" with the same design as in 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, "Comic Sans MS" - the headset, and "15pt" - the font size. The color can also be given by the name, and the font - in both pins and pixels (for this you need to write, for example, "20px").

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

Class = "myclass"

In the same way, you can draw any other text. It is enough to set the parameter "class" With the value of the class that you want to use.

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

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

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

Class and identifier are almost the same. In this case, one tag can be declared as either the first or the second:

Class = "myclass" id = "myid"

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

As you can see, it's not difficult to change the font size in HTML. The main thing in programming is practice, so try to train more, and you will succeed!

Similar articles

 

 

 

 

Trending Now

 

 

 

 

Newest

Copyright © 2018 en.delachieve.com. Theme powered by WordPress.