How to set up smartphones and PCs. Informational portal
  • home
  • Iron
  • General structure of tags. Semantic structure for HTML5 page

General structure of tags. Semantic structure for HTML5 page

Tags

Browser commands that tell you how to display text, insert tables, images, and other objects are called tags (from Englishtag - label, sign). The tags (commands) themselves are not displayed on the screen.

The tag name is written in triangle brackets, for example, - a tag that tells the browser to write all subsequent text in bold. The tag name can be written in any case (uppercase or lowercase), that is will be perceived by the browser in the same way as .

Tags are paired and unpaired... For example, the tag tells the browser to write in bold all subsequent text before the command... In this case, the tag giving the command is called opening, and the tag that cancels the command, covering.

Tags can have parameters(or attributes). For example, to set the color of a font, use the font tag with the color parameter: - this is the opening tag that tells the browser from now on to display the font in green (in this example) color up to the closing tag.

Some parameters require mandatory indication of their values. For some parameters, the browser uses default values ​​if no other values ​​are specified.

If the tag has several parameters, then they are written separated by a space in any order. For instance: - two similar entries for the opening font tag with the color and size parameters.

Structure of HTML pages

Any html page must contain the following required tags:

    html- informs the browser that the page is written in HTML and the lines before the closing tag are a single document;

    head- important information describing this document is placed between the opening and closing tags;

    body- the content of the page itself is placed between the opening and closing tags.

Thus, the HTML document has the following structure:

Description of the document (not displayed on the page itself)

Content (displayed on the page with the given markup)

The section itself is optional and serves to place the description of the document. If present, only the required tag is TITLE, the content of which specifies the title of the document, usually shown in the header of the browser window.

For example, such a line 1_HTML will set the document name "1_HTML", which in Mozilla Firefox will be reflected in the window title and on bookmarks (when several pages are open):

2. Formatting text

    Fonts: typeface, size, color

    Text formatting

    Headings

    Line break and paragraph formatting tags

    Text alignment

    The exercise

Fonts: typeface, size, color

Using HTML markup, you can write text in different styles (typefaces), sizes and colors. To do this, use the tag with several parameters:

    face- to set the headset,

    size- to set the size,

    color- to set the color.

To set the desired font, size or color, you must assign the required value to the corresponding parameter:

parameter = "value"

Headset

For example, to write text in font Times New Roman, you must insert a tag before the desired text and assign it to the parameter face meaning Times New Roman, and since tag - paired, then after the required text, be sure to insert a closing tag:

Times New Roman text

Times New Roman text

The face parameter can be assigned several values ​​separated by commas:

face = "Times New Roman, Times, serif"

In this case, the browser will first try to display the text in font Times New Roman... If such a font is not available on the user's computer, the browser will try to display the text in the font Times etc.

The size

To write text with a size of 4, you need to insert a tag in front of the desired text and set its size parameter to 4:

Size 4 text

As a result, the browser will display this line like this:

Size 4 text

What does this mysterious number 4 mean? Parameter size can take values ​​from 1 before 7 ... These are conventional units. The default average size is size = "3".

Therefore, text size 4 is the average size increased by 1 conventional unit, and size 2 is the average size reduced by 1 conventional unit, etc. The amount of text given in this way is called absolute.

But there is another way to reduce or increase the size of the text relative to the default size. To do this, you need to assign the parameter size meaning "-1" or "+1" respectively. With this method of setting the size, the size of the text is called relative.

So, to get a text size of 5, you can use two methods:

Size 5 text or Size 5 text

In addition to the above, there are several other ways to set the size of the text.

You can enlarge the text using the tag :

Enlarged text

As a result, the browser will display this line like this:

Enlarged text

You can reduce the text using the tag :

Reduced text

As a result, the browser will display this line like this:

Reduced text

Tags and can be repeated several times to enhance the effect. For example, if as a result of the line:

Large text

the text is not large enough:

Large text

can be written like this:

Large text

This will result in larger text:

Large text

Color

Now about setting the color of the text. To write text in red, you need to insert a tag in front of the desired text and assign it to the parameter color meaning red:

Red text

As a result, the browser will display this line like this:

