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:
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:
Create a link to the "Helpful Tips section (id="tips")" in the HTML document:
Alternatively, create a link to the "Helpful Tips Section (id="tips")" from another page:
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
Use the tag for pictures, and we will talk about
code running results later:
Clicking on the image above will jump to //m.sbmmt.com/