", 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:32 16245browse

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:

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:

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:

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 html Next article:How to add spaces to html