How To Make A Picture In Html

Table of contents:

How To Make A Picture In Html
How To Make A Picture In Html

Video: How To Make A Picture In Html

Video: How To Make A Picture In Html
Video: How to Insert an Image in a Webpage (HTML / XHTML) 2024, May
Anonim

HTML is a markup language that is used to create Internet pages. It can be used to customize the display of various elements, including images. Setting the display of images in HTML is carried out through a special tag.

How to make a picture in html
How to make a picture in html

Instructions

Step 1

Open your HTML file with the text editor you use to edit web pages. If you do not have an HTML file, create it by left-clicking on the desktop or in the required folder, and click on the "New" - "Text Document" menu. Enter a file name and add the html extension after the period. Then right-click on the document again and select "Open with" - "Notepad". You will see a blank document in which you can place HTML code.

Step 2

To create an image in HTML, a tag is used, which must be placed in a section for display. For example:

Picture in HTML

Step 3

The tag is non-closing and does not require a closing tag. Its main parameter, which must be used, is src, which sets the path to the desired image file. You can specify in this line both the full (with https://) and the relative path (for example, /pictures/img.jpg) to the image file that you want to place.

Step 4

Another important parameter is alt, which determines the name of the image and its identification on the page. This name will appear when the user hovers the mouse over the picture.

Step 5

You can also use the width and height attributes to set image parameters. The first setting is responsible for the length, and the second is for the height of the image on the page. This parameter is specified in pixels. Thus, the & img> tag can be set:

Step 6

Using this tag, an image is created, the path to which is recorded in the src attribute. When you hover over the picture, you will see the message "picture name". In this case, the image will be 300 pixels wide and 250 pixels high. You can set all of the above parameters as you like.

Step 7

Save the changes to the file using the "File" - "Save" function. Open the document in a browser to check the success of the HTML image creation. To do this, right-click on the file and select the "Open with" section, and then click on the line with the name of your browser. HTML image creation is complete.

Recommended: