 
    
<?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>hyperlinks Archives - Complete, Concrete, Concise</title>
	<atom:link href="https://complete-concrete-concise.com/tag/hyperlinks/feed/" rel="self" type="application/rss+xml" />
	<link>https://complete-concrete-concise.com/tag/hyperlinks/</link>
	<description>Practical Information Without The Bloat</description>
	<lastBuildDate>Sun, 12 Mar 2023 13:32:13 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>
	<item>
		<title>A Recipe Example with Hyperlinks</title>
		<link>https://complete-concrete-concise.com/tutorials/webdev/front-end-basics/a-recipe-example-with-hyperlinks/</link>
		
		<dc:creator><![CDATA[richardsplanet]]></dc:creator>
		<pubDate>Mon, 02 Apr 2018 19:37:07 +0000</pubDate>
				<category><![CDATA[Front-End Basics]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[hyperlinks]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[webdev]]></category>
		<guid isPermaLink="false">https://complete-concrete-concise.com/?p=3531</guid>

					<description><![CDATA[<p>The previous recipe example updated to include hyperlinks to create a table of contents.</p>
<p>The post <a href="https://complete-concrete-concise.com/tutorials/webdev/front-end-basics/a-recipe-example-with-hyperlinks/">A Recipe Example with Hyperlinks</a> appeared first on <a href="https://complete-concrete-concise.com">Complete, Concrete, Concise</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div class="preamble">
The previous sample recipe<a id="fnref1" class="footnote-ref" href="#fn1"><sup>1</sup></a> page updated to use hyperlinks.
</div>
<h2>Contents</h2>
<ol type="1">
<li><a href="#a-sample-recipe-page">A Sample Recipe Page</a></li>
<li><a href="#the-source-code">The Source Code</a></li>
<li><a href="#notes">Notes</a></li>
</ol>
<h2 id="a-sample-recipe-page">A Sample Recipe Page</h2>
<p>You can see how the page looks <a href="https://complete-concrete-concise.com/sample/11-recipe.html">here</a>.</p>
<h2 id="the-source-code">The Source Code</h2>
<div id="cb1" class="sourceCode">
<pre class="sourceCode html" style="white-space: pre-wrap;"><code class="sourceCode html" style="white-space: pre-wrap;"><a id="cb1-1" class="sourceLine" data-line-number="1"></a><span class="dt">&lt;!DOCTYPE </span>HTML<span class="dt">&gt;</span>
<a id="cb1-2" class="sourceLine" data-line-number="2"></a><span class="kw">&lt;html&gt;</span>
<a id="cb1-3" class="sourceLine" data-line-number="3"></a>  <span class="kw">&lt;head&gt;</span>
<a id="cb1-4" class="sourceLine" data-line-number="4"></a>    <span class="kw">&lt;title&gt;</span>Roasted Swordfish<span class="kw">&lt;/title&gt;</span>
<a id="cb1-5" class="sourceLine" data-line-number="5"></a>    <span class="kw">&lt;meta</span><span class="ot"> charset=</span><span class="st">"utf-8"</span>  <span class="kw">/&gt;</span>
<a id="cb1-6" class="sourceLine" data-line-number="6"></a>  <span class="kw">&lt;/head&gt;</span>
<a id="cb1-7" class="sourceLine" data-line-number="7"></a>  <span class="kw">&lt;body&gt;</span>
<a id="cb1-8" class="sourceLine" data-line-number="8"></a>
<a id="cb1-9" class="sourceLine" data-line-number="9"></a>    <span class="kw">&lt;h1&gt;</span>Roasted Swordfish with Manzanilla Olives, Cherry
<a id="cb1-10" class="sourceLine" data-line-number="10"></a>       Tomatoes, and Capers<span class="kw">&lt;/h1&gt;</span>
<a id="cb1-11" class="sourceLine" data-line-number="11"></a>
<a id="cb1-12" class="sourceLine" data-line-number="12"></a>    <span class="kw">&lt;img</span><span class="ot"> src=</span><span class="st">"roasted-swordfish.jpg"</span>
<a id="cb1-13" class="sourceLine" data-line-number="13"></a><span class="ot">      alt=</span><span class="st">"Image of roasted swordfish with olives."</span><span class="kw">&gt;</span>
<a id="cb1-14" class="sourceLine" data-line-number="14"></a>
<a id="cb1-15" class="sourceLine" data-line-number="15"></a>    <span class="kw">&lt;h2&gt;</span>Table of Contents<span class="kw">&lt;/h2&gt;</span>
<a id="cb1-16" class="sourceLine" data-line-number="16"></a>    <span class="kw">&lt;ol&gt;</span>
<a id="cb1-17" class="sourceLine" data-line-number="17"></a>      <span class="kw">&lt;li&gt;&lt;a</span><span class="ot"> href=</span><span class="st">"#ingredients"</span><span class="kw">&gt;</span>Ingredients<span class="kw">&lt;/a&gt;&lt;/li&gt;</span>
<a id="cb1-18" class="sourceLine" data-line-number="18"></a>      <span class="kw">&lt;li&gt;&lt;a</span><span class="ot"> href=</span><span class="st">"#preparation"</span><span class="kw">&gt;</span>Preparation<span class="kw">&lt;/a&gt;&lt;/li&gt;</span>
<a id="cb1-19" class="sourceLine" data-line-number="19"></a>        <span class="kw">&lt;ol&gt;</span>
<a id="cb1-20" class="sourceLine" data-line-number="20"></a>          <span class="kw">&lt;li&gt;&lt;a</span><span class="ot"> href=</span><span class="st">"#the-sauce"</span><span class="kw">&gt;</span>The Sauce<span class="kw">&lt;/a&gt;&lt;/li&gt;</span>
<a id="cb1-21" class="sourceLine" data-line-number="21"></a>          <span class="kw">&lt;li&gt;</span>
<a id="cb1-22" class="sourceLine" data-line-number="22"></a>            <span class="kw">&lt;a</span><span class="ot"> href=</span><span class="st">"#the-swordfish"</span><span class="kw">&gt;</span>The Swordfish<span class="kw">&lt;/a&gt;</span>
<a id="cb1-23" class="sourceLine" data-line-number="23"></a>          <span class="kw">&lt;/li&gt;</span>
<a id="cb1-24" class="sourceLine" data-line-number="24"></a>          <span class="kw">&lt;li&gt;</span>
<a id="cb1-25" class="sourceLine" data-line-number="25"></a>            <span class="kw">&lt;a</span><span class="ot"> href=</span><span class="st">"#assembling-it"</span><span class="kw">&gt;</span>Assembling it<span class="kw">&lt;/a&gt;</span>
<a id="cb1-26" class="sourceLine" data-line-number="26"></a>          <span class="kw">&lt;/li&gt;</span>
<a id="cb1-27" class="sourceLine" data-line-number="27"></a>        <span class="kw">&lt;/ol&gt;</span>
<a id="cb1-28" class="sourceLine" data-line-number="28"></a>      <span class="kw">&lt;/li&gt;</span>
<a id="cb1-29" class="sourceLine" data-line-number="29"></a>    <span class="kw">&lt;/ol&gt;</span>
<a id="cb1-30" class="sourceLine" data-line-number="30"></a>
<a id="cb1-31" class="sourceLine" data-line-number="31"></a>    <span class="kw">&lt;h2</span><span class="ot"> id=</span><span class="st">"ingredients"</span><span class="kw">&gt;</span>Ingredients<span class="kw">&lt;/h2&gt;</span>
<a id="cb1-32" class="sourceLine" data-line-number="32"></a>
<a id="cb1-33" class="sourceLine" data-line-number="33"></a>    <span class="kw">&lt;ul&gt;</span>
<a id="cb1-34" class="sourceLine" data-line-number="34"></a>      <span class="kw">&lt;li&gt;</span>4 six-ounce portions of swordfish, each about
<a id="cb1-35" class="sourceLine" data-line-number="35"></a>        one inch thick<span class="kw">&lt;/li&gt;</span>
<a id="cb1-36" class="sourceLine" data-line-number="36"></a>      <span class="kw">&lt;li&gt;</span>1 cup Manzanilla olives<span class="kw">&lt;/li&gt;</span>
<a id="cb1-37" class="sourceLine" data-line-number="37"></a>      <span class="kw">&lt;li&gt;</span>4 cups of peeled cherry tomatoes in juice<span class="kw">&lt;/li&gt;</span>
<a id="cb1-38" class="sourceLine" data-line-number="38"></a>      <span class="kw">&lt;li&gt;</span>4 teaspoons capers, rinsed<span class="kw">&lt;/li&gt;</span>
<a id="cb1-39" class="sourceLine" data-line-number="39"></a>      <span class="kw">&lt;li&gt;</span>2 cloves garlic, sliced<span class="kw">&lt;/li&gt;</span>
<a id="cb1-40" class="sourceLine" data-line-number="40"></a>      <span class="kw">&lt;li&gt;</span>2 lemons juiced<span class="kw">&lt;/li&gt;</span>
<a id="cb1-41" class="sourceLine" data-line-number="41"></a>      <span class="kw">&lt;li&gt;</span>1 cup loosely packed parsley leaves<span class="kw">&lt;/li&gt;</span>
<a id="cb1-42" class="sourceLine" data-line-number="42"></a>      <span class="kw">&lt;li&gt;</span>Olive oil<span class="kw">&lt;/li&gt;</span>
<a id="cb1-43" class="sourceLine" data-line-number="43"></a>      <span class="kw">&lt;li&gt;</span>Salt and pepper<span class="kw">&lt;/li&gt;</span>
<a id="cb1-44" class="sourceLine" data-line-number="44"></a>    <span class="kw">&lt;/ul&gt;</span>
<a id="cb1-45" class="sourceLine" data-line-number="45"></a>
<a id="cb1-46" class="sourceLine" data-line-number="46"></a>    <span class="kw">&lt;h2</span><span class="ot"> id=</span><span class="st">preparation</span><span class="kw">&gt;</span>Preparation<span class="kw">&lt;/h2&gt;</span>
<a id="cb1-47" class="sourceLine" data-line-number="47"></a>
<a id="cb1-48" class="sourceLine" data-line-number="48"></a>    <span class="kw">&lt;h3</span><span class="ot"> id=</span><span class="st">"the-sauce"</span><span class="kw">&gt;</span>The Sauce<span class="kw">&lt;/h3&gt;</span>
<a id="cb1-49" class="sourceLine" data-line-number="49"></a>    <span class="kw">&lt;ol&gt;</span>
<a id="cb1-50" class="sourceLine" data-line-number="50"></a>      <span class="kw">&lt;li&gt;</span>Heat ¼ cup olive oil in a high sided pot over
<a id="cb1-51" class="sourceLine" data-line-number="51"></a>        medium heat.<span class="kw">&lt;/li&gt;</span>
<a id="cb1-52" class="sourceLine" data-line-number="52"></a>      <span class="kw">&lt;li&gt;</span>Peel and slice the garlic and add it to the
<a id="cb1-53" class="sourceLine" data-line-number="53"></a>        warm oil.<span class="kw">&lt;/li&gt;</span>
<a id="cb1-54" class="sourceLine" data-line-number="54"></a>      <span class="kw">&lt;li&gt;</span>Sauté until the garlic is tender, not browned,
<a id="cb1-55" class="sourceLine" data-line-number="55"></a>        then add the tomatoes and cook until the tomato
<a id="cb1-56" class="sourceLine" data-line-number="56"></a>        liquid has reduce by half, about 20 minutes.<span class="kw">&lt;/li&gt;</span>
<a id="cb1-57" class="sourceLine" data-line-number="57"></a>      <span class="kw">&lt;li&gt;</span>Add the Manzanilla olives, capers, the juice of
<a id="cb1-58" class="sourceLine" data-line-number="58"></a>        one lemon, parsley, and salt and pepper if needed.
<a id="cb1-59" class="sourceLine" data-line-number="59"></a>      <span class="kw">&lt;/li&gt;</span>
<a id="cb1-60" class="sourceLine" data-line-number="60"></a>      <span class="kw">&lt;li&gt;</span>Set aside and keep warm until the swordfish is
<a id="cb1-61" class="sourceLine" data-line-number="61"></a>        cooked.<span class="kw">&lt;/li&gt;</span>
<a id="cb1-62" class="sourceLine" data-line-number="62"></a>    <span class="kw">&lt;/ol&gt;</span>
<a id="cb1-63" class="sourceLine" data-line-number="63"></a>
<a id="cb1-64" class="sourceLine" data-line-number="64"></a>
<a id="cb1-65" class="sourceLine" data-line-number="65"></a>    <span class="kw">&lt;h3</span><span class="ot"> id=</span><span class="st">"the-swordfish"</span><span class="kw">&gt;</span>The Swordfish<span class="kw">&lt;/h3&gt;</span>
<a id="cb1-66" class="sourceLine" data-line-number="66"></a>    <span class="kw">&lt;ol</span><span class="ot"> start=</span><span class="st">"6"</span><span class="kw">&gt;</span>
<a id="cb1-67" class="sourceLine" data-line-number="67"></a>    <span class="kw">&lt;li&gt;</span>Season the swordfish with salt and pepper.<span class="kw">&lt;/li&gt;</span>
<a id="cb1-68" class="sourceLine" data-line-number="68"></a>    <span class="kw">&lt;li&gt;</span>Heat a large sauté pan over medium high heat
<a id="cb1-69" class="sourceLine" data-line-number="69"></a>      and add about 1/4 cup olive oil.<span class="kw">&lt;/li&gt;</span>
<a id="cb1-70" class="sourceLine" data-line-number="70"></a>    <span class="kw">&lt;li&gt;</span>When very hot add the swordfish and cook until
<a id="cb1-71" class="sourceLine" data-line-number="71"></a>      both sides are golden brown, about 3-4 minutes
<a id="cb1-72" class="sourceLine" data-line-number="72"></a>      per side.<span class="kw">&lt;/li&gt;</span>
<a id="cb1-73" class="sourceLine" data-line-number="73"></a>    <span class="kw">&lt;li&gt;</span>Set aside on paper towels to absorb any excess
<a id="cb1-74" class="sourceLine" data-line-number="74"></a>      oil.<span class="kw">&lt;/li&gt;</span>
<a id="cb1-75" class="sourceLine" data-line-number="75"></a>    <span class="kw">&lt;/ol&gt;</span>
<a id="cb1-76" class="sourceLine" data-line-number="76"></a>
<a id="cb1-77" class="sourceLine" data-line-number="77"></a>    <span class="kw">&lt;h3</span><span class="ot"> id=</span><span class="st">"assembling-it"</span><span class="kw">&gt;</span>Assembling it<span class="kw">&lt;/h3&gt;</span>
<a id="cb1-78" class="sourceLine" data-line-number="78"></a>    <span class="kw">&lt;ol</span><span class="ot"> start=</span><span class="st">"10"</span><span class="kw">&gt;</span>
<a id="cb1-79" class="sourceLine" data-line-number="79"></a>    <span class="kw">&lt;li&gt;</span>As the swordfish comes out of the sauté pan,
<a id="cb1-80" class="sourceLine" data-line-number="80"></a>      divide the sauce between four warm dinner plates.
<a id="cb1-81" class="sourceLine" data-line-number="81"></a>    <span class="kw">&lt;/li&gt;</span>
<a id="cb1-82" class="sourceLine" data-line-number="82"></a>    <span class="kw">&lt;li&gt;</span>Place one piece of fish on each plate.<span class="kw">&lt;/li&gt;</span>
<a id="cb1-83" class="sourceLine" data-line-number="83"></a>    <span class="kw">&lt;li&gt;</span>Squeeze some lemon on each piece of fish and
<a id="cb1-84" class="sourceLine" data-line-number="84"></a>      serve while hot.<span class="kw">&lt;/li&gt;</span>
<a id="cb1-85" class="sourceLine" data-line-number="85"></a>    <span class="kw">&lt;/ol&gt;</span>
<a id="cb1-86" class="sourceLine" data-line-number="86"></a>
<a id="cb1-87" class="sourceLine" data-line-number="87"></a>    <span class="kw">&lt;p&gt;</span>----------<span class="kw">&lt;/p&gt;</span>
<a id="cb1-88" class="sourceLine" data-line-number="88"></a>    <span class="kw">&lt;h2&gt;</span>Credits<span class="kw">&lt;/h2&gt;</span>
<a id="cb1-89" class="sourceLine" data-line-number="89"></a>    <span class="kw">&lt;p&gt;</span>Recipe courtesy of <span class="kw">&lt;a</span><span class="ot"> href=</span><span class="st">"http://www.foodista.com/recipe/727C67X3/roasted-swordfish-with-manzanilla-olives-cherry-tomatoes-and-capers"</span><span class="ot"> target=</span><span class="st">"_blank"</span><span class="kw">&gt;</span>Foodista<span class="kw">&lt;/a&gt;</span> (opens in a new tab).<span class="kw">&lt;/p&gt;</span>
<a id="cb1-90" class="sourceLine" data-line-number="90"></a>    <span class="kw">&lt;p&gt;</span>License: <span class="kw">&lt;a</span><span class="ot"> href=</span><span class="st">"https://creativecommons.org/licenses/by/3.0/"</span><span class="ot"> target</span> <span class="ot">=</span><span class="st">"_blank"</span><span class="kw">&gt;</span>CC-BY-3.0<span class="kw">&lt;/a&gt;</span> (opens in a new tab).<span class="kw">&lt;/p&gt;</span>
<a id="cb1-91" class="sourceLine" data-line-number="91"></a>    <span class="kw">&lt;p&gt;&lt;a</span><span class="ot"> href=</span><span class="st">"/sample/roasted-swordfish.jpg"</span><span class="ot"> download</span><span class="kw">&gt;</span>Download<span class="kw">&lt;/a&gt;</span> the image.<span class="kw">&lt;/p&gt;</span>
<a id="cb1-92" class="sourceLine" data-line-number="92"></a>  <span class="kw">&lt;/body&gt;</span>
<a id="cb1-93" class="sourceLine" data-line-number="93"></a><span class="kw">&lt;/html&gt;</span></code></pre>
</div>
<h2 id="notes">Notes</h2>
<ol type="1">
<li>An <span class="kbd">h1</span> tag was used for the title on the page.</li>
<li>The content of the document was divided into two sections: Ingredients and Preparation using <span class="kbd">h2</span> tags.</li>
<li>The preparation section was divided into three sections using <span class="kbd">h3</span> tags.</li>
<li>The ingredients were listed using an <strong>unordered list</strong>.</li>
<li>The directions were listed using an <strong>ordered list</strong>.</li>
<li>For numbering continuity, the <strong>start</strong> attribute was used.</li>
<li>An image with <strong>alt</strong> text was inserted under the main title.</li>
<li>You can see from the <strong>src</strong> that the image is located in the same directory as the <strong>html</strong> file.</li>
<li>Hyperlinks were used to create a table of contents for the document.</li>
<li>To make it easier and minimize errors, the <strong>ids</strong> for the sections are the same as the name of the section. You don’t have to do this, it is easier to remember that <strong>Ingredients</strong> has the <strong>id</strong> <em>ingredients</em> rather than <em>id1</em></li>
<li>Two hyperlinks, linking to external sites, were created at the bottom of the document. Clicking them opens them in a new window or tab.</li>
<li>One hyperlink to allow you to download the image.</li>
</ol>
<p>Not all the tags we have seen in earlier tutorials were used because they were not needed &#8211; just because there are tags doesn’t mean you <em>have</em> to use them.</p>
<div class="prev">
<a href="https://complete-concrete-concise.com/tutorials/webdev/front-end-basics/hyperlinks-in-html">Prev</a>
</div>
<div class="next">
<a href="https://complete-concrete-concise.com/tutorials/webdev/front-end-basics/html-basic-conclusion">Next</a>
</div>
<div class="clear"></div>
<section class="footnotes">
<hr />
<ol>
<li id="fn1">Recipe and image courtesy of <a href="http://www.foodista.com/recipe/727C67X3/roasted-swordfish-with-manzanilla-olives-cherry-tomatoes-and-capers">Foodista</a> and licensed <a href="https://creativecommons.org/licenses/by/3.0/">CC By 3.0</a><a class="footnote-back" href="#fnref1">↩</a></li>
</ol>
</section>
<p>The post <a href="https://complete-concrete-concise.com/tutorials/webdev/front-end-basics/a-recipe-example-with-hyperlinks/">A Recipe Example with Hyperlinks</a> appeared first on <a href="https://complete-concrete-concise.com">Complete, Concrete, Concise</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Hyperlinks in HTML</title>
		<link>https://complete-concrete-concise.com/tutorials/webdev/front-end-basics/hyperlinks-in-html/</link>
		
		<dc:creator><![CDATA[richardsplanet]]></dc:creator>
		<pubDate>Mon, 02 Apr 2018 13:52:24 +0000</pubDate>
				<category><![CDATA[Front-End Basics]]></category>
		<category><![CDATA[anchor]]></category>
		<category><![CDATA[front-end]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[hyperlinks]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[webdev]]></category>
		<guid isPermaLink="false">https://complete-concrete-concise.com/?p=3512</guid>

					<description><![CDATA[<p>Hyperlinks were the core idea behind the development of the World Wide Web.</p>
<p>The post <a href="https://complete-concrete-concise.com/tutorials/webdev/front-end-basics/hyperlinks-in-html/">Hyperlinks in HTML</a> appeared first on <a href="https://complete-concrete-concise.com">Complete, Concrete, Concise</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div class="preamble">It has taken a while, but we’ve finally gotten to <strong>hyperlinks</strong> &#8211; the core idea behind the World Wide Web.</div>
<p>Hyperlinks are connections between two resources:</p>
<ol type="1">
<li>the current document</li>
<li>and some other resource the user can either navigate to or download</li>
</ol>
<p>The HTML tag is <span class="kbd">&lt;a&gt;</span> and it stands for <strong>anchor</strong>.</p>
<h2>Contents</h2>
<ol type="1">
<li><a href="#a-element"><span class="kbd">&lt;a&gt;</span> Element</a>
<ol type="1">
<li><a href="#href">href</a></li>
<li><a href="#target">target</a></li>
<li><a href="#download">download</a></li>
</ol>
</li>
<li><a href="#practical-considerations">Practical Considerations</a></li>
<li><a href="#summary">Summary</a></li>
<li><a href="#playing-around">Playing Around</a></li>
<li><a href="#references">References</a></li>
</ol>
<h2 id="a-element"><span class="kbd">&lt;a&gt;</span> Element</h2>
<p>As with most HTML tags, hyperlinks are written with a starting <span class="kbd">&lt;a&gt;</span> and ending <span class="kbd">&lt;/a&gt;</span> tags. Contained between those tags is the content that will serve as a hyperlink. Normally, it is some text, however, it can be an image, or any other part of the document which can be contained between the start and end tags.</p>
<div id="cb1" class="sourceCode">
<pre class="sourceCode html"><code class="sourceCode html"><a id="cb1-1" class="sourceLine" data-line-number="1"></a><span class="kw">&lt;a&gt;</span>This is a hyperlink<span class="kw">&lt;/a&gt;</span></code></pre>
</div>
<p>While the example above is a hyperlink, it is non-functional because it does not link to another resource &#8211; it simply defines a link. To make a link functional, we need to add an <strong>attribute</strong> to the <span class="kbd">&lt;a&gt;</span> tag that specifies the URL of the resource.<br />
Using the <strong>anchor</strong> tag in this way indicates that it is a placeholder for a future hyperlink.</p>
<h3 id="href">href</h3>
<p>The <strong>href</strong> attribute stands for <strong>hyperlink reference</strong> and provides the resource URL:</p>
<div id="cb2" class="sourceCode">
<pre class="sourceCode html"><code class="sourceCode html"><a id="cb2-1" class="sourceLine" data-line-number="1"></a><span class="kw">&lt;p&gt;</span>A safe website to use in examples is
<a id="cb2-2" class="sourceLine" data-line-number="2"></a>  <span class="kw">&lt;a</span><span class="ot"> href=</span><span class="st">"http://example.com"</span><span class="kw">&gt;</span>example.com<span class="kw">&lt;/a&gt;</span>
<a id="cb2-3" class="sourceLine" data-line-number="3"></a><span class="kw">&lt;/p&gt;</span></code></pre>
</div>
<p>The URL can be an absolute URL or a relative URL.<br />
An absolute URL is the complete URL, e.g.:</p>
<ul>
<li>http://example.com</li>
<li>https://complete-concrete-concise.com</li>
</ul>
<p>A relative URL is a partial URL relative to the current document location. Relative paths follow the Unix / Linux convention:</p>
<ul>
<li><strong>/</strong> &#8211; the root directory. This is the same as the domain. For example:
<div id="cb3" class="sourceCode">
<pre class="sourceCode html"><code class="sourceCode html"><a id="cb3-1" class="sourceLine" data-line-number="1"></a><span class="kw">&lt;a</span><span class="ot"> href=</span><span class="st">"/"</span><span class="kw">&gt;</span>Take me to the home page<span class="kw">&lt;/a&gt;</span></code></pre>
</div>
<p>will jump to the home page of the domain.</li>
<li><strong>.</strong> – the current path. The paths <strong>image.jpg</strong> and <strong>./image.jpg</strong> both refer to the file <strong>image.jpg</strong> in the current directory. For example:
<div id="cb4" class="sourceCode">
<pre class="sourceCode html"><code class="sourceCode html"><a id="cb4-1" class="sourceLine" data-line-number="1"></a><span class="kw">&lt;a</span><span class="ot"> href=</span><span class="st">"./image.jpg"</span><span class="kw">&gt;</span>Click to load the image.<span class="kw">&lt;/a&gt;</span>
<a id="cb4-2" class="sourceLine" data-line-number="2"></a><span class="kw">&lt;a</span><span class="ot"> href=</span><span class="st">"image.jpg"</span><span class="kw">&gt;</span>Click to load the image.<span class="kw">&lt;/a&gt;</span></code></pre>
</div>
<p>will both load the file <strong>image.jpg</strong> which is located in the same directory (location) as the <strong>.html</strong> file.</li>
<li><strong>..</strong> – one level up. So <strong>../img/image.jpg</strong> refers to the file <strong>image.jpg</strong> which is located in the <strong>img</strong> folder which can be accessed by going up one directory level. In other words, the current directory and the <strong>img</strong> directory are siblings. For example:
<div id="cb5" class="sourceCode">
<pre class="sourceCode html"><code class="sourceCode html"><a id="cb5-1" class="sourceLine" data-line-number="1"></a><span class="kw">&lt;a</span><span class="ot"> href=</span><span class="st">"../img/image.jpg"</span><span class="kw">&gt;</span>Click to load the image<span class="kw">&lt;/a&gt;</span></code></pre>
</div>
<p>will load the file <strong>image.jpg</strong> which is located in the folder <strong>img</strong> which can be accessed by going up one directory level.</li>
</ul>
<p>You have seen that <strong>anchors</strong> can be used to navigate to another page or resource, however, they can also be used to navigate to locations in a document &#8211; the <strong>Table of Contents</strong> at the top of this article is an example.<br />
To navigate to a portion of a document, you need two things:</p>
<ol type="1">
<li>an <strong>identifier</strong> in the document which identifies the location</li>
<li>a <strong>hyperlink</strong> to that identifier.</li>
</ol>
<p>The <strong>identifier</strong> is an attribute you add to an opening HTML tag:</p>
<div id="cb6" class="sourceCode">
<pre class="sourceCode html"><code class="sourceCode html"><a id="cb6-1" class="sourceLine" data-line-number="1"></a><span class="kw">&lt;p</span><span class="ot"> id=</span><span class="st">"jump-here"</span><span class="kw">&gt;</span>Some text we can jump to.<span class="kw">&lt;/p&gt;</span></code></pre>
</div>
<p>The <strong>id</strong> attribute value is <strong>jump-here</strong> and can be used as the value to the <strong>href</strong> attribute. However, there are a few provisos:</p>
<ol type="1">
<li>The <strong>id</strong> value <strong>must</strong> be unique. It is incorrect to have two ids with the same value in the document.</li>
<li>The <strong>id</strong> value <strong>must not</strong> contain spaces.</li>
<li>The <strong>id</strong> value <strong>must</strong> contain at least one character.</li>
<li>To be safe, use only:
<ul>
<li>letters</li>
<li>digits</li>
<li>underscores (_)</li>
<li>hyphens (-)</li>
</ul>
</li>
<li>To be <em>extra</em> safe, ensure the <strong>id</strong> value begins with a letter or underscore (_)</li>
<li>The <strong>id</strong> value is case-insensitive, so, <strong>jump-here</strong> is the same as <strong>JUMP-HERE</strong><a id="fnref1" class="footnote-ref" href="#fn1"><sup>1</sup></a></li>
</ol>
<p>To reference an internal <strong>id</strong> in a link, you need to preface the name with the pound sign (#):</p>
<div id="cb7" class="sourceCode">
<pre class="sourceCode html"><code class="sourceCode html"><a id="cb7-1" class="sourceLine" data-line-number="1"></a><span class="kw">&lt;a</span><span class="ot"> href=</span><span class="st">"#jump-here"</span><span class="kw">&gt;</span>Jump to interesting part<span class="kw">&lt;/a&gt;</span></code></pre>
</div>
<p>We can put this all together and create a simple table of contents:</p>
<div id="cb8" class="sourceCode">
<pre class="sourceCode html"><code class="sourceCode html"><a id="cb8-1" class="sourceLine" data-line-number="1"></a><span class="kw">&lt;h2&gt;</span>Table of Contents<span class="kw">&lt;/h2&gt;</span>
<a id="cb8-2" class="sourceLine" data-line-number="2"></a><span class="kw">&lt;ol&gt;</span>
<a id="cb8-3" class="sourceLine" data-line-number="3"></a>  <span class="kw">&lt;li&gt;&lt;a</span><span class="ot"> href=</span><span class="st">"#topic1"</span><span class="kw">&gt;</span>Topic 1<span class="kw">&lt;/a&gt;&lt;/li&gt;</span>
<a id="cb8-4" class="sourceLine" data-line-number="4"></a>  <span class="kw">&lt;li&gt;&lt;a</span><span class="ot"> href=</span><span class="st">"#topic2"</span><span class="kw">&gt;</span>Topic 2<span class="kw">&lt;/a&gt;&lt;/li&gt;</span>
<a id="cb8-5" class="sourceLine" data-line-number="5"></a>  <span class="kw">&lt;li&gt;&lt;a</span><span class="ot"> href=</span><span class="st">"#topic3"</span><span class="kw">&gt;</span>Topic 3<span class="kw">&lt;/a&gt;&lt;/li&gt;</span>
<a id="cb8-6" class="sourceLine" data-line-number="6"></a>  <span class="kw">&lt;li&gt;&lt;a</span><span class="ot"> href=</span><span class="st">"#topic4"</span><span class="kw">&gt;</span>Topic 4<span class="kw">&lt;/a&gt;&lt;/li&gt;</span>
<a id="cb8-7" class="sourceLine" data-line-number="7"></a><span class="kw">&lt;/ol&gt;</span>
<a id="cb8-8" class="sourceLine" data-line-number="8"></a>
<a id="cb8-9" class="sourceLine" data-line-number="9"></a><span class="kw">&lt;p&gt;</span>Just some padding text, for no other purpose than
<a id="cb8-10" class="sourceLine" data-line-number="10"></a>  having some text.<span class="kw">&lt;/p&gt;</span>
<a id="cb8-11" class="sourceLine" data-line-number="11"></a>
<a id="cb8-12" class="sourceLine" data-line-number="12"></a><span class="kw">&lt;h2</span><span class="ot"> id=</span><span class="st">"topic1"</span><span class="kw">&gt;</span>Topic 1<span class="kw">&lt;/h2&gt;</span>
<a id="cb8-13" class="sourceLine" data-line-number="13"></a>
<a id="cb8-14" class="sourceLine" data-line-number="14"></a><span class="kw">&lt;p&gt;</span>It is nice for each section to have some content.
<a id="cb8-15" class="sourceLine" data-line-number="15"></a>  It doesn't need to be long, just long enough.<span class="kw">&lt;/p&gt;</span>
<a id="cb8-16" class="sourceLine" data-line-number="16"></a>
<a id="cb8-17" class="sourceLine" data-line-number="17"></a><span class="kw">&lt;h2</span><span class="ot"> id=</span><span class="st">"topic2"</span><span class="kw">&gt;</span>Topic 2<span class="kw">&lt;/h2&gt;</span>
<a id="cb8-18" class="sourceLine" data-line-number="18"></a>
<a id="cb8-19" class="sourceLine" data-line-number="19"></a><span class="kw">&lt;p&gt;</span>The content in <span class="kw">&lt;strong&gt;</span>Topic 2<span class="kw">&lt;/strong&gt;</span> should
<a id="cb8-20" class="sourceLine" data-line-number="20"></a>not be the same as in <span class="kw">&lt;strong&gt;</span>Topic 1<span class="kw">&lt;/strong&gt;</span>.<span class="kw">&lt;/p&gt;</span>
<a id="cb8-21" class="sourceLine" data-line-number="21"></a>
<a id="cb8-22" class="sourceLine" data-line-number="22"></a><span class="kw">&lt;h2</span><span class="ot"> id=</span><span class="st">"topic3"</span><span class="kw">&gt;</span>Topic 3<span class="kw">&lt;/h2&gt;</span>
<a id="cb8-23" class="sourceLine" data-line-number="23"></a>
<a id="cb8-24" class="sourceLine" data-line-number="24"></a><span class="kw">&lt;p&gt;</span>After a while, it gets hard to come up with new
<a id="cb8-25" class="sourceLine" data-line-number="25"></a>content. This is why people use <span class="kw">&lt;i&gt;</span>lorem ipsum<span class="kw">&lt;/i&gt;&lt;/p&gt;</span>
<a id="cb8-26" class="sourceLine" data-line-number="26"></a>
<a id="cb8-27" class="sourceLine" data-line-number="27"></a><span class="kw">&lt;h2</span><span class="ot"> id=</span><span class="st">"topic4"</span><span class="kw">&gt;</span>Topic 4<span class="kw">&lt;/h2&gt;</span>
<a id="cb8-28" class="sourceLine" data-line-number="28"></a>
<a id="cb8-29" class="sourceLine" data-line-number="29"></a><span class="kw">&lt;p&gt;</span>Lorem ipsum dolor sit amet, eum invenire erroribus
<a id="cb8-30" class="sourceLine" data-line-number="30"></a>  id. At solum tamquam voluptatum his. Id ius omnis
<a id="cb8-31" class="sourceLine" data-line-number="31"></a>  labitur adipiscing, ut tollit discere deseruisse per.
<a id="cb8-32" class="sourceLine" data-line-number="32"></a>  Ea accumsan reprimique concludaturque eam, ut sed
<a id="cb8-33" class="sourceLine" data-line-number="33"></a>  suas consetetur. Cum imperdiet referrentur in. Usu
<a id="cb8-34" class="sourceLine" data-line-number="34"></a>  postulant philosophia id.<span class="kw">&lt;/p&gt;</span></code></pre>
</div>
<p>Notice that each topic header has a unique id value and to navigate to those ids, we prepend the pound symbol to the name in the <strong>href</strong> attribute.<br />
You can also use <strong>anchors</strong> and <strong>ids</strong> to create footnotes:</p>
<div id="cb9" class="sourceCode">
<pre class="sourceCode html"><code class="sourceCode html"><a id="cb9-1" class="sourceLine" data-line-number="1"></a><span class="kw">&lt;p&gt;</span>Sometimes, it is nice to be able to put
<a id="cb9-2" class="sourceLine" data-line-number="2"></a>  <span class="kw">&lt;a</span><span class="ot"> id=</span><span class="st">"fnref1"</span><span class="ot"> href=</span><span class="st">"#fn1"</span><span class="kw">&gt;</span>footnotes<span class="kw">&lt;/a&gt;</span> in your
<a id="cb9-3" class="sourceLine" data-line-number="3"></a>  documents because the content doesn't really belong
<a id="cb9-4" class="sourceLine" data-line-number="4"></a>  in the main flow of the document<span class="kw">&lt;/p&gt;</span>
<a id="cb9-5" class="sourceLine" data-line-number="5"></a><span class="kw">&lt;p&gt;</span>To see the effect, you will need to copy the next
<a id="cb9-6" class="sourceLine" data-line-number="6"></a>  few paragraphs a many times, so the footnote scrolls
<a id="cb9-7" class="sourceLine" data-line-number="7"></a>  off the bottom of the page.<span class="kw">&lt;/p&gt;</span>
<a id="cb9-8" class="sourceLine" data-line-number="8"></a><span class="kw">&lt;p&gt;</span>Lorem ipsum dolor sit amet, eum invenire erroribus
<a id="cb9-9" class="sourceLine" data-line-number="9"></a>  id. At solum tamquam voluptatum his. Id ius omnis
<a id="cb9-10" class="sourceLine" data-line-number="10"></a>  labitur adipiscing, ut tollit discere deseruisse per.
<a id="cb9-11" class="sourceLine" data-line-number="11"></a>  Ea accumsan reprimique concludaturque eam, ut sed
<a id="cb9-12" class="sourceLine" data-line-number="12"></a>  suas consetetur. Cum imperdiet referrentur in.
<a id="cb9-13" class="sourceLine" data-line-number="13"></a>  Usu postulant philosophia id.<span class="kw">&lt;/p&gt;</span>
<a id="cb9-14" class="sourceLine" data-line-number="14"></a><span class="kw">&lt;p&gt;</span>In mea sumo disputationi. Te pri quodsi laoreet.
<a id="cb9-15" class="sourceLine" data-line-number="15"></a>  Etiam dicta an vis, nec et mnesarchum incorrupte
<a id="cb9-16" class="sourceLine" data-line-number="16"></a>  constituam, facer mandamus sea ei. Sale assum no
<a id="cb9-17" class="sourceLine" data-line-number="17"></a>  vel, id labores inciderint vix. Diam accusata
<a id="cb9-18" class="sourceLine" data-line-number="18"></a>  appellantur cum te, mel ne ornatus eleifend
<a id="cb9-19" class="sourceLine" data-line-number="19"></a>  adversarium.<span class="kw">&lt;/p&gt;</span>
<a id="cb9-20" class="sourceLine" data-line-number="20"></a><span class="kw">&lt;h2&gt;</span>Footnotes<span class="kw">&lt;/h2&gt;</span>
<a id="cb9-21" class="sourceLine" data-line-number="21"></a><span class="kw">&lt;p&gt;</span>----------<span class="kw">&lt;/p&gt;</span>
<a id="cb9-22" class="sourceLine" data-line-number="22"></a><span class="kw">&lt;p</span><span class="ot"> id=</span><span class="st">"fn1"</span><span class="kw">&gt;&lt;strong&gt;</span>1.<span class="kw">&lt;/strong&gt;</span> This is a footnote and
<a id="cb9-23" class="sourceLine" data-line-number="23"></a>  it has a link to return back to your location in the
<a id="cb9-24" class="sourceLine" data-line-number="24"></a>  document.
<a id="cb9-25" class="sourceLine" data-line-number="25"></a>  <span class="kw">&lt;a</span><span class="ot"> href=</span><span class="st">"#fnref1"</span><span class="kw">&gt;</span>↩<span class="kw">&lt;/a&gt;</span>
<a id="cb9-26" class="sourceLine" data-line-number="26"></a><span class="kw">&lt;/p&gt;</span></code></pre>
</div>
<p>I didn’t do a traditional footnote with the little superscript<a id="fnref2" class="footnote-ref" href="#fn2"><sup>2</sup></a> because we haven’t covered the tag yet. Nevertheless, you can see that it is possible to:</p>
<ol type="1">
<li>create a footnote (or just notes) section in your documents</li>
<li>jump or navigate to those sections</li>
<li>return to the location were the jump was made from.</li>
<li>add <strong>ids</strong> to <strong>anchor</strong> tags and navigate to them</li>
</ol>
<p>You can also navigate to a specific location in any document by appending the <strong>id</strong> to the URL:</p>
<div id="cb11" class="sourceCode">
<pre class="sourceCode html"><code class="sourceCode html"><a id="cb11-1" class="sourceLine" data-line-number="1"></a><span class="kw">&lt;a</span><span class="ot"> href=</span><span class="st">"http://example.com/index.html#reference"</span><span class="kw">&gt;</span>
<a id="cb11-2" class="sourceLine" data-line-number="2"></a>  Reference material
<a id="cb11-3" class="sourceLine" data-line-number="3"></a><span class="kw">&lt;/a&gt;</span></code></pre>
</div>
<p>The code fragment above, creates a hyperlink which instructs the browser to load the document <strong>index.html</strong> from the domain <strong>example.com</strong> and to jump to the location on the page having an <strong>id</strong> with the value of <em>reference</em>.</p>
<h3 id="target">target</h3>
<p>By default, clicking on a hyperlink loads the resource into the current context (i.e. your current browser window or tab).<br />
Setting the attribute <strong>target</strong> to “_blank” will cause the resource to open in a new window or tab:</p>
<div id="cb12" class="sourceCode">
<pre class="sourceCode html"><code class="sourceCode html"><a id="cb12-1" class="sourceLine" data-line-number="1"></a><span class="kw">&lt;a</span><span class="ot"> href=</span><span class="st">"http://example.com"</span><span class="ot"> target=</span><span class="st">"_blank"</span><span class="kw">&gt;</span>Click to
<a id="cb12-2" class="sourceLine" data-line-number="2"></a>  open in a new window or tab.<span class="kw">&lt;/a&gt;</span></code></pre>
</div>
<h3 id="download">download</h3>
<p>Sometimes, you want a hyperlink to download a resource instead of loading it. This can be done using the <strong>download</strong> attribute:</p>
<div id="cb13" class="sourceCode">
<pre class="sourceCode html"><code class="sourceCode html"><a id="cb13-1" class="sourceLine" data-line-number="1"></a><span class="kw">&lt;a</span><span class="ot"> href=</span><span class="st">"http://example.com/file.zip"</span><span class="ot"> download=</span><span class="st">"file.zip"</span><span class="kw">&gt;</span>
<a id="cb13-2" class="sourceLine" data-line-number="2"></a>  Click to download.
<a id="cb13-3" class="sourceLine" data-line-number="3"></a><span class="kw">&lt;/a&gt;</span></code></pre>
</div>
<p>The example above will prompt the user to download <strong>file.zip</strong>. If <strong>download</strong> has a value, it will be used as the default name for the resource being downloaded (the user can change it before downloading). If no value is given for <strong>download</strong>, the user will be prompted for a suitable filename. Obviously, if you are assigning a value to the <strong>download</strong> attribute, ensure it is a sensible filename.<a id="fnref3" class="footnote-ref" href="#fn3"><sup>3</sup></a></p>
<h2 id="practical-considerations">Practical Considerations</h2>
<p>A good hyperlink is one that lets the user know exactly what they are going to get when they click on it. In other words, it should be informative.<br />
Avoid vague or generic terms or phrases. For example, the following are not considered “good” hyperlinks:</p>
<div id="cb14" class="sourceCode">
<pre class="sourceCode html"><code class="sourceCode html"><a id="cb14-1" class="sourceLine" data-line-number="1"></a><span class="kw">&lt;a</span><span class="ot"> href=</span><span class="st">"http://example.com"</span><span class="kw">&gt;</span> Click here!<span class="kw">&lt;/a&gt;</span>
<a id="cb14-2" class="sourceLine" data-line-number="2"></a>
<a id="cb14-3" class="sourceLine" data-line-number="3"></a><span class="kw">&lt;a</span><span class="ot"> href=</span><span class="st">"http://example.com"</span><span class="kw">&gt;</span> Read more.<span class="kw">&lt;/a&gt;</span>
<a id="cb14-4" class="sourceLine" data-line-number="4"></a>
<a id="cb14-5" class="sourceLine" data-line-number="5"></a><span class="kw">&lt;p&gt;</span>
<a id="cb14-6" class="sourceLine" data-line-number="6"></a>  Get more information
<a id="cb14-7" class="sourceLine" data-line-number="7"></a>  <span class="kw">&lt;a</span><span class="ot"> href=</span><span class="st">"http://example.com"</span><span class="kw">&gt;</span> here<span class="kw">&lt;/a&gt;</span>.
<a id="cb14-8" class="sourceLine" data-line-number="8"></a><span class="kw">&lt;/p&gt;</span></code></pre>
</div>
<p>Better hyperlinks would be:</p>
<div id="cb15" class="sourceCode">
<pre class="sourceCode html"><code class="sourceCode html"><a id="cb15-1" class="sourceLine" data-line-number="1"></a><span class="kw">&lt;p&gt;</span> Download
<a id="cb15-2" class="sourceLine" data-line-number="2"></a>  <span class="kw">&lt;a</span><span class="ot"> href=</span><span class="st">"http://example.com"</span><span class="kw">&gt;</span>
<a id="cb15-3" class="sourceLine" data-line-number="3"></a>    The Guide to Effective Links
<a id="cb15-4" class="sourceLine" data-line-number="4"></a>  <span class="kw">&lt;/a&gt;</span>
<a id="cb15-5" class="sourceLine" data-line-number="5"></a><span class="kw">&lt;/p&gt;</span>
<a id="cb15-6" class="sourceLine" data-line-number="6"></a>
<a id="cb15-7" class="sourceLine" data-line-number="7"></a><span class="kw">&lt;p&gt;</span>There is so much to learn about the
<a id="cb15-8" class="sourceLine" data-line-number="8"></a>  <span class="kw">&lt;a</span><span class="ot"> href=</span><span class="st">"http://example.com"</span><span class="kw">&gt;</span>World Wide Web<span class="kw">&lt;/a&gt;</span>
<a id="cb15-9" class="sourceLine" data-line-number="9"></a><span class="kw">&lt;/p&gt;</span>
<a id="cb15-10" class="sourceLine" data-line-number="10"></a>
<a id="cb15-11" class="sourceLine" data-line-number="11"></a><span class="kw">&lt;p&gt;</span>
<a id="cb15-12" class="sourceLine" data-line-number="12"></a>  <span class="kw">&lt;a</span><span class="ot"> href=</span><span class="st">"http://example.com"</span><span class="kw">&gt;</span>Sign up<span class="kw">&lt;/a&gt;</span>
<a id="cb15-13" class="sourceLine" data-line-number="13"></a>  and become a member.
<a id="cb15-14" class="sourceLine" data-line-number="14"></a><span class="kw">&lt;/p&gt;</span></code></pre>
</div>
<p>When people read, they tend to skim and notice the first few characters (about the length of 2 short words). If people can’t figure out what the hyperlink is about from the first 2 words, the text of the link is probably suboptimal.<br />
You should also prefer nouns, objects, and concrete things over verbs. The title of a resource, generally, is the appropriate text for a hyperlink.<br />
You can also put a hyperlink on an image:</p>
<div id="cb16" class="sourceCode">
<pre class="sourceCode html"><code class="sourceCode html"><a id="cb16-1" class="sourceLine" data-line-number="1"></a><span class="kw">&lt;a</span><span class="ot"> href=</span><span class="st">"big_image.jpg"</span><span class="kw">&gt;</span>
<a id="cb16-2" class="sourceLine" data-line-number="2"></a>  <span class="kw">&lt;img</span><span class="ot"> src=</span><span class="st">"thumbail.jpg"</span><span class="kw">&gt;</span>
<a id="cb16-3" class="sourceLine" data-line-number="3"></a><span class="kw">&lt;/a&gt;</span></code></pre>
</div>
<p>(The example above assumes both images are in the same location as the HTML document.)<br />
You would typically do this to minimize the image size in your document (this leads to faster download and a better user experience). If the user wants to see the full sized image, they can click on the image.<br />
You might also do this if hyperlink text is not good enough. For example, the social media buttons you see on many websites are little images wrapped inside an HTML <strong>anchor</strong>:</p>
<div id="cb17" class="sourceCode">
<pre class="sourceCode html"><code class="sourceCode html"><a id="cb17-1" class="sourceLine" data-line-number="1"></a><span class="kw">&lt;a</span><span class="ot"> href=</span><span class="st">"facebook.com"</span><span class="kw">&gt;&lt;img</span><span class="ot"> src=</span><span class="st">"fb_thumb.png"</span><span class="kw">&gt;&lt;/a&gt;</span></code></pre>
</div>
<p>While you can create a link to open in a new window or tab (using <span class="kbd">target=“_blank”</span>), remember that many people don’t appreciate new windows or tabs opening up without warning. So it is a good idea to warn people:</p>
<div id="cb18" class="sourceCode">
<pre class="sourceCode html"><code class="sourceCode html"><a id="cb18-1" class="sourceLine" data-line-number="1"></a><span class="kw">&lt;p&gt;</span>
<a id="cb18-2" class="sourceLine" data-line-number="2"></a>  Get a
<a id="cb18-3" class="sourceLine" data-line-number="3"></a>  <span class="kw">&lt;a</span><span class="ot"> href=</span><span class="st">"http://example.com"</span><span class="ot"> target=</span><span class="st">"_blank"</span><span class="kw">&gt;</span>
<a id="cb18-4" class="sourceLine" data-line-number="4"></a>    Free Sample
<a id="cb18-5" class="sourceLine" data-line-number="5"></a>  <span class="kw">&lt;/a&gt;</span>. (Opens in a new tab.)
<a id="cb18-6" class="sourceLine" data-line-number="6"></a><span class="kw">&lt;/p&gt;</span></code></pre>
</div>
<h2 id="summary">Summary</h2>
<ul>
<li>The <span class="kbd">&lt;a&gt;</span> tag is used to create a hyperlink in your document.</li>
<li>The hyperlink can be to various types of resources:
<ul>
<li>Documents on other websites</li>
<li>Documents on your website</li>
<li>Locations within your document</li>
<li>Other files or images</li>
</ul>
</li>
<li>To create a hyperlink to a part of your document, you need to add an <strong>id</strong> attribute to an HTML tag in that region and you reference the <strong>id</strong> by prefacing its value with a pound sign (<strong>#</strong>)</li>
<li>The <strong>href</strong> attribute takes an absolute or relative URL to a resource.</li>
<li>The <strong>target</strong> attribute allows you to specify the hyperlink should open in a new window or tab.</li>
<li>The <strong>download</strong> attribute allows you to specify the resource should be downloaded.</li>
<li>Pick meaningful text for hyperlinks. The user should be able to infer what the hyperlink resource is from just the first few characters (about the length of 2 short words).</li>
<li>Images can be used as hyperlinks. This is commonly seen in social media icons.</li>
</ul>
<h2 id="playing-around">Playing Around</h2>
<p>The best way to learn is to play around with what you have learned.<br />
Some webpage ideas are:</p>
<ul>
<li>update one of your previous webpages to include hyperlinks &#8211; for example, replace the images with a smaller “thumbnail” images and create hyperlinks to load the full sized image</li>
<li>create a number of recipe pages and a main page that lists all the recipes and links to them. Put a return link on each recipe page back to the main page.</li>
<li>if you are feeling extremely adventurous, create a “Choose Your Own Adventure” story. This is a type of story in which the reader reads a short piece of prose (usually 1-3 paragraphs) and has to choose an action at the end, this leads to another page, and so on.</li>
<li>create a reference page for yourself. I am pretty sure this tutorial series is not the only resource you are using. Create a page that lists and links to your favourite resources.</li>
</ul>
<h2 id="references">References</h2>
<ol type="1">
<li><a href="https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-a-element"><span class="kbd">&lt;a&gt;</span> tag</a></li>
<li><a href="https://html.spec.whatwg.org/multipage/links.html#attr-hyperlink-href"><strong>href</strong> attribute</a></li>
<li><a href="https://html.spec.whatwg.org/multipage/links.html#attr-hyperlink-target"><strong>target</strong> attribute</a></li>
<li><a href="https://html.spec.whatwg.org/multipage/links.html#attr-hyperlink-download"><strong>download</strong> attribute</a></li>
<li><a href="https://www.nngroup.com/articles/first-2-words-a-signal-for-scanning/">Effective Hyperlinks</a></li>
</ol>
<div class="prev"><a href="https://complete-concrete-concise.com/tutorials/webdev/front-end-basics/a-recipe-example-with-an-image">Prev</a></div>
<div class="next"><a href="https://complete-concrete-concise.com/tutorials/webdev/front-end-basics/a-recipe-example-with-hyperlinks">Next</a></div>
<div class="clear"></div>
<section class="footnotes">
<hr />
<ol>
<li id="fn1">This is not true for <strong>XHTML</strong> which has case-sensitive <strong>id</strong> values. Also, there was a bug in Netscape 6 (an ancient browser released in 2000) which treated the values as case-sensitive.<a class="footnote-back" href="#fnref1">↩</a></li>
<li id="fn2">You can use <span class="kbd">&lt;sup&gt;</span> and <span class="kbd">&lt;/sup&gt;</span> for superscript and <span class="kbd">&lt;sub&gt;</span> and <span class="kbd">&lt;/sub&gt;</span> for subscript.
<div id="cb10" class="sourceCode">
<pre class="sourceCode html"><code class="sourceCode html"><a id="cb10-1" class="sourceLine" data-line-number="1"></a><span class="kw">&lt;p&gt;</span>The formula for water is H<span class="kw">&lt;sub&gt;</span>2<span class="kw">&lt;/sub&gt;</span>O.<span class="kw">&lt;/p&gt;</span>
<a id="cb10-2" class="sourceLine" data-line-number="2"></a>
<a id="cb10-3" class="sourceLine" data-line-number="3"></a><span class="kw">&lt;p&gt;</span>y = x<span class="kw">&lt;sup&gt;</span>2<span class="kw">&lt;/sup&gt;</span> + 3x + 12<span class="kw">&lt;/p&gt;</span></code></pre>
</div>
<p><a class="footnote-back" href="#fnref2">↩</a></li>
<li id="fn3">Because you have no idea what sort of file system your resource may be downloaded to, it is best to follow these general naming rules:<a class="footnote-back" href="#fnref3">↩</a>
<ul>
<li>avoid spaces in the name</li>
<li>use only letters, digits, underscores (_), hyphens (-), and periods</li>
<li>preferably start the filename with a letter or underscore</li>
<li>keep the name short &#8211; preferably no longer than 8 characters + period + 3 characters (e.g. filename.nam)</li>
</ul>
</li>
</ol>
</section>
<p>The post <a href="https://complete-concrete-concise.com/tutorials/webdev/front-end-basics/hyperlinks-in-html/">Hyperlinks in HTML</a> appeared first on <a href="https://complete-concrete-concise.com">Complete, Concrete, Concise</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
