Làm cách nào để chuyển hướng một phần của trang khác trong html?

Trong hướng dẫn này, tôi sẽ giải thích cách chuyển hướng đến một phần cụ thể của trang trong HTML. Chúng tôi biết rằng các siêu liên kết được trình duyệt web sử dụng để điều hướng từ trang này sang trang khác

Tuy nhiên, bạn cũng có thể điều hướng đến các khu vực khác nhau của cùng một trang bằng siêu liên kết. Các siêu liên kết cũng có thể được sử dụng cho một phần cụ thể của một khu vực trang web khác

Hãy hiểu điều này với các bước giải thích dưới đây

Tạo một liên kết neo

For accessing the marked section of a page or jump to a marked section of a web page with the help of tag. We have to add an ID attribute to the anchor element so that a specific section of the page can be called by this ID.

 Name where you want to jump 

GHI CHÚ

Xin lưu ý rằng mỗi ID chỉ có thể xuất hiện một lần trên cùng một trang để có thể phân biệt phần này với các phần khác

Tạo một siêu liên kết sử dụng cùng một ID với mục tiêu liên kết. Đây sẽ là siêu liên kết #

 Go to the part of the page with the id name 

Take a closer look and see how we have given an ID to a specific section with the help of tag and in another line we have called that specific section with the help of href attribute in tag.

Liên kết đến một trang khác trong cùng tên miền

Bạn cũng có thể liên kết đến các liên kết neo của mình từ cùng tên miền cũng như các tên miền khác. Để đạt được điều này, hãy thêm URL theo sau là # và giá trị neo

 Go to the HTML Links in our website. 

Mã số



  
    Redirect to a particular section of a page in HTML
    
  
  

    

Redirect to a particular section of a page in HTML



First Section

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

Second Section

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

Hành hình

đầu ra

Theo mặc định, sau khi chạy mã, màn hình bên dưới sẽ xuất hiện

Làm cách nào để chuyển hướng một phần của trang khác trong html?

Nhấp vào liên kết phần đầu tiên

Làm cách nào để chuyển hướng một phần của trang khác trong html?

Nhấp vào liên kết phần thứ hai

Làm cách nào để chuyển hướng một phần của trang khác trong html?

Vì vậy, chúng ta có thể thấy từ đoạn mã trên cách chúng ta có thể chuyển hướng đến một phần cụ thể của trang. Ví dụ này cũng giải thích nếu bạn muốn chuyển đến một phần cụ thể của cùng một trang hoặc đến một trang web khác

Tôi hy vọng bạn thích hướng dẫn này, vui lòng để lại nhận xét của bạn bên dưới và đừng quên đăng ký trang web của chúng tôi để biết thêm các chủ đề như vậy