- Trang chủ
- Tham khảo
- Tag html
- html5
- Đây là link
Ví dụ: Liên kết tới trang khác
Html viết:
Liên kết tới trang khác
Hiển thị trình duyệt:
Ví dụ: Liên kết mail
Html viết:
Hiển thị trình duyệt:
Khi click vào sẽ xuất hiện một hộp thư gửi mail.
Ví dụ: Link từ vị trí này tới vị trí khác
Html viết:
Liên kết tới id content
Hiển thị trình duyệt:
Ví dụ: Link để mở file word [tương tự cho những định dạng khác]
Html viết:
Mở file ex.doc trong thư mục "doc"
Hiển thị trình duyệt:
Ví dụ: Liên kết mở ra cửa sổ khác
Html viết:
Liên kết mở ra cửa sổ khác
Hiển thị trình duyệt:
Trình duyệt hỗ trợ
Tag
Đường dẫn cụ thể đến một liên kết. target _blank
_parent
_self
_top
framenametarget"_blank" Xác định nơi để mở tài liệu. Thuộc tính không hỗ trợ trong HTML5 charset Bộ mã ký tự charset="UTF-8" Không hỗ trợ trong HTML5. coords Tọa độ coords="0,111,122" Không hỗ trợ trong HTML5. name Tên name="products" Không hỗ trợ trong HTML5. rev Text rev="ourWeb" Không hỗ trợ trong HTML5. shape default
rect
circle
polyshape"circle" Không hỗ trợ trong HTML5. Thuộc tính không được hỗ trợ trong phần lớn các trình duyệt hreflang Mã ngôn ngữ hreflang="vi" Xác định rõ ngôn ngữ của văn bản được liên kết.
Không hỗ trợ trong phần lớn trình duyệtrel Text rel="ourWeb" Xác định mối quan hệ giữa các văn bản hiện tại và văn bản được liên kết.
Không hỗ trợ trong phần lớn trình duyệtThuộc tính Tổng quát và thuộc tính sự kiện
Tất cả thuộc tính tổng quát và thuộc tính sự kiện được xác định trên phần lớn các thành phần HTML5
I try to use the anchor tag with the include I have. On my Index.php I got a little "nav bar" with some anchor tags. I also included the file "text.php" in my code. This file is in the Folder "texte". The anchor tags should bring the user to the position in text.php but it only load 404 - page not found.
How I include the file:
I declare my "start-word" like this:
Informationen
And my anchor like this:
Informationen
I also tried
Informationen
One think I noticed from your example is that you should make sure you use
"
not“
for quote marks - these are not the same characters, and you must use the correct one.Clicking on an anchor link should not result in a 404 error, if it's correctly defined. Even if the anchor ID doesn't actually exist in the page, it still wouldn't give a 404 - the worst that would occur would be that nothing would happen.
answered Jul 31, 2019 at 11:27
ADysonADyson
53.2k13 gold badges48 silver badges61 bronze badges
Additionally to what @ADyson said:
Anchor links work on the browser side. The form
#InfoAnker
redirects to an anchor on the same page, whiletexte/text.php#InfoAnker
redirects to another page. Again: on the browser side.But I see, you are using includes, which work on server side. Normally, you don't have the same path and file structure on server and client [if your server include is located outside of wwwroot for example, but also for hiding confidential data and your program structure]. This is most likely the reason why you see the 404. So if you want to access the piece of text that was included in your script, your redirect must not have a url.
But for this to work, you need to define the anchor itself, using
, either in the include or in the file which includesInformationen
text.php
answered Jul 31, 2019 at 11:38
Daniel AlderDaniel Alder
4,7302 gold badges46 silver badges51 bronze badges