Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/88.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
相对和绝对html路径?_Html - Fatal编程技术网

相对和绝对html路径?

相对和绝对html路径?,html,Html,html格式的代码片段如下所示。 下面列出了三项要求供参考 <!DOCTYPE html> <html lang="en"> <head> <title>Images and Links - Fast Broccoli!</title> </head> <body> <div class="content">

html格式的代码片段如下所示。 下面列出了三项要求供参考

   <!DOCTYPE html>
    <html lang="en">
    <head>
        <title>Images and Links - Fast Broccoli!</title>
    </head>
    <body>
        <div class="content">
            <h1>Fast Broccoli! - About Us</h1>
            <!--
                Use images and links to build an "About Us" page for Fast Broccoli!,
                the world's first one-hour organic produce delivery service.

            You'll need:
            1. A main image with source: https://upload.wikimedia.org/wikipedia/commons/0/03/Broccoli_and_cross_section_edit.jpg
                  and alt description: Fast Broccoli!'s Logo
            2. A link to the relative path: index.html
                with the text: Return Home
            3. A second link to the absolute path: https://shop.fastbrocolli.com
                The link should target a new browser window.
                The link should contain an image
                    with source: images/cabbage.png
                   -->
        </div>
    </body>
    </html>

图片和链接-快速西兰花!
快速西兰花!-关于我们
这看起来很奇怪,像是一个学校项目。我可以为你的作业提供解决方案,但我相信如果你学会它会更好。 希望你喜欢

图像标签 下面是一个示例
img
标签,来自:

如果它以正斜杠(
/
)开头,它将获取站点的域并添加到其中。(不那么简单,它告诉浏览器文件在站点的根目录中)

示例:如果我在此页面上添加了如下链接:

<a href="hi.html">Click me</a>
 
It would go to:
https://stackoverflow.com/questions/47361572/relative-and-absolute-html-path/hi.html

Because:
https://stackoverflow.com/questions/47361572/relative-and-absolute-html-path + hi.html
<a href="/hi.html">Click me</a>
 
It would go to:
https://stackoverflow.com/hi.html

Because:
https://stackoverflow.com + hi.html
<a href="http://example.com/">Click me</a>
 
It would go to:
http://example.com/

Because it begins with http://

它将走向:
https://stackoverflow.com/hi.html
因为:
https://stackoverflow.com +你好
绝对的 绝对路径是绝对的。它没有添加到末尾,而是一个全新的域

示例:如果我在此页面上添加了如下链接:

<a href="hi.html">Click me</a>
 
It would go to:
https://stackoverflow.com/questions/47361572/relative-and-absolute-html-path/hi.html

Because:
https://stackoverflow.com/questions/47361572/relative-and-absolute-html-path + hi.html
<a href="/hi.html">Click me</a>
 
It would go to:
https://stackoverflow.com/hi.html

Because:
https://stackoverflow.com + hi.html
<a href="http://example.com/">Click me</a>
 
It would go to:
http://example.com/

Because it begins with http://

它将走向:
http://example.com/
因为它以http开头://
笔记 在所有的例子中,链接的文本都是“点击我”

更多信息

更多信息请访问。(允许你“瞄准一个新的浏览器窗口”。

这看起来像一个学校项目。我可以为你的作业提供解决方案,但我相信如果你学会它会更好。 希望你喜欢

图像标签 下面是一个示例
img
标签,来自:

如果它以正斜杠(
/
)开头,它将获取站点的域并添加到其中。(不那么简单,它告诉浏览器文件在站点的根目录中)

示例:如果我在此页面上添加了如下链接:

<a href="hi.html">Click me</a>
 
It would go to:
https://stackoverflow.com/questions/47361572/relative-and-absolute-html-path/hi.html

Because:
https://stackoverflow.com/questions/47361572/relative-and-absolute-html-path + hi.html
<a href="/hi.html">Click me</a>
 
It would go to:
https://stackoverflow.com/hi.html

Because:
https://stackoverflow.com + hi.html
<a href="http://example.com/">Click me</a>
 
It would go to:
http://example.com/

Because it begins with http://

它将走向:
https://stackoverflow.com/hi.html
因为:
https://stackoverflow.com +你好
绝对的 绝对路径是绝对的。它没有添加到末尾,而是一个全新的域

示例:如果我在此页面上添加了如下链接:

<a href="hi.html">Click me</a>
 
It would go to:
https://stackoverflow.com/questions/47361572/relative-and-absolute-html-path/hi.html

Because:
https://stackoverflow.com/questions/47361572/relative-and-absolute-html-path + hi.html
<a href="/hi.html">Click me</a>
 
It would go to:
https://stackoverflow.com/hi.html

Because:
https://stackoverflow.com + hi.html
<a href="http://example.com/">Click me</a>
 
It would go to:
http://example.com/

Because it begins with http://

它将走向:
http://example.com/
因为它以http开头://
笔记 在所有的例子中,链接的文本都是“点击我”

更多信息

更多信息请访问。(允许您“以新浏览器窗口为目标”。

我收到此错误“我无法使用src=”找到您的主图像”https://upload.wikimedia.org/wikipedia/commons/0/03/Broccoli_and_cross_section_edit.jpg“。请添加它。”

快速西兰花!-关于我们
我收到这个错误“我找不到src=的主映像”https://upload.wikimedia.org/wikipedia/commons/0/03/Broccoli_and_cross_section_edit.jpg“。请添加它。”

快速西兰花!-关于我们

老实说,看起来你想让我们帮你做作业。这里连一个问题都没有。老实说,看起来你想让我们帮你做作业。这里甚至没有一个问题。这里不需要``或者曾经需要(除非转义特殊字符)。这里不需要``或者曾经需要(除非转义特殊字符)。
/
不是相对的吗?我认为它被认为是根相对的,而不是文档相对的?即使以
/
开始一个路径也是一个相对路径(相对于文档的根,它位于文件系统某处的某个文件夹中),这是我的观点。“绝对路径以正斜杠(/)开头”不正确。这是根相对路径<代码>/与文档相关
http://
c://
是绝对的,也就是说,我知道这个想法会从unix文件系统中产生。尽管如此,答案还是很好。但是如果我们谈论的是web服务器,
/
会将您带到公共目录的根目录下。。。不是实际文件系统的根。所以它仍然是一个相对路径,只是相对于传入请求映射到的文件夹的根。值得深思。回答得很好,我只是吹毛求疵&我想你会想知道的。见鬼,我可能错了:)@admcfajn-Gotcha!谢谢你的帮助。清除显示
/images/picture.jpg
是相对的。
/
不是相对的吗?我认为它被认为是根相对的,而不是文档相对的?即使以
/
开始一个路径也是一个相对路径(相对于文档的根,它位于文件系统某处的某个文件夹中),这是我的观点。“绝对路径以正斜杠(/)开头”不正确。这是根相对路径<代码>/与文档相关
http://
c://
是绝对的,也就是说,我知道这个想法会从unix文件系统中产生。尽管如此,答案还是很好。但是如果我们谈论的是web服务器,
/
会将您带到公共目录的根目录下。。。不是实际文件系统的根。所以它仍然是一个相对路径,只是相对于传入请求映射到的文件夹的根。值得深思。回答得很好,我只是吹毛求疵&我想你会想知道的。见鬼,我可能错了:)@admcfajn-Gotcha!谢谢你的帮助。清除显示
/images/picture.jpg
是相对的。