The InternetWeb design

Image Manager - img tag

The picture is not just inserted directly into the text. The browser is told her name and indicates where and how to arrange on the screen. To do this, use a single HTML-tag img. It specifies the location of the graphic object on the web page.

If many attributes for tags are not required in principle, then the img tag must have at least one parameter - the pattern address. This attribute is called src:

  • - this place will display the file goat.jpg, which is stored in the current directory;
  • - with this parameter of the img tag, the browser will download the image posted on the Internet at megasellmag.ru.

Alignment attributes

To position images on the page using HTML, the img tag is used, the attributes of which are responsible for placing the image on the page and the nature of its text wrapping.

By default, the browser has an image in the center of the screen, and the text does not wrap around it. The img tag will allow Express your disagreement with the browser using the align attribute.

- the picture will be located at the left edge of the page, and the text will bypass it to the right.

The behavior of the text will be similar if the picture is placed on the right (align = right), in the middle (align = middle), on top (align = top), at the bottom (align = bottom) and center (center).

Indentation and size parameters

That the text did not crawl on pictures, the tag img got special Attributes -hspace (horizontal / horizontal fields) and vspace (vertical / vertical fields), which determine the amount of text indentation from the edges of the images in pixels.

The image will not only obediently move away from the text by the specified amount, but it will also move away from the edge of the page, so it's better to avoid large indentations.

Very important are the geometric dimensions of the images, which are not only desirable, but sometimes just need to be indicated for the correct display of the picture. To do this, the width and height attributes are set, the value of which is specified in pixels or percentages.

If you specify only the width, the height will be matched automatically with the original proportions. The sizes set in percentage, allow to place the image in the necessary part of page, irrespective of the size of a window of a browser, and such necessity arises quite often.

Other parameters

The border attribute encloses the picture in the frame of the specified thickness, which the browser does not by default.

The frame can have a seemingly meaningless zero thickness (border = '0'), but this is until the picture becomes a link when the browser automatically traces it with a blue border, without waiting for instructions.

Some impatient users, enraged by the low speed of the Internet, simply turn off the display of pictures. Here for such cases the parameter alt is provided, allowing to enter the alternative text which the user will see in a square where the image in a hurry to load.

If you do not like the alt option, the img tag can offer The longdesc attribute, the value of which is the URL of the document with a more detailed description.

Attributes usemap and ismap tell the browser that the image will be a picture where the hyperlink is a separate area (reference map), only the usemap parameter specifies the navigation map on the server, and ismap is the map on the client side.

Description of the link 1 in the picture below:

Exotic items

The lowsrc attribute instructs the browser to load first a copy (or another alternative) of the original image with a lower quality and, accordingly, more "easy". This trick is provided for the case of low Internet speed for the user. The original image, loaded, replaces the "fake".

Not so often used galleryimg attribute of the img tag calls the image control panel (if you hover the cursor over it), allowing you to open the standard My Pictures folder and print, save or send the picture by e-mail. You can disable the panel by setting the galleryimg to no / false, and turn it on by setting yes / true.

In the new HTML5 specification, some of the parameters have become obsolete. So, img attributes lowsrc, border, longdesc, and name are sent into retirement.

Similar articles

 

 

 

 

Trending Now

 

 

 

 

Newest

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