Red text

But the color can be set not only by the name, but also by the digital value in hexadecimal format, which looks like a sign # and 6 characters (numbers 0-9 and letters of the Latin alphabet A-F) after him. For example, red is a hexadecimal value # FF0000... Those. you can write text in red in two ways:

Red text or Red text

Here you can download a color chart, which shows the primary colors, their names and their corresponding hexadecimal values.

If you open any web page, it will contain typical elements that do not change depending on the type and focus of the site. Example 4.1 shows the code for a simple document containing basic tags.

Example 4.1. Source code of the web page

Sample web page

Heading

First paragraph.

Second paragraph.

Copy the contents of this example and save it in the c: \ www \ folder as example41.html. After that, launch the browser and open the file through the menu item File> Open File (Ctrl + O)... In the Select Document dialog box, specify the file example41.html. The web page shown in Figure 4 will open in your browser. 4.1.

Rice. 4.1. Example execution result

Elementis intended to indicate the type of the current document - DTD (document type definition, document type description). This is necessary for the browser to understand how to interpret the current web page, because HTML exists in several versions, and there is also XHTML (EXtensible HyperText Markup Language), which is similar to HTML, but differs from it in syntax. So that the browser does not "get confused" and understands according to what standard to display the web page and it is necessary to set in the first line of code .

There are several types, they differ depending on the version of HTML they are targeting. Table 4.1. lists the main types of documents with their descriptions.

Tab. 4.1. Valid DTDs
DOCTYPE Description
HTML 4.01
Strict HTML syntax.
Transitional HTML syntax.
Frames are used in the HTML document.
HTML 5
There is only one doctype in this version of HTML.
XHTML 1.0
Strong XHTML syntax.
Transitional XHTML syntax.
The document is written in XHTML and contains frames.
XHTML 1.1
The developers of XHTML 1.1 anticipate it will gradually replace HTML. As you can see, this definition has no division into types, since the syntax is the same and obeys clear rules.

The difference between strict and transient document descriptions is the different approach to writing document code. Strict HTML requires strict adherence to the HTML specification and is unforgiving. Transitional HTML is more "relaxed" about some flaws in the code, so this type is preferable in certain cases.

For example, in strict HTML and XHTML, the tag it can be omitted or omitted in transitional HTML. At the same time, remember that the browser will display the document in any case, regardless of whether it matches the syntax or not. Such verification is carried out using a validator and is intended primarily for developers to track errors in the document.</p> <p>In what follows, we will mainly use the strict<!DOCTYPE>, unless otherwise specified. This will allow us to avoid common mistakes and teach us to write syntactically correct code.</p> <p>It is often possible to find HTML code without using at all<!DOCTYPE>, the web page will still be shown in such a case. However, it can happen that the same document is displayed differently in the browser when using<!DOCTYPE>and without it. In addition, browsers can display such documents in their own way; as a result, the page will "crumble", i.e. will be displayed in a completely different way than the developer wants it to be. To avoid situations like this, always add<!DOCTYPE>to the beginning of the document.</p><p>Tag <html>defines the beginning of the HTML file, inside it is the header ( <head>) and document body ( <body> ).</p><p>Document title, as the block is also called <head>, can contain text and tags, but the content of this section is not shown directly on the page, except for the container <title> .</p><p> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </p><p>Tag <meta>is universal and adds a whole class of capabilities, in particular, using meta tags, as this tag is generically called, you can change the page encoding, add keywords, document description and much more. So that the browser understands that it is dealing with the UTF-8 encoding (Unicode transformation format), this string is added.</p><p> <title>Sample web page

