(You can use the id attribute instead of the name attribute, named anchors are also valid . [1]) There are two methods for accessing the above anchor points One is to use the hyperlink tag to create an anchor link, which is mainly used for anchor points within the page. Access
| Another way is to add an anchor mark directly after the page address, which is mainly used for anchor access between different pagesIf this The address of the page is http://file path/index.html. To access the foot anchor, just access the following link http://file path/index.html#foot
|
2.html What is the anchor point for?
To put it simply, for example, if you want to read a long article accurately by segment, you can use anchor points.
Code:
Jump to 001
...Text omitted
...text omitted
In fact, the anchor point only needs the name, and the id is added to make it more compatible.
href The value must be consistent with name \ i d, and "#" must be added in front. The above code is compatible in ie6/7, ff, but not in ie8.
Because the value of our anchor point is empty, we can just add a space so as not to affect the aesthetics.
The following code will be compatible with IE8
< ;a href="#001">Jump to 001
...Text omitted
& n b s p
...Text omitted
Another question, do you want to display the anchor content of a certain page (such as: 123.html)?
The code is as follows
Jump to 001
...Text omitted
& n b s p
... Text omitted
This was yesterday when I was working on the background. I wanted to "modify positioning", so I moved the anchor mark. came out (usually it is forgotten by me).
But the program said that to get the value, there must be "?" or "&" in the connection, so my anchor point will be incompatible...
Haha! There will be a solution in the future!
Although there is a problem with anchor point compatibility in jsp pages, there is no problem in static pages, and it is still worth learning!
3. In WEB development, page anchor will be used. HTML page anchors are used to link to a section of a page. W3School says that creating anchors uses the (anchor) tag and the name attribute, but this is not the only way to create page anchors. Let’s briefly talk about two ways to make HTML page anchors.
We can use W3School’s online testing tool for testing. The test code after opening the link uses , and there is no problem in the test. Then change "
The code is as follows:
##
Page anchor method one
Use the href and name attributes of the anchor tag
Method 2
Use the anchor tag and id Properties