The Internet is a worldwide network that connects computer networks around the world on the basis of uniform standard agreements (protocols) on methods of information exchange and a unified addressing system.
To date, the Internet has gained unprecedented popularity. According to experts, the Internet connects more than 100 million computers. More than 300 million people in 170 countries use Internet services.
From a functional point of view, the Internet is:
ü an inexpensive, fast means of communication between subscribers around the world;
ü an unparalleled repository of information on any field of knowledge;
ü a new promising environment for activity.
The influence of the Internet extends not only to the technological field of computer communications, it also has a social dimension and permeates the entire society as operational means gaining knowledge, e-commerce.
The most common and popular Internet service today is WWW (World Wide Web). Information on the WWW is presented in the form of so-called hypertext (or, more broadly, hypermedia) documents, which can contain formatted text, graphics, audio and video fragments. The main feature of hypertext documents is the presence of active zones that are sensitive to a mouse click. Fragments of text can be active , whole images and their parts; clicking on the active zone causes the download of the (target) document associated with this zone.
To learn how to post materials on the Internet, you first need to become familiar with the hypertext markup language HTML (H yperT ext M arkup L anguage)
HTML BasicsHypertext Markup Language HTML documents is a set of commands called tags (from English tag). HTML tags found in the text of a document are interpreted by the browser when displaying the document.
Viewing HTML documents is carried out using programs - browsers(from English browser), which display the document according to HTML markup and provide hyperlink navigation. The most common browsers are Microsoft Internet Explorer from Microsoft Corporation and Netscape Navigator from Netscape Communications Corporation.
Since an HTML document is text file, it can be prepared in the simplest text editor, for example, in notepad ( Notepad), but it is very labor-intensive. More often they use specialized editors designed specifically for preparing HTML documents, which allow you to insert tags using toolbar buttons or menu commands, and set tag attributes in dialog boxes, for example, Macromedia Dreamweaver, Microsoft FrontPage, HomeSite, etc.
An HTML document can be obtained by converting to an HTML format, for example from a package document format Microsoft Office. It should be noted that with such a transformation, the source text of the HTML document turns out to be extremely redundant and needs correction. It is much more efficient to use special HTML editors.
HTML Tag SyntaxAn HTML tag is written in angle brackets (characters) and consists of a name, which can be followed by a list of attributes (optional for most tags). Names and attributes represent English words and abbreviations.
Tags can be divided into two groups:
Paired tags (also called containers) have two components: opening (initial) and closing (final); the closing component has the same name, but when written, the name is preceded by a slash (symbol / ). Document text and other tags can be located between the opening and closing components. The document fragment located between the opening and closing elements of the container tag is formatted by the browser according to the meaning of the tag. For example, the text located between the tags will be displayed in bold (the name of the tag is from English bold). Paired tags can be nested but must not overlap.
Unpaired tags (also called autonomous) do not have a final component. When they are interpreted, one or another object is inserted into the displayed document. For example, tag , occurring in the text of an HTML document, causes an insertion graphic image from the pict.gif file.
The attributes in the list are separated from each other by one or more spaces, or tab characters, or newline characters; the order in which the attributes are written is not important. The vast majority of attributes are used as a pair attribute name = attribute value. When the attribute value is more than one word or one number, it should be enclosed in single or double quotes. Attributes are not specified in the closing components of tags.
Here is an example of a tag with attributes:
Tag name Attribute name |
Attribute value |
Attribute name |
Attribute value |
Hello !
Having encountered such a tag in an HTML document, the browser interprets it, displaying the text following the tag in characters increased relative to the base size (SIZE=+2) and red color (COLOR=RED); this text formatting is applied until the closing tag is encountered.
The case of characters in tag and attribute entries does not matter.
HTML Document StructureAn HTML document is enclosed in the and tags. Between these tags there are two sections: the header section (between the and tags) and the body section of the document (between the and tags). The header section contains a description of the parameters used when displaying the document, but not reflected directly in the browser window .The document body section contains the main text intended for display by the browser, formatting tags, placement of pictures, tables, hyperlinks, etc.
The HTML code of the simplest document suitable for posting on the Internet looks like this:
< TITLE >Our first pageTITLE >
The simplest HTML document
This code can be typed in the Notepad text editor and saved as a file with the extension . htm or. html - in this case, the document will open in the default browser installed on your computer. The browser will display this document by displaying in its window the line "The simplest HTML document" located in the body section of the document. The phrase "Our first page" will appear in the title bar of the browser.
HEAD sectionThe header section usually contains tags that are invisible to the user, but nevertheless can actively influence appearance document.
Tag |
Purpose |
Specifies the name of the entire document. The name is usually displayed in the title bar of the browser window. This element is required for any HTML document and can be specified no more than once. |
|
Specifies the base address (URL) of the current document that will become Starting point to calculate relative addresses within a document. The element does not have an end tag. At least one of the arguments must be present: HREF - specifies the base address (URL) of the current document. TARGET - specifies the frame name that will be used in hyperlinks by default. This may come in handy if you want to open all the links in a document in a different frame. |
|
< STYLE TYPE= "text /css " > |
Used to insert cascading style sheets (CSS - Cascade Style Sheet) into a document. TYPE is a required attribute whose value is usually "text/css". |
< МЕТА …> |
The META element is used for technical description document. Using this element, additional information is inserted into the document title helpful information, invisible to the user, but sometimes simply irreplaceable for the correct indexing of your page by search engine robots. The element does not have an end tag. NAME - defines the name of the meta post. There are many predefined names, some of which you can see in the example below. CONTENT - assigns the value to the meta entry defined in the NAME parameter. |
This section includes the main content of the web page - document text, images, tables, etc. The BODY element must appear no more than once in a document and can include the following attributes:
Attribute syntax |
Purpose |
MARGINHEIGHT= number |
Specifies the width (in pixels) of the document's top and bottom margins. Works only in Netscape browsers |
TOPMARGIN= number |
Specifies the width (in pixels) of the document's top and bottom margins. Only works in Internet browsers Explorer |
MARGINWIDTH= number |
Specifies the width (in pixels) of the document's left and right margins. Works only in Netscape browsers |
LEFTMARGIN= number |
Specifies the width (in pixels) of the document's left and right margins. Works only in Internet Explorer browsers |
BACKGROUND= URL |
Specifies the image to "fill" the background (background image). The value is specified in the absolute or relative address of the image (see section Placing pictures) |
BGCOLOR= color |
Specifies the background color of the document. MicrosoftInternetExplorer supports 16 standard color names (aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple, red, silver, teal, yellow, white) Another way is to use a color code in the form of a six-digit hexadecimal number that specifies the intensity of the red (first two digits), green (next two digits) and blue (last two digits) components. The intensity of each component in hexadecimal form ranges from 00 to FF. When specifying a color as an attribute value for a tag, the hexadecimal number is preceded by a # character. For example, the entry COLOR ="#0000 FF " means blue Despite the fundamental possibility of specifying millions of colors, it must be taken into account that browsers display only 256 colors, and each browser has its own color palette. In this palette, the browser will select the color closest to the specified one |
TEXT= color |
Specifies the color of text in a document |
LINK= color |
Specifies the color of hyperlinks in a document |
ALINK= color |
Defines the highlight color of hyperlinks when clicked. |
VLINK |
Defines the color of hyperlinks to already viewed documents |
All character formatting tags have both an opening and a closing component and act on the text enclosed between them.
The main tag is ... FONT>, which must be used with one or more attributes that change the size, color and typeface of the font:
Attribute syntax |
Purpose |
SIZE = meaning |
The size is specified either as an absolute value (a number from 1 to 7) or relative to the base font size (in the form +n or -n). |
COLOR= color |
Color |
FACE = font list |
Typefaces for displaying text; names are listed in order of preference separated by commas, e.g. FACE="Verdana, Helvetica, Arial, Sans-Serif" You can also specify one of the typefaces, but keep in mind that this font may not be installed on the user’s computer, and “exotic” fonts will not be displayed by the browser |
In addition, tags are used to change the style of characters:
. .. (from English bold) − bold font;
.. . (from English italic) - italics;
... (from English TeleType) – monospace font;
... (from English underline) - underlined;
... S > (from English s trikethrough) - crossed out;
... (from English s ub script) – subscript;
... (from English sup erscript) is the superscript.
Text enclosed between tags
and (from English pre formatted), is displayed as it was pre-formatted, with all spaces and line breaks.
Formatting ParagraphsThe text is displayed in the browser window word by word; when the right border of the window is reached, the next word is automatically moved to a new line. Even if several spaces were entered in the page code or the text was written on a new line, these actions will not be displayed when viewed in a browser. Therefore, in order to display a series of consecutive spaces or several empty lines, you have to use different tags.
Tag
(from English b reak)breaks the text stream and inserts a new line without creating a new paragraph. Multiple consecutive tags
are interpreted as several empty lines. The line spacing is single. The tag has no closing component and no attributes.
Tag(from English p aragraph)begins a paragraph; a new paragraph is separated from the previous one by double line spacing. A paragraph cannot be empty, that is, several consecutive tags
are interpreted as one (as opposed to the tag
).Closing component
optional, since the previous paragraph ends where the new one begins. The tag has an optional ALIGN attribute indicating the alignment type of the paragraph, which can take the values LEFT, CENTER, RIGHT and JUSTIFY, specifying the alignment respectively to left, center, right and width. The text enclosed in tags will also be centered.
...If the closing component
omit, the specified alignment type is retained until next tag, which specifies the alignment, or to the end of the document.
HTML allows you to create paragraphs formatted as numbered or bulleted lists. A text fragment, which is a list, is enclosed in tags:
ordered (numbered) list (from English o rdered l ist)
unordered (bulleted) list (from English u nordered l ist)
Each element of an ordered or unordered list is enclosed in tags ... (from English l ist i tem). When displaying text, each list element will be placed on a new line, indicated by a number or marker. In addition, the list can have a title, which is specified by a tag (from English l ist h eader). Closing tags are not required.
Numbered list |
Bulleted list |
|
Code element |
< O L> Heading First element Second element Third element |
< U L> Heading First element Second element Third element U L> |
Browser display |
Heading 1. First element 2. Second element 3. Third element |
Heading · First element Second element · Third element |
A multi-level list can be organized through a combination of numbered and bulleted lists.
Tag has optional attributes:
Attribute syntax |
Purpose |
|
TYPE = format |
The numbering format can have the following values: |
|
Arabic numerals (default) |
||
capital letters |
||
lower case |
||
large roman numerals |
||
small roman numerals |
||
START = value |
first number in the list (default 1) |
Tag has an optional attribute
Attribute syntax |
Purpose |
|
TYPE = format |
The token format can have the following values: |
|
Disc |
disk (default) |
|
Circle |
circle |
|
Square |
Square |
Paragraphs can also be formatted as level headings (from n = 1 to n = 6), for this purpose tags of the form ... n> are used. The first level heading is displayed in the largest font.
Tags
, ... ,
can have an alignment attribute ALIGN with the values LEFT, RIGHT and CENTER.
Placement of drawingsThe images that the browser displays when viewing a web page are stored in separate gif, jpg (jpeg) or png files, and a link is made in the page code to required file. For this, an unpaired tag is used, which has one mandatory and a number of optional attributes.
Required attribute: |
|
SRC = url |
Graphic file address (relative or absolute) |
ALT= text |
Alternative text displayed in browser mode without loading images (must be enclosed in quotes) |
BORDER = meaning |
Border thickness in pixels, 0 means no border (default) |
BORDERCOLOR = color |
Sets the border color |
HEIGHT = meaning |
Image height in pixels (original by default) or as a percentage of the browser window height |
WIDTH = meaning |
Image width in pixels (original by default) or as a percentage of the browser window width |
HSPACE = meaning |
Free space to the left and right of the image in pixels |
VSPACE = meaning |
Free space above and below the image in pixels |
ALIGN = meaning |
Aligns the image horizontally. If LEFT or RIGHT is set, the image will be horizontally aligned accordingly, setting these values will cause text to wrap around the image |
Let's take a closer look at the absolute and relative methods of addressing a file.
Addressing in absolute form used when referring to resources located on other servers. The universal address that determines the location of an information resource is called URL (Uniform Resource Locator). The URL consists of two parts, separated by a colon. The first part indicates the type network protocol, which depends on the type of resource. For example, if the resource is located on a WWW server, this is the protocol http.The second part includes the name of the computer (server) in the domain name system and (if required) the path name of the file. When writing a pathname, directory names are separated by a forward slash (the / character) in file and directory names differentiate between uppercase and lowercase letters, spaces are not allowed. Here are examples of URLs:
http://www. vshu. kirov .ru/ site / images / picture 1. jpg
http://195.21.123.13:8110
ftp://everything.com/soft/prog.zip
mailto:This email address is being protected from spambots. You need JavaScript enabled to view it.
Last URL pointing to the protocol mailto and address Email, does not link to any information resource; This is the only type of URL that does not include two forward slashes after the colon.
Addressing pictures in absolute form is practically not used when creating a website.
Addressing in relative form used when referring to resources located on the same server. When writing the path to a file, directory names are separated by a forward slash (the / symbol), navigating through directories file system one level up is indicated by two dots (symbols ..). To make it clearer, imagine a computer, for example, with the following directory structure containing HTML files:
SHAPE\* MERGEFORMAT
MySite |
Pages |
Images |
Page1.htm Page2.htm Pict1.jpg Pict2.jpg |
Index.htm Picture.jpg |
In this case, for example, the following options for writing the IMG tag are possible:
ü < IMG SRC = Picture . jpg >(Picture . jpg image is located on the Index . htm page)
ü < IMG SRC = Images / Pict 1. jpg >(image Pict 1. jpg is located on the page Index. htm)
ü < IMG SRC =../ Picture . jpg >(Picture . jpg image is located on the page Page 1. htm )
ü < IMG SRC =../ Images / Pict 1. jpg >(image Pict 1. jpg is located on the page Page 1. htm)
Despite the fact that formally only the SRC attribute is required, in practice it is also necessary to specify alternative text(ALT attribute), since many people work with the browser in mode without loading images.
The height and width of the area in which the drawing is displayed are specified using the width and height attributes in pixels or as a percentage of the screen size. When one of these attributes is specified, the drawing is scaled so that its height or width matches the specified one. The second size is set automatically, in the appropriate proportion. Applying only one of the attributes changes both dimensions of the drawing.
If you explicitly set both attributes, the image will be scaled along two axes in accordance with the specified dimensions. The height and width attributes do not change the loading time of the image, but only its appearance (size) on the screen.
A hyperlink is an object (text, image, image fragment) that, when clicked with the mouse, leads to a new document or document fragment. It is hyperlinks that allow you to organize transitions between any documents posted on the Internet.
Text hyperlinksThe connection between HTML documents and document fragments is organized using the tag ...(from English a nchor - anchor).
The tag is used both to create a link to another document and to link to a fragment of a document.
Required attribute: |
|
HREF = url |
Address of the target document (can be presented in absolute and relative form) |
Basic optional attributes: |
|
NAME=" Name" |
Marks the one between< A >and A > document fragment as a possible link object. As a value, you need to write in Latin any index word that is unique for this document. For example, the Section1 tag creates a so-called label (bookmark) to go to section 1. In this case, you can refer to the marked area by simply indicating its name after the document name (preceded by a #). So,<
A
HREF
="
Index
.
html
#
part
1">To Part 1 A > will take you to the "part 1" section of the Index file. html and |
TARGET = " Name" |
The name of the frame (frame) or window for displaying the target document. This attribute is used only in conjunction with the HREF parameter. The value must be either the name of one of the existing frames or one of the following reserved names: _self - indicates that the document specified in the HREF parameter should be displayed in the current frame; _blank - specifies that the document should be displayed in a new window |
TITLE= " text!}" |
Displays a tooltip when you hover the mouse over a hyperlink |
Text and images placed between tags become the active area of the document, sensitive to a mouse click that causes the target document to load. Hyperlink text is highlighted with underlining and colors specified as the value of the LINK, A LINK, V LINK attributes of the tag (or the default color).
Hyperlinks-picturesTo make a whole image a hyperlink, you can also use the tag ...., only instead of text (or together with text) between< A >and A > tag is located< IMG …>with all relevant attributes.
For example , .
Hyperlink mapThe tag allows you to make a text fragment or an entire image the active zone; In order for different fragments of one image to link to different target documents, you will have to use a tag that implements the map image.
For a container tag, the only required attribute is NAME , the value of which will be the name (for example, NAME=" mymap " , which must be used when describing the USEMAP attribute of the IMG tag describing the image intended to serve as a map (with # − USEMAP="#mymap")
Inside the container, each mouse-sensitive area of the image must have a tag with the following attributes:
Attribute syntax |
Purpose |
COORDS= list |
Comma separated list of coordinates of the active zone (depending on the type of the given zone shape) |
HREF = url |
|
SHAPE = form |
Defines the shape of the core. Possible values for this attribute: circle(circle – specified by the coordinates of the center and radius in pixels); rect(rectangle - specified by the coordinates of the upper left and lower right corners); poly(polygon - defined by the coordinates of its vertices) In all cases, coordinates are measured from the upper left corner of the image in pixels, the X axis is directed to the right, and the Y axis is directed down. |
NOREF |
sometimes it is necessary to indicate that a given zone (specified by the SHAPE attribute and COORDS coordinates) is not active, there is no reaction to a mouse click |
Tables in HTML documents are used not so much to place data in framed cells, but to arrange pieces of text and images relative to each other.
Tables in HTML are built row by row. All tabular data is enclosed in tags
; the description of each row of cells (rows) is contained in the tags ...; the contents of each cell are contained in tags ... (regular cells) or ... H> (headers).
Thus, to describe, for example, a table of two rows, each containing two cells, you will have to create the following construction:
Table cells can contain text, images, nested tables, etc. You should not leave table cells blank; if any cell should appear empty, place a non-breaking space in it.
Text placed in table cells is automatically placed by the browser by default; the text is displayed word by word; When the right border of the cell is reached, the next word is moved to a new line.
Table cells can span multiple rows or columns; when describing such cells, the attributes ROWSPAN (a cell whose tag contains this attribute is “stretched” by the specified number of rows) and COLSPAN (the cell is “stretched” by several columns) are used. Here is an example of organizing a table with merged cells:
< TR >
< TD ROWSPAN=2>1-1 TD >
Tags that describe tables have a number of optional attributes.
Tag attributes specify the parameters of the table as a whole:
Attribute syntax |
Purpose |
|||
ALIGN = value |
Alignment relative to the text flow; possible values are left, right and center |
|||
BACKGROUND = url |
Background image for the entire table |
|||
BGCOLOR= color |
Background color |
|||
BORDERCOLOR = color |
Border color |
|||
BORDERCOLORDARK = color |
Colors the right and bottom edges of the main frame and the left and top edges of each cell with the specified color |
|||
BORDERCOLORLIGHT = color |
Colors the left and top edges of the main frame and, accordingly, the right and bottom edges of each cell in the specified color |
|||
CELLPADDING = value |
Distance from cell borders to its contents in pixels |
|||
CELLSPACING = value |
Distance between cells in pixels |
|||
HSPACE = meaning |
Free space to the left and right of the table in pixels |
|||
VSPACE = meaning |
Free space above and below the table in pixels |
|||
WIDTH = meaning |
Table width (set in pixels or as a percentage of the current browser window width) |
|||
Tag attributes specify the parameters of a given series (if contradictions arise, the attributes specified in the tag are canceled). Alignment of cell contents; possible values are left, right and center
BACKGROUND = url
Background image for cells of a given table row
BGCOLOR= color
Background color for cells in this row
BORDER = meaning
The thickness of the border surrounding the cells of this row; BORDER=0 indicates an invisible border
VALIGN = meaning
Vertical alignment of cell contents; possible values are top, center and bottom
Tag attributes specify the parameters of a given cell (if inconsistencies occur, the attributes specified in and tags are canceled).
Attribute syntax |
Purpose |
ALIGN = meaning |
Align cell contents; possible values are left, right and center |
BACKGROUND = ur l |
Background image for a table cell |
BGCOLOR= color |
Background color for cell |
BORDER = meaning |
Thickness of the frame surrounding the cell |
VALIGN = meaning |
Vertical alignment of cell contents; possible values are top, center and bottom |
WIDTH = meaning |
Cell width in pixels or percentage of table width |
ROWSPAN= meaning |
Indicates the number of rows covered by a cell |
COLSPAN = meaning |
Specifies the number of columns covered by a cell |
When working with tables, keep in mind that the specified value for the WIDTH attribute is in many cases only "noted" by the browser. The given proportions are rarely maintained exactly; the browser tries to display the table as best as possible (in its understanding).
TickerUsing a ticker on a web page makes it more dynamic and allows you to create the effect of an object moving. Creating a ticker using a tag< MARQUEE >... MARQUEE >.
Between< MARQUEE >and MARQUEE > text fragments and pictures can be located. Text can be formatted using appropriate tags and graphics are inserted using .
Attribute syntax |
Purpose |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
BGCOLOR= color |
Background color. If the background is specified, the browser draws a colored stripe on the screen along which the text or image moves. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
HEIGHT = meaning |
The height of the background bar. The value is specified in pixels or as a percentage of the browser window height. For example, if you specify the HEIGHT=25% attribute, the ticker bar will occupy a quarter of the window height |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
WIDTH = meaning |
The width of the ticker bar, indicated in pixels or as a percentage of the width of the browser window |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DIRECTION= meaning |
Direction of line movement: left - left (default), right - right, up - up, down - down |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
BEHAVIOR = meaning |
The attribute controls the behavior of the ticker: scroll (default) – having reached the edge of the window, the line goes out of view and then appears on the opposite side; slide - a line appears from the edge of the window, reaches the opposite one and stops; alternate - the line moves to the right or left, “reflecting” from the edges of the window and changing the direction of movement |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
HSPACE = pixel offset |
Shift the ticker bar horizontally to the right |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
VSPACE = You co ta in pixels |
Creating empty space above and below the strip |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
LOOP = meaning |
Number of line transitions across the screen |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SCROOLAMOUNT = meaning |
The number of pixels the line traverses each step. The default mode is approximately 10 px/step. This attribute allows you to adjust the speed of line movement |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SCROLLDELAY = meaning |
Defines the time interval (in milliseconds) between steps, using this attribute you can make the line move jerkily |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
TRUESPED |
When this flag (an attribute without a value) is set, the specified SCROLLDELAY value will be used. If the flag is not set, the value is SCROLLDELAY. Anything between these tags will not be displayed on the web page. Optional TagsIf a tag is not listed, it does not mean that it is not represented at all. There are certain rules that allow you not to write some tags. In table 1 shows tags that can be omitted and the condition under which this occurs.
|