Tag defines the title of the web page, this is one of the important elements designed to solve many problems. In the Windows operating system, the title text is displayed in the upper left corner of the browser window (Fig. 4.2).</p> <p><img src='https://i0.wp.com/htmlbook.ru/files/images/samhtml/fig_1_04_02.png' height="37" width="194" loading=lazy loading=lazy></p> <p>Rice. 4.2. Browser header view</p> <p>Tag <title>is required and must be present in the document code.</p><p>Be sure to add a closing tag</head> to indicate that the document's title block is complete.</p><p>Body of the document <body>is intended to accommodate tags and content of the web page.</p><p> <h1>Heading</h1> </p><p>HTML offers six different levels of text headings that indicate the relative importance of the section after the heading. So, the tag <h1>represents the most important first-level heading, and the tag <h6>serves to denote a sixth level heading and is least significant. By default, the first level heading is displayed in the largest bold type, the headings of the next level are smaller in size. Tags <h1>...<h6>are block elements, they always start on a new line, and after them other elements are displayed on the next line. In addition, white space is added before and after the title.</p><p> <!-- Комментарий --> </p><p>Some text can be hidden from display in the browser by making it a comment. Although the user will not see such text, it will still be transmitted in the document, so by looking at the source code, you can find hidden notes.</p> <p>If you open any web page, it will contain typical elements that do not change depending on the type and focus of the site. Example 1 shows the code for a simple document containing the basic elements.</p><p>Example 1. Source code of a web page</p><p> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Sample web page

Heading

First paragraph.

Second paragraph.

Copy the contents of this example and save it in the c: \ www \ folder as example2.html. After that, launch the browser and open the file through the menu item File> Open File(Ctrl + O). In the dialog box for selecting a document, specify the file example2.html. The web page shown in Figure 4 will open in your browser. one.

Rice. 1. The result of the example in the browser

Element(jarg. doctype) is intended to indicate the type of the current document - DTD (document type definition). This is necessary for the browser to understand how to interpret the current web page, since HTML exists in several versions - modern HTML5 or legacy HTML4 and XHTML. So that the browser does not "get confused" and understands according to what standard to display the web page and it is necessary to set in the first line of code.

Since in the future we will only work with HTML5, we only need one short and modern doctype.

We mentioned that element names can be written in uppercase and lowercase letters. TOthis rule also applies and can be written in different ways. However, traditionally, the name of this element is written in uppercase.

Opening tag defines the beginning of an HTML document, inside it is the "head" ( ) and the "body" of the document ( ).

The content of this section is not shown directly on the page, except for the element ... Inside <head>the following elements can be located: <base> , <link> , <meta> , <script> , <style>or <title> .</p><p> <meta charset="utf-8"> </p><p>Element <meta>is universal and adds a whole class of capabilities, in particular, using the meta tag, as this element is generically called, you can change the page encoding, add keywords, document descriptions and much more, intended for the browser or search engines. In particular, so that the browser understands that it is dealing with the UTF-8 (Unicode transformation format) encoding and this string is added.</p><p> <title>Sample web page

Element defines the title of the web page. In the browser, it is displayed on the current tab (Fig. 2).</p><p><img src='https://i1.wp.com/webref.ru/assets/images/html-tutorial/title.png' height="62" width="367" loading=lazy loading=lazy></p><p>Rice. 2. The title of web pages in the browser</p><p>Element <title>is required and must be present in the document code. Inside it is allowed to write only text and no other elements in <title>shouldn't be. But it is permissible to add different text characters, for example, like this: <span><title>Adobe ™ Photoshop® .

End tag indicates that the head of the document is complete.

The "body" of the document is intended to accommodate the elements and content of a web page.

Heading

HTML offers six different levels of text headings that indicate the relative importance of the section after the heading. So, element

represents the most important first-level heading, and the element

serves to denote a sixth level heading and is least significant. By default, the first level heading is displayed in the largest bold type, the headings of the next level are smaller in size. The elements

...

are block elements, they always start on a new line, and after them other elements are displayed on the next line. In addition, the browser adds white space before and after the title.

Some text can be hidden from display in the browser by making it a comment. Although the user will not see such text, it will still be transmitted in the document, so by looking at its source code, you can find hidden notes.

Where possible, clarify your code where necessary.

Use comments to clarify your code: what it does, what it is responsible for, and why the chosen solution is being used.

(This point is optional, because there is no point in expecting that the code will always be well documented. The usefulness of commenting depends on the complexity of the project and may differ for HTML and CSS code.)

Tasks

Mark tasks for your to-do list with TODO .

Mark tasks with a keyword TODO... do not use other commonly used formats such as @@ .

