<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>相对路径</title>
	<atom:link href="https://www.aitaocui.cn/tag/268589/feed" rel="self" type="application/rss+xml" />
	<link>https://www.aitaocui.cn</link>
	<description>翡翠玉石爱好者聚集地</description>
	<lastBuildDate>Tue, 29 Nov 2022 05:43:15 +0000</lastBuildDate>
	<language>zh-CN</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.1</generator>

<image>
	<url>https://www.aitaocui.cn/wp-content/uploads/2022/11/taocui.png</url>
	<title>相对路径</title>
	<link>https://www.aitaocui.cn</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>相对路径(源文件所在目录的上级目录)</title>
		<link>https://www.aitaocui.cn/article/380956.html</link>
					<comments>https://www.aitaocui.cn/article/380956.html#respond</comments>
		
		<dc:creator><![CDATA[飞翔的荷兰人号]]></dc:creator>
		<pubDate>Tue, 29 Nov 2022 05:43:15 +0000</pubDate>
				<category><![CDATA[知识]]></category>
		<category><![CDATA[相对路径]]></category>
		<guid isPermaLink="false">https://www.aitaocui.cn/?p=380956</guid>

					<description><![CDATA[相对路径就是指由这个文件所在的路径引起的跟其它文件（或文件夹）的路径关系。使用相对路径可以为我们带来非常多的便利。 绝对路径是指目录下的绝对位置，直接到达目标位置，通常是从盘符开始...]]></description>
										<content:encoded><![CDATA[</p>
<article>
<p>相对路径就是指由这个文件所在的路径引起的跟其它文件（或文件夹）的路径关系。使用相对路径可以为我们带来非常多的便利。 绝对路径是指目录下的绝对位置，直接到达目标位置，通常是从盘符开始的路径。完整的描述文件位置的路径就是绝对路径。使用相对路径可以为我们带来非常多的便利，且实验证明相对路径在搜索引擎中表现良好。HTML初学者会经常遇到这样一个问题，如何正确引用一个文件。为了避免这些错误，正确地引用文件，我们需要学习一下HTML路径。表示源文件所在目录的上一级目录，以此类推。HTML绝对路径(absolute path)指带域名的文件的完整路径。</p>
</article>
<article>
<h1>路径</h1>
<p>下面举实例详解：</p>
<p>一、例如在本地硬盘有如下两文件，它们要互做超链接</p>
<p>如下图所示：</p>
<p>index.htm要想链接到01.htm这个文件，正确的链接应该是：</p>
<p>反过来，01.htm要想链接到index.htm这个文件，在01.htm文件里面应该写上这句：</p>
<p>这里的 ../ 表示向上一级。</p>
<p>至此，你已经了解相对路径的概念了。</p>
<p>注意：相对路径的文件夹符号是斜杠：</p>
<p>链接文字这样的链接，在href后面的第一个斜杠表示根目录，通常我们要特别慎用这种方式。</p>
<h1>HTML术语</h1>
<h2 id="a-c99cf86d">HTML相对路径</h2>
<p>HTML相对路径(Relative Path)和绝对路径(Absolute Path)</p>
<p>HTML初学者会经常遇到这样一个问题，如何正确引用一个文件。比如，怎样在一个HTML网页中引用另外一个HTML网页作为超链接(hyperlink)？怎样在一个网页中插入一张图片？</p>
<p>如果你在引用文件时(如加入超链接，或者插入图片等)，使用了错误的文件路径，就会导致引用失效(无法浏览链接文件，或无法显示插入的图片等)。为了避免这些错误，正确地引用文件，我们需要学习一下HTML路径。</p>
<p>HTML有2种路径的写法：相对路径和绝对路径。</p>
<h2 id="a-c8bc3f77">同目录文件引用</h2>
<p>代表目前所在的目录。</p>
<p>我们现在建一个源文件info.html，在info.html里要引用index.html文件作为超链接。</p>
<p>假设index.html路径是：c://Inetpub//wwwroot//sites//blabla//index.html</p>
<p>html文件作为超链接。c://Inetpub//wwwroot.</p>
<p>index.html</p>
<p>其实，可以省略&quot;./&quot;直接引用。</p>
<h2 id="a-27122954">表示上级目录</h2>
<p>假设index.html路径是：c://Inetpub//wwwroot//sites//index.html</p>
<p>index.html</p>
<p>假设index.html路径是：c://Inetpub//wwwroot//index.html</p>
<p>index.html</p>
<p>假设index.html路径是：c://Inetpub//wwwroot//sites//wowstory//index.html</p>
<p>html路径是：c://Inetpub//wwwroot//sites.</p>
<p>index.html</p>
<h2 id="a-98cfd46c">表示下级目录</h2>
<p>引用下级目录的文件，直接写下级目录文件的路径即可。</p>
<p>假设index.html路径是：c://Inetpub//wwwroot//sites//blabla//html//index.html</p>
<p>index.html</p>
<p>假设index.html路径是：c://Inetpub//wwwroot//sites//blabla//html//tutorials//index.html</p>
<p>在info.html加入index.html超链接的代码应该这样写：</p>
<p>index.html</p>
<h2 id="a-9c2260cd">HTML绝对路径</h2>
<p>HTML绝对路径(absolute path)指带域名的文件的完整路径。</p>
<p>表示源文件所在目录的上上级目录，以此类推。正确地引用文件，我们需要学习一下HTML路径。</p>
<p>假设你注册了域名sosobaikewww.seo-xy . com，并申请了虚拟主机，你的虚拟主机提供商会给你一个目录，比如www，这个www就是你网站的根目录。</p>
<p>假设你在www根目录下放了一个文件index.html，这个文件的绝对路径就是： sosobaikewww.seo-xy .com/index.html假设你在www根目录下建了一个目录叫archives，然后在该目录下放了一个文件index.html，这个文件的绝对路径就是baidu。baikewww.seo-xy. com/archives/206.html。</p>
<h1>相关附注</h1>
<p>经过多次真实实验，证明：绝对路径不利于搜索引擎表现，相对路径在搜索引擎中表现良好。</p>
</article>
<div class="mt-3 mb-3" style="max-width: 770px;height: auto;">
                                    </div>
<div class="mt-3 mb-3" style="max-width: 770px;height: auto;">
                                    </div>
<div class="mt-3 mb-3" style="max-width: 770px;height: auto;">
                                    </div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.aitaocui.cn/article/380956.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
