Many languages have been invented, but the HTML languagebelongs to a number of special and most demanded. Many other key initiatives in programming are associated with it. Much becomes available when the knowledge of the markup language is present in the developer's mind - HyperText Markup Language (HTML).
In essence, in HTML there is nothing complicated, and througha few minutes anyone, the most distant from programming and the Internet person, will create an HTML page in a notebook. An example that deserves attention is simplicity, which is really accessible to everyone.
The HTML file is one page of the site, although this can be argued, but the fact that one file is one page is understandable for a start.
The HTML file starts with the DOCTYPE header, in thewhich indicates that the type of this file is HTML. All elements of the page (tags) are indicated in angle brackets. Each pair ("<" and ">") includes one HTML tag. Typically, HTML tags are paired, that is, there are "/ tag" for each "tag". Both are enclosed in angle brackets. There are single tags, of which the most popular "br /" is the transition to the next line.
Simple HTML page
An example of creating such a page is listed below in the article. Consider it carefully.
The main purpose of the HEAD tag is a general description of the page and common scripts, although the latter is a relatively relative concept. Usually, only two things are important here:
- keywords and description of the page;
- links to other files (* .css and * .js).
To display page content, the content of this section has only an indirect meaning, because it indicates: somewhere in other files there are CSS rules for tags and scripts of other languages.
The HTML page has a title (TITLE) thatIt is displayed when the visitor brings the mouse to the tab where the page is open. This is an important point, because it makes the page significantly more presentable, easier to say, signed with readable text.
META tags are important in Internet programming in general, but when you want to create an HTML page in a notebook, the example is undesirable to clutter with redundant constructs.
If the scripts should be approached, when knowledgeHTML will be strengthened, then cascading style sheets should be paid attention immediately. In the CSS files are, in particular, the rules for the design of HTML tags.
HTML is a tag, not a script. Ultimately, the browser displays only the content of the page, only its tags. There is no PHP code there.
A simple example of the HTML page code (only the BODY section) is listed below.
And in the visitor's browser, it looks like the one shown below.
The code did not specify how to look likeelements that the browser displayed. All visible design is in CSS rules. In this case, in the file Mcss / scPhpWordRW.css, which was referenced (see the very first example of an HTML page).
Unlike HTML, the CSS theme is simpler, therevery affordable rules and their number is small, when an example of creating an HTML page does not require anything other than notepad. Everything is very accessible for instant mastering:
This shows how a tag is simply describedscLogo_vDoc, and this description is such that in normal state the tag displays the image vDoc-logo.png, and when the mouse is above it, vDoc-logo-h.png is displayed.
HTML Description Structure
Language does not imply any structure andthe concept of syntax is very relative. There are no variables, but there are a lot of possibilities. The basic basis of hypertext is that there is an element (tag) that necessarily has a name.
The name, in the case of a pair tag, is composed of the proper name (tagName) and angle brackets ("<" + tagName + ">"), if it is the beginning of the tag, and "</" + tagName + ">" if its end.
An example of an HTML page describing the attributes is located below in the text.
A tag can have attributes, then they are placedthrough a space after the tag name to the closing angle bracket ">". Attributes, if they have a tag, are written only at the beginning of the tag. The content of the tag is what is between the beginning of the tag and its end.
The general content of the HTML descriptions
HTML allows you to describe block and lowercaseelements. The first occupy a certain area in the browser window, can be positioned absolutely, that is, in the right place in the display area of the HTML page, and have a specific size.
In addition to simple elements, HTML offers the description of tables and forms. These elements are very much in demand in "everyday site building".
Description of the table: tags TABLE, TR, TD
Using the TABLE tag, you can create a table,indicate a certain number of rows TR and in each row some number of TD cells. Unlike the usual tabular organization, due to the peculiarities of HTML markup, the spreadsheet organization is limited to this declaration, so if the developer wants to have a rectangular table in which the number of columns in all rows is the same, then he must follow it himself.
The basic position of HTML: do everything that is indicated, but nothing that is not understood. In some cases, the number of columns in each row of the table is not so important, but if you need to combine cells vertically or horizontally, you will have to count everything very carefully.
An example of an HTML page describing a simple table is clearly shown in the article.
Here is a table in the size of three rows per threecolumns, and in the first row, instead of the TD tag, the TH tag was used - the column header. There are no special differences between these two tags, but you can use the first one to distinguish the first row of the table, and in CSS to TH you can attach your own style, which distinguishes it from other TDs.
Form description: FORM, INPUT tags
Forms are the most requested part of HTML tags. Using forms, you can transfer information. Actually, the page itself is the output of information, but the form is its input.
Example of an HTML page with a simple form description:
The use of forms is much greater, butthe main possibilities are as follows. You can specify the input fields, assign them the design and handlers to analyze the user input. You can specify hidden fields and send background information from the page. You can designate the buttons for transferring information, clicking on which initiates the transfer of information.
The PHP language was denoted in the previous example. PHP runs on the server, because the page with this form has flown from the server to the browser with the filled fields. In particular, the function TestOnBlur, mentioned in the INPUT tag (onblur event handler), received all parameters in the form of text fields.
This is quite enough to quickly improve their qualifications for any specialization in the field of Internet programming.</ p>