Enclose contacts (username or mailing list) in parentheses: TODO (contact) .

Describe the task after the colon, for example: TODO: Challenge .

Recommended:(# TODO (Ivan Ivanov): Deal with centering #)

Test

Recommended:
  • Cucumbers
  • Tomatoes

HTML formatting rules

Document type

Use HTML5.

(Recommended to use HTML with content type text / html... Don't use XHTML, as application / xhtml + xml is less supported by browsers and limits optimization.)

HTML validity

Use valid HTML whenever possible.

Use valid HTML unless the usage does not reach the required file size for the desired performance level.

W3C HTML validator (English) to check the validity of the code.

Validity is an important yet measurable quality of code. Writing valid HTML helps you learn about technical requirements and constraints, and ensures that HTML is used correctly.

Not recommended: Examination

Just checking
Recommended: Examination
Just a check.

Semantics

Use HTML as intended.

Use elements (sometimes incorrectly called “tags”) for their intended purpose: headers for headers, p for paragraphs, a for links, etc.

This makes the code easier to read, edit, and maintain.

Alternative for multimedia

Always include alternate media content.

Try to specify alternate content for your media, such as pictures, videos, or animations defined with canvas... For pictures, this is meaningful alternative text ( alt), and for video and audio decryption of text and signatures if possible.

Alternative content can help people with disabilities. For example, it is difficult for a visually impaired person to understand what is in the picture if it is not specified @alt... It can be difficult for other people to understand what a video or audio recording is talking about.

(If for the picture alt redundant, or used for decorative purposes only in places where CSS cannot be used, use empty alt text alt = "" )

Separation of responsibility

Separate structure, layout, and behavior.

Keep structure (markup), layout (styles), and behavior (scripts) separate, and try to keep interactions between them to a minimum.

Make sure that documents and templates contain only HTML, and that HTML serves only to define the structure of the document. Move all the code responsible for the design into the style files, and the code responsible for the behavior into the scripts.

Try to keep their overlaps to a minimum by including as few styles and scripts as possible in your templates.

Separating structure from presentation and behavior helps make your code easier to maintain. Changing templates and HTML documents always takes longer than changing style files or scripts.

Not recommended: HTML sucks

HTML Sucks

I've read about this somewhere before, but now everything is clear for sure: HTML is bullshit !! 1

I can't believe that in order to change the design, you have to redo everything every time.

Recommended: My first CSS-only redesign

My new CSS design

I've read about this before, but finally did it myself: I use the principle of separation of concerns and do not shove the design in HTML

So cool!

Mnemonic links

Don't use mnemonic links.

The only exception to this rule is HTML service characters (for example < and & ) as well as auxiliary and "invisible" characters (for example, non-breaking space).

Optional tags

Don't use optional tags. (not necessary)

Optional tags can be omitted to reduce file size and improve code readability. The HTML5 spec has a list of optional tags.

(It may take a while for this approach to become ubiquitous because it is very different from what web developers are usually taught. In terms of consistency, and the simplicity of the code, it is best to omit all optional tags rather than some of the them).

Not recommended: Spending bytes - spending money.
Recommended: Money bytes!

So that

"Type" attribute

Don't specify an attribute type when connecting styles and scripts to a document.

Don't use the attribute type when connecting styles (except for options when something other than CSS is used) and scripts (except for options when it is not JavaScript).

Specify Attribute type not necessary in this case because HTML5 uses text / css and text / javascript by default. This will work even in older browsers.

Not recommended:
Recommended:
Not recommended:
Recommended:

HTML formatting rules

Formatting

Allocate a new line for each block, table, or list element and indent each child element.

Regardless of the styles specified for the element (CSS allows you to change the behavior of an element using the property display), wrap each block or table element on a new line.

Also, indent all elements nested within a block or table element.

(If you are having trouble with whitespace between list items, you can put all li elements on one line. Lintu [utility for checking the quality of the code approx. per.] it is recommended in this case to issue a warning instead of an error.


Recommended:
  • Masha
  • Glasha
  • Cheburash

Recommended:
Profit Tax
$ 5.00 $ 4.50

CSS styling rules

CSS validity

Use valid CSS whenever possible.

Unless you need browser-dependent code or validator errors, use valid CSS.

Use tools like the W3C CSS Validator to validate your code.

Validity is an important yet measurable quality of code. Writing valid CSS helps you get rid of redundant code and ensures that your stylesheets are used correctly ...

Class identifiers and names

Use generic or meaningful class names and identifiers.

Instead of using ciphers, or describing the appearance of an element, try expressing the meaning of its creation in the name of the class or identifier, or give it a template name ...

Template names are simply a variation on the name for elements that have no special purpose or are indistinguishable from their siblings. They are usually needed as "Helpers."

The use of functional or template names reduces the need for unnecessary changes to the document or templates.

Not recommended: / * Not recommended: does not make sense * / # yee-1901 () / * Not recommended: description of appearance * / .button-green () .clear ()
Recommended:/ * Recommended: accurate and to the point * / #gallery () #login () .video () / * Recommended: wildcard name * / .aux () .alt ()

Names of identifiers and classes

For identifiers and classes, use names as long as necessary, but as short as possible.

Try to articulate exactly what a given element should do, while being as short as possible.

This use of classes and identifiers contributes to making the code easier to understand and more efficient.

Type selectors

Avoid using class names or identifiers with element type (tag) selectors.

Unless necessary (for example, with helper classes), do not use element names with class names or identifiers.

Abbreviated property notation

Use shorthand property forms where possible.

CSS offers many different shorthand (English) notation forms (for example font), which are recommended to be used wherever possible, even if only one of the values ​​is specified.

Using property shorthand is useful for efficiency and better understanding of your code.

Not recommended: / * Not recommended * / border-top-style: none; font-family: palatino, georgia, serif; font-size: 100%; line-height: 1.6; padding-bottom: 2em; padding-left: 1em; padding-right: 1em; padding-top: 0;
Recommended:/ * Recommended * / border-top: 0; font: 100% / 1.6 palatino, georgia, serif; padding: 0 1em 2em;

0 and units

Do not specify units for zero values

Do not specify units for zero values ​​unless there is a reason to do so.

Integer 0

Do not put “0” in the whole part of fractional numbers.

Do not put it 0 in the integer part in values ​​between -1 and 1.

Quotes in links

Don't use quotes in links

Don't use quotes ( "" , "" ) With url () .

Hexadecimal color names

Use 3-character hexadecimal notation where possible.

The 3-character hexadecimal notation for colors is shorter and takes up less space.

Prefixes

Prefix selectors with prefixes unique to the current application. (not necessary)

In large projects, as well as in code that will be used for other projects or other sites, use prefixes (as namespaces) for identifiers and class names. Use short, unique names followed by a hyphen.

Using namespaces helps prevent name conflicts and can make your site easier to maintain. For example, when searching and replacing.

Separators in classes and identifiers

Separate words in identifiers and class names with hyphens.

Do not use anything other than a hyphen to combine words and abbreviations in selectors to improve readability and ease of understanding of your code.

Not recommended: / * Not recommended: words “demo” and “image” are not separated * / .demoimage () / * Not recommended: use underscore instead of hyphen * / .error_status ()
Recommended:/ * Recommended * / # video-id () .ads-sample ()

Khaki

Avoid using browser version information, or CSS hacks - try other methods first.

It seems tempting to fight the differences in how different browsers work with CSS filters, hacks, or other workarounds. All of these approaches can only be considered as a last resort if you want an efficient and easily maintainable codebase. Simply put, allowing hacks and browser definitions will hurt the project in the long run, as it means the project is on the path of least resistance. This makes hacks easier to use and allows them to be used more and more often, which will result in them being used too often.

CSS formatting rules

Ordering ads

Sort ads alphabetically.

Set your ads alphabetically for consistent code that's easy to work with.

Ignore browser prefixes when sorting. Moreover, if several browser prefixes are used for one property, they must also be sorted (for example -moz should be in front of --webkit )

Block indents.

Always indent the content of the blocks.

Always indent any blocky content, such as rules within rules or declarations, to show the hierarchy and make the code easier to understand.

After the announcements

Use a semicolon after each ad.

Use a semicolon after each declaration for consistency in your code and to make it easier to add new properties.

After property names

Use spaces after colons in your declarations.

Always use one space after the colon (but not before) in declarations for ordering in your code.

Selector and announcement separation

Separate selectors and declarations with line breaks.

Start each selector or declaration on a new line.

Separation of rules

Separate the rules with line breaks.

Always put line breaks between rules.

Meta CSS rules

Grouping rules

Group rules and mark groups with a comment. (not necessary)

Organize rules into groups whenever possible. Mark groups with comments and separate with line breaks.

Conclusion

Be consistent

If you are editing code, take a few minutes to understand how it is written. If math operators are separated by spaces, do the same. If the comments are surrounded by parentheses or dashes, do the same with your comments.

The idea behind this tutorial is to create a common vocabulary that allows developers to focus on what they want to express, not on that how.

We offer uniform design rules that allow you to write code in the same style, but the style of the code already used in the project is also important.

If your code is very different from the existing one, it can throw the reader out of rhythm and make it difficult to read. Try to avoid this.

Note from the translator

I would also like to note that Google focuses primarily on large, high-load projects, where every byte is expensive, so it should be borne in mind that if they recommend starting each selector on a new line, or using spaces instead of tabs, this primarily implies that the code will be necessarily minified and compressed before being used on the site.

Thanks to everyone who has read this far.

Tags: Add Tags

  • 1. HTML documents are structured documents.
  • 2. The names of the elements can be written in any case.
  • 3. Attribute names can be written in any case.
  • 4. The values ​​of the attributes are case-sensitive, especially the address (a feature of Unix-operating systems consists in different interpretations of characters in different registers, therefore files

picture .gif and picture.GIF are different!).

  • 5. Element names cannot contain spaces.
  • 6. If attribute values ​​contain spaces, they must be quoted.
  • 7. Extra spaces, tabs and carriage returns are ignored and compressed into a single space.
  • 8. Elements can be nested within each other. In this case, the nesting rule must be observed. Inside the nested element, in addition to the opening tag, there must also be a closing tag. The intersections are incorrect:

HTML document structure

9. Unfamiliar elements and attributes are ignored by browsers ("condescension to errors").

Most documents have standard elements such as headings, paragraphs, or lists. Using HTML tags, you can denote these elements, providing web browsers with minimal information to display these elements, while maintaining the overall structure and information completeness of documents. All it takes to read an HTML document is a web browser, which interprets the HTML tags and renders the document on the screen as the author gives it.

When the web browser receives a document, it determines how the document should be interpreted. The very first tag that appears in the document must be a tag ... This tag tells the web browser that the document is written using HTML.

HTML comments. Like any language, HTML allows you to insert comments into the body of a document that are preserved across the network but not displayed by the browser. Often in the comment, some tags or entire syntax constructions are hidden from older versions of browsers that are not able to process them. Comments can appear anywhere in the document and in any quantity. It should be remembered that comments increase the size of the document and, consequently, the load time.

General heading part of the document. The heading tag of the document must be used immediately after the tag and nowhere else in the body of the document. This tag is a general description of the document. Start tag placed immediately before the tag and other tags describing the document, and the end tag</head> placed immediately after the end of the document description.</p> <p><b>Document title.</b> Most web browsers display the content of the tag <TITLE>in the title of the window containing the document and in the bookmark file, if supported by the web browser. Tag-delimited title <TITLE>and, placed inside tags ... The document title does not appear when the document itself is displayed in the window.

Document body tags. Document body tags identify the components of an HTML document that are displayed in the window. The body of a document can contain links to other documents, text, and other formatted information.

The body of the document. The body of the document must be between tags and... This is the part of the document that is displayed as text and graphic (semantic) information in your document.

Heading levels<Нх>. The first level of headings (the largest) is indicated by the number 1, the next - 2, and so on until the number 6. Most browsers support the interpretation of six levels of headings, defining each of them its own style. For most cases, the text of such a heading will become bold, and an empty line will be struck after the text. It is important that these tags define the logical structure of the document and participate in indexing by Internet search engines. Headings above level six are non-standard and may not be supported by the browser.

Paragraph tag<Р>... V Unlike most word processors, HTML documents ignore carriage returns. Browser splits paragraphs only if tag is present<Р>... If you do not separate paragraphs with a tag<Р>, then the document will appear as one large paragraph.

Preformatted text tag

.
 Tag 
Allows the presentation of text with specific formatting on the screen.  Preformatted text ends with a trailing tag
... Within preformatted text, it is allowed to use: line feed, tabs (shift eight characters to the right), disproportionate Courier font set by the browser.

List tags. There are three main types of lists in an HTML document: numbered, bulleted, and descriptive lists.

You can create nested lists by using different list tags or by repeating one within the other. To do this, you just need to place one pair of tags (start and end) inside another. Whether nested list items have the same bullet points to denote a list item is browser dependent.

Numbered lists. V In a numbered list, the browser automatically inserts the item numbers in order. This means that if you delete one or more elements of a numbered list, then the rest of the numbers will be automatically recalculated.

    and ends with the tag
  • .

    Bulleted lists. For bulleted lists the browser usually uses bullets for the list item. The type of marker is usually customized by the browser user.

    A numbered list begins with a start tag

      and ends with the tag
    ... Each list item starts with a tag<ы>.

    Font formatting. HTML allows two approaches to font selection of text fragments. On the one hand, you can directly indicate that the font in a certain area of ​​the text should be bold or italic, i.e. change the physical style of the text. On the other hand, you can mark some piece of text as having some logical style other than normal, leaving the interpretation of that style to the browser.

    Graphics within an HTML document. One of the most attractive features of the WEB is the ability to include graphical and other types of data in an HTML document.

    There are two ways to use graphics in HTML documents. The first is the embedding of images into a document, which allows the user to see images directly in the context of other elements of the document. This is done using the tag ... This tag is dotted, i.e. it doesn't close. Tag syntax:

    A required parameter has the same syntax as a standard URL. This URL tells the browser where the

    drawing. The drawing must be stored in a graphical format supported by the browser. Today these are GIF, JPG, PNG formats. They are supported by most browsers.

    ALT = "text"

    This optional element specifies the text that will be displayed by a browser that does not support displaying graphics or with disabled image graphics. This is usually a short description of the image that the user might or will be able to see on the screen. If this parameter is absent, then most browsers display an empty border in place of the picture. Tag Recommended if users are using a browser that does not support graphics mode, such as Lynx, and for indexing by search engines. The text is also visible when holding the mouse cursor for some time without moving over the image in the form of a system tooltip under the cursor.

    Most browsers allow you to include a background image in your document, which will duplicate like a bathroom tile and appear in the background of the entire document. This is the second way. Some users like background graphics, some don't. An unobtrusive translucent drawing (wallpaper) usually looks good as a background for most documents.

    Hypertext links are a key component that makes the WEB attractive to users. By adding hypertext links (hereinafter referred to as links), the user makes the set of documents connected and structured, which allows him to receive the information he needs as quickly and conveniently as possible.

    Links have a standard format that allows the browser to interpret them and perform the necessary functions (call methods) depending on the type of the link. Links can point to another document, a specific location within that document, or perform other functions such as requesting a file. As a hyperlink, you can specify text or an image, or both.

    The structure of links in an HTML document. In order for the browser to display the link to the URL, you need to place the text or picture inside the hyperlink tag. The HTML syntax is as follows:

    <А HREF="URL">text-or-picture-to-be-highlighted-as-a-link

    Tag<А HREF="URL">opens the link description, and the tag- closes it. Any text between these two tags is highlighted in a special way by the web browser. Typically, this text appears underlined and highlighted. The image is framed by a rectangular frame. The text that denotes the URL is not displayed by the browser, but is only used to perform its intended actions when the link is activated (usually when the mouse is clicked on the highlighted or underlined text).

    Links to labels within the document. You can make links to different sections or sections of the same document using special hidden labels for these sections. This allows you to quickly jump from section to section within a document without scrolling the screen. As soon as the user clicks on the link, the browser will move it to the specified section of the document, and the line containing the label for this section will be placed on the first line of the browser window (if the document's "length" in the browser window is enough).

  • Top related articles