HTML link

HTML uses a hyperlink to connect to another document on the web.

Links can be found in almost all web pages. Click a link to jump from one page to another.


Let us first look at a link example

    php.cn 

PHP中文网 是一个指向本网站中的一个页面的链接。

百度这是一个指向百度的链接

Code running results:

1.png


HTML Hyperlink (Link)

HTML uses the tag to set up hypertext links.

A hyperlink can be a word, a word, a group of words, or an image. You can click on these contents to jump to a new document or the current document. a certain part of.

When you move the mouse pointer over a link on the web page, the arrow will change into a small hand.

The href attribute is used in the tag to describe the address of the link.

For example, if you link to the home page of the php.cn site, you can express it like this:

##PHP Chinese website


By default, the link will appear in the browser as:

A link that has not been visitedis displayed in blue font and underlined.

Links visited byare colored purple and underlined.

When you click a link, the link appears red and underlined.

Note: If CSS styles are set for these hyperlinks, the display style will be displayed according to the CSS settings.


HTML Connection - id Attribute

The id attribute can be used to create bookmark tags in an HTML document.

Tip: Bookmarks are not displayed in any special way and are not displayed in HTML documents, so they are hidden from readers.

Insert ID in HTML document:

##Useful tips section

Create a link to the "Helpful Tips section (id="tips")" in the HTML document:

;Visit the Helpful Tips Section

Alternatively, create a link to the "Helpful Tips Section (id="tips")" from another page:

Visit the helpful tips section< /a>

Basic Notes

Note: Always add forward slashes to subfolders. If you write the link like this: href="//m.sbmmt.com/html", two HTTP requests will be generated to the server. This is because the server will add a forward slash to the address and then create a new request, like this: href="//m.sbmmt.com/html/".


Example

How to use image links.

    php.cn 

创建图片链接: HTML 教程

无边框的图片链接: HTML 教程

Use the tag for pictures, and we will talk about

code running results later:

1.jpg

Clicking on the image above will jump to //m.sbmmt.com/




Continuing Learning
||
php.cn

PHP中文网 是一个指向本网站中的一个页面的链接。

百度这是一个指向百度的链接

submit Reset Code
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!