", where the src attribute contains the path to the picture we want to introduce, which can be a relative path or an absolute path. URL."/> ", where the src attribute contains the path to the picture we want to introduce, which can be a relative path or an absolute path. URL.">

Home  >  Article  >  Web Front-end  >  How to insert html pictures

How to insert html pictures

藏色散人
藏色散人Original
2021-04-28 10:17:3216270browse

In HTML, pictures can be inserted through the a1f02c36ba31691bcfe87b2722de723b tag. The inserted code is such as "48a0c253b32e640802da19b519774f09", where the src attribute contains a pointer to the picture we want to introduce. The path can be a relative path or an absolute URL.

How to insert html pictures

The operating environment of this article: windows7 system, HTML5&&CSS3 version, DELL G3 computer.

We can use the a1f02c36ba31691bcfe87b2722de723b element to put images on the web page. It is an empty element (it does not need to contain text content or a closing tag) and requires at least one src (usually read as its full name, source) to make it effective. The src attribute contains the path to the image we want to include, which can be a relative path or an absolute URL, just like the href attribute of the 3499910bf9dac5ae3c52d5ede7383485 element.

Note: Before continuing, you should read the Quick Start URLs and Paths to review relative and absolute URLs.

For example, if you have an image named dinosaur.jpg, and it is stored in the same path as your HTML page, then you can embed it like this:

<img src="dinosaur.jpg">

If this picture is stored in the images folder with the same path as the HTML page (this is also recommended by Google, which is beneficial to SEO/indexing), then you can use the following form:

<img src="images/dinosaur.jpg">

and so on.

Note: Search engines also read the filenames of images and count them towards SEO. Therefore you should give your image a descriptive filename: dinosaur.jpg is better than img835.png.

You can also use absolute paths like the following:

<img src="https://www.example.com/images/dinosaur.jpg">

But this method is not recommended. Doing so will only make the browser do more work, such as re-passing DNS Then look for the IP address. Usually we put images and HTML on the same server.

[Recommended learning: HTML video tutorial]

The above is the detailed content of How to insert html pictures. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:How to add spaces to htmlNext article:How to add spaces to html