Home > Article > Web Front-end > How to define images and their image sizes in html?
In the process of making HTML web pages, image references are essential. So how is the HTML definition image written? How are the size and width of images controlled using HTML code? This article will give you a detailed introduction to the relevant knowledge about html image tags and how htm defines image size. Hope it helps friends in need.
The specific code example of HTML definition image is as follows:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>html图像标签使用示例</title> </head> <body> <p> 一个图像: <img src="/upload/course/000/000/010/58046a2b7e46d104.gif" alt="Smiley face" width="32" style="max-width:90%"></p> <p> 一个动图: <img src="/upload/course/000/000/010/58046a41c6e3c115.gif" alt="Computer man" width="48" style="max-width:90%"></p> <p> 注意HTML定义图像和插入动图的语法是一样的。 </p> </body> </html>
The effect is as follows:
The above is a simple example of how to use HTML to display images in a web page.
Let me give you an example of getting pictures from the server and then displaying them:
<p>一个来自文件夹中的图像:</p> <img src="/upload/course/000/000/010/58046b14a8b9f738.gif" alt="Google Chrome" width="33" style="max-width:90%"><p>一个来自php中文网的图像:</p> <img src="/upload/course/000/000/010/58046c29b47ef575.png" alt="php.cn" width="336" style="max-width:90%">
The effect is as follows:
The above is the detailed content of How to define images and their image sizes in html?. For more information, please follow other related articles on the PHP Chinese website!