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

React implements a general skeleton screen component example

Table of contents What is a skeleton screen? Demo...

XHTML language default CSS style

html,address, blockquote, body,dd,div, dl,dt,fiel...

JavaScript implementation of carousel example

This article shares the specific code for JavaScr...

Summary of mysqladmin daily management commands under MySQL (must read)

The usage format of the mysqladmin tool is: mysql...

How to embed flash video format (flv, swf) files in html files

Flash file formats: .FLV and .SWF There are two ex...

Detailed explanation of CSS3+JS perfect implementation of magnifying glass mode

About a year ago, I wrote an article: Analysis of...

How to use mysqldump to backup MySQL data

1. Introduction to mysqldump mysqldump is a logic...

Web Design Tutorial (7): Improving Web Design Efficiency

<br />Previous article: Web Design Tutorial ...

Implementation steps for building FastDFS file server in Linux

Table of contents 1. Software Package 2. Install ...

js to achieve star flash effects

This article example shares the specific code of ...

JS uses clip-path to implement dynamic area clipping function

background Today, I was browsing CodePen and saw ...

Interpretation of the module for load balancing using nginx

Table of contents Two modules for using nginx for...

Summary of some common techniques in front-end development

1. How to display the date on the right in the art...

A very detailed explanation of Linux C++ multi-thread synchronization

Table of contents 1. Mutex 1. Initialization of m...

Implementing calculator functions with WeChat applet

This article is a simple calculator written using...