Image label

In the HTML tag,Tags are used to define images in HTML pages;

<img SRC =" image URL" />Copy the code

SRC isThe required attribute of the tag, which is used to specify the path and filename of the image file;

The so-called attribute: simply understood is the attribute that belongs to this image tag;

  • SRC The image path must be a property

  • Alt text replaces text when images cannot be displayed

  • Title Text prompt text, mouse over the image to display the text

  • The width pixel sets the image width

  • Height Pixel sets the image height

  • The border pixel sets the border thickness of the image

Note points of image label:

  1. Image tags can have multiple attributes and must be written after the tag name.
  2. Attributes are in no particular order. Label names and attributes and attributes are separated by Spaces.
  3. Attributes are in the key-value pair format, that is, key= “value” format, and attribute =” attribute value” format.

The path

Paths are classified into absolute paths and relative paths

A relative path is a directory path based on a reference file, in the case of an image, relative to the HTML page;

The relative path starts from the file in which the code is located to find the target file, and the above, next, and the same level is the image relative to the HTML page position;

An absolute path is an absolute location in a directory. The path directly reaches the destination, usually from the drive letter.

For example, “D: \ web/img/logo.gif” or the complete network address “www.itcast.cn/images/logo…

The link label

<a href=" jump to target "target=" target window pop-up mode "> text or image </a>Copy the code

Properties:

  1. Href: The URL used to specify the target of the link

  2. Target: used to specify how the linked page is opened. _self default value _blank A new window opens

  3. # : empty link

Link classification:

  1. External links: for example, < a href=”http:// www.baidu.com “> Baidu.

  2. Internal links: Links between pages within a site. Link directly to the internal page name, such as < a href=”index.html”> home page.

  3. Empty link: the < a href=”#”> home page if the target of the link has not been determined.

  4. Download link: If the href address is a file or zip, the file will be downloaded.

  5. Page element links: Hyperlinks can be added to various page elements in a page, such as text, images, tables, audio, video, etc.

  6. Anchor links: We click on links to quickly navigate to a location on the page.

    <h3 id="two"> </h3> </h3>Copy the code

annotation

If you need to add comment text to an HTML document that is easy to read and understand but does not need to be displayed on the page, you need to use comment tags.

Comments in HTML begin with "<! -- "begins and ends with" --> "; Shortcut key: CTRL + /;Copy the code

Special characters: In HTML pages, some special characters are difficult or inconvenient to use directly, we can use the following characters instead:

A null character (space) &nbsp; < < sign &lt; > > < span style = "max-width: 100%; No. & and & amp;Copy the code

Commonly used is the space, greater than sign, less than sign these three, the rest of the use of very few, if you need other symbols, look up on the line;