Home > Web Front-end > HTML Tutorial > What does href=# in the link mean_HTML/Xhtml_Webpage Production

What does href=# in the link mean_HTML/Xhtml_Webpage Production

WBOY
Release: 2016-05-16 16:40:45
Original
2878 people have browsed it

Link to current page.
-------------------
is usually used as follows :
Close
will href="#" refers to connecting to the current page, which is actually meaningless, and the page will not be refreshed. The key is the subsequent onclick. When "Close" is clicked, the window.close() code will be executed.

You may ask why not write it directly as Close
If you write it this way, the two words "Close" will not be treated as a hyperjoint, and the effect will look worse. You can try it yourself. When making a web page, the parameters in the html language are used to specify the url of the link. #### is the link to this page. href="address" is the link to the address link. This page defaults to this page. No new window will pop up. When the connection is empty, If # is removed, the mouse hand cursor will not be displayed. In simple terms, it is a fake link pointing to this page
You can also follow # followed by the anchor id. This is actually another usage of a bookmark

Create a bookmark
Syntax: Text
Link to a bookmark on the same page (using)
Syntax: Text of the link
Link to a bookmark on a different page
Syntax: The text of the link (note the quotation marks and the # sign)

Under normal circumstances, click: The text of the linkThis link, the cursor will automatically jump to this page: The position of the text .

But if you write: link text without writing a bookmark name, it will actually jump to nothing. Generally, href="#" will only appear when . You can treat it as an empty link and write it like this. It will display the link effect (such as the mouse turning into a small hand) but there will be no page jump.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template