How to insert pictures into HTML pages and add map index examples

How to insert pictures into HTML pages and add map index examples

1. Image formats supported on the WEB:

GIF: can save 256 colors, support transparent colors, support animation effects
JPEG: does not support transparent colors and animations, and can have up to 1670 colors
PNG: supports transparent colors, does not support animation, and has a range of colors from a few to 1670

2. Insert the image into the web page using the <img/> tag:

src: Set the image, the value is equal to the path of an image file
Height: Set the height of the image in pixels or percentage (will automatically scale proportionally)
Width: Set the width of the image. The value is expressed in pixels or percentage.
border: add a border to the image
alt: Image description text. The value of this attribute will be displayed when the image is not displayed.
title: This attribute indicates that when the mouse is placed on the image, the value of the attribute will be displayed.
align: attribute value = left: the image is on the left and the text is on the right
rightThe image is on the right and the text is on the left
Top text is vertically aligned to the top
middle vertically centered text
bottom The text is vertically aligned (default)
vspace: The attribute value is in pixels, defining the blank space at the top and bottom of the image
hspace: The attribute value is in pixels, defining the blank space on the left and right sides of the image


Copy code
The code is as follows:

<imgsrc="../../../Material Library/001.jpg"height="300"width="200"border="10"alt="Anta Genuine"title="Anta Genuine"hspace="20"vspace="20"/>
<p>
<!--Mixed text and images-->
<imgsrc="../../../Material Library/001.jpg"height="300"width="200"align="left"/>
11. I did well in the exam thanks to my good deskmate. </p>
<p>12. In school, we used money to get by, but now we use life to get money! </p>
<p>13. Some people always sell what they have in exchange for what they don't have. </p>
<p>14. To love oneself, one must first be selfish. Only by being selfish can one have great love. </p>
<p>15. Guinness World Records: The world's largest coffee table covers an area of ​​9.6 million square kilometers and can hold 1.3 billion cups. </p>
<p>16. Breaking up is so boring. If you have the guts, let’s get a divorce! </p>
<p>17. Take the path of RMB and leave the people with no way to go! </p>
<p>18. Sanlu milk powder, the choice of stepmothers. </p>
<p>19. One day, Xiao San cried because Xiao Si appeared! </p>
<p>20. Break up with you, because you are not even worthy of holding hands! </p>
<p>21. Don’t pose in front of me. I’m afraid I’ll want to throw my camera. </p>
<p>22. We are just passers-by, playing games together in this colorful world. No matter you win or lose, we will all be GameOver together in the end! </p>
<p>23. I have done two things wrong in my life. One is being born, and the other is staying alive. </p>
<p>24. If I die, my first words will be: I don’t have to be afraid of ghosts anymore. </p>
<p>25. I am a civilized person and all my dirty words have been disinfected with saliva. </p>
<p>26. Famous quotes. You have to be a celebrity first to qualify as a famous quote. Other people’s farts are just famous farts! Can you compare? </p><!--Use images as hyperlinks. When you use images as hyperlinks, the image will automatically have a light blue border. When you click the hyperlink, it will turn into a purple border. You can use the border attribute in the img tag to remove the border. -->
<ahref="#"><imgsrc="../../../Material Library/yingyue.png"border="0"alt="京津冀"/></a>

3. HTML map index:

Map indexing, that is, using a part of the same image as a hyperlink, can make multiple hyperlinks (using the design view can be done)


Copy code
The code is as follows:

<!--
Format: <mapname="image name"id="image name">
<areashape="Select the shape of the area" coords="coordinates" href="URL" alt="text description">
</map>
<imgsrc="URL"USEMAP="#image name">
<map> declares that the entire graph is connected using map links.
name,id refers to the name of this image.
<area> indicates the area where we want to link one point
Shape represents the shape we choose, such as: rect rectangle circle circle poly polygon
coords represents the coordinate position of the map!!
-->
<imgsrc="../../../材料库/42a98226cffc1e173ec6f5894b90f603738de909.jpg"alt="MM"width="200"height="300"hspace="20"border="0"align="left"usemap="#Map"title="MM"/>
<mapname="Map"id="Map">
<areashape="rect"coords="39,99,76,137"href="#"alt="I'll hit you"/>
<areashape="circle"coords="94,200,17"href="#"alt="Very big"/>
<areashape="poly"coords="87,50,119,50,121,70,91,67"href="#"alt="myeyes"/>
</map>

Add an icon to the web page: <linkrel="shortcuticon"href="file path name.ico"type="image/x-icon">Put it in the <head> header tag

<<:  Vue2.0 implements adaptive resolution

>>:  The experience gained from comparing and analyzing the homepages of domestic social networking websites is shared with everyone (picture)

Recommend

MySQL scheduled full database backup

Table of contents 1. MySQL data backup 1.1, mysql...

MySQL slow query pitfalls

Table of contents 1. Slow query configuration 1-1...

Vue's Render function

Table of contents 1. Nodes, trees, and virtual DO...

Vue3.0 uses the vue-grid-layout plug-in to implement drag layout

Table of contents 1. Plugins 2. Interlude 3. Impl...

How to add default time to a field in MySQL

Date type differences and uses MySQL has five dat...

MySQL 8.0.22 download, installation and configuration method graphic tutorial

Download and install MySQL 8.0.22 for your refere...

How to export and import .sql files under Linux command

This article describes how to export and import ....

How to install MySQL under Linux (yum and source code compilation)

Here are two ways to install MySQL under Linux: y...

MySQL transaction control flow and ACID characteristics

Table of contents 1. ACID Characteristics Transac...

Detailed tutorial on installing MySQL 8.0.19 in zip version on win10

Table of contents 1. After downloading, unzip it ...

Graphical tutorial on installing JDK1.8 under CentOS7.4

Linux installation JDK1.8 steps 1. Check whether ...

Detailed process record of Vue2 initiating requests using Axios

Table of contents Preface Axios installation and ...

Detailed explanation of JavaScript's Set data structure

Table of contents 1. What is Set 2. Set Construct...

The most basic code for web pages

◆Add to favorites illustrate Click to add your we...

Summary of some reasons why crontab scheduled tasks are not executed

Preface I recently encountered some problems at w...