html 链接不起作用(使用 base href) [英] html links not working (using base href)

查看:113
本文介绍了html 链接不起作用(使用 base href)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用这个标签:

<base href="http://awebsite.ca/" target=" />

与此标签相关联:

<a href="main_page/mainpage.html"><br><b>main</b></br></a>

并在浏览器中获取:

http://awebsite.ca/“main_page/mainpage.htmlâ€%C2%9D

推荐答案

你必须用 " (QUOTATION MARK) 或 ' (APOSTROPHE) 来引用属性值,而不是(左双引号)和"(右双引号).

You have to quote attribute values with " (QUOTATION MARK) or ' (APOSTROPHE), not " (LEFT DOUBLE QUOTATION MARK) and " (RIGHT DOUBLE QUOTATION MARK).

这种类型的错误通常是由于使用文字处理器(例如 Microsoft Word 或 Apple Pages)编写代码并启用自动替换引号和印刷引号(又名智能引号)引起的.尝试改用文本编辑器(例如 Visual Studio Code、Sublime Text、Komodo Edit、Emacs 或 Vim).

This type of error is typically caused by writing code using a word processor (such as Microsoft Word or Apple Pages) with automatic replacement of quotes with typographic quotes (aka Smart Quotes) enabled. Try using a text editor (such as Visual Studio Code, Sublime Text, Komodo Edit, Emacs, or Vim) instead.

此错误的另一个常见原因是从网站复制/粘贴代码,在该网站上,作者让 WordProcess CMS 或类似工具以与文字处理器相同的方式处理其输入.仔细检查您正在复制/粘贴的代码.

The other common cause for this error is copy/pasting code from a website where the author has let a WordProcess CMS or similar mangle their input in the same way as a word processor. Check code you are copy/pasting carefully.

这篇关于html 链接不起作用(使用 base href)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