Use the correct element name in <code> blocks, gloss it seperately (#35616)
* Update link-to-external-pages-with-anchor-elements.english.md If you write "`anchor` element" instead of "`a` element", you should also write "`hyperreference` attribute", instead of "`href` attribute". Suggestion: write "`a` (_anchor_) element", or "anchor (`a`) element", to communicate the element name explicitly and gloss it at the same time. The `<code>` sections should be valid code as far as possible. * Change md to html * Don't mark up 'anchor' as code The tag is `a`, the name is _anchor_. * Revert "Don't mark up 'anchor' as code" This reverts commit 50c6a3a7c9697f889489bd586ceccd617cc4af1c. * Don't mark up 'anchor' as code The tag is `a`, the name is _anchor_.
This commit is contained in:
parent
4854c73eee
commit
33edc072b9
@ -7,8 +7,8 @@ videoUrl: 'https://scrimba.com/p/pVMPUv/c8EkncB'
|
||||
|
||||
## Description
|
||||
<section id='description'>
|
||||
You can use <code>anchor</code> elements to link to content outside of your web page.
|
||||
<code>anchor</code> elements need a destination web address called an <code>href</code> attribute. They also need anchor text. Here's an example:
|
||||
You can use <code>a</code> (<i>anchor</i>) elements to link to content outside of your web page.
|
||||
<code>a</code> elements need a destination web address called an <code>href</code> attribute. They also need anchor text. Here's an example:
|
||||
<code><a href="https://freecodecamp.org">this links to freecodecamp.org</a></code>
|
||||
Then your browser will display the text <strong>"this links to freecodecamp.org"</strong> as a link you can click. And that link will take you to the web address <strong>https://www.freecodecamp.org</strong>.
|
||||
</section>
|
||||
|
@ -7,7 +7,7 @@ videoUrl: 'https://scrimba.com/p/pVMPUv/cyrDRUL'
|
||||
|
||||
## Description
|
||||
<section id='description'>
|
||||
<code>anchor</code> elements can also be used to create internal links to jump to different sections within a webpage.
|
||||
<code>a</code> (<i>anchor</i>) elements can also be used to create internal links to jump to different sections within a webpage.
|
||||
To create an internal link, you assign a link's <code>href</code> attribute to a hash symbol <code>#</code> plus the value of the <code>id</code> attribute for the element that you want to internally link to, usually further down the page. You then need to add the same <code>id</code> attribute to the element you are linking to. An <code>id</code> is an attribute that uniquely describes an element.
|
||||
Below is an example of an internal anchor link and its target element:
|
||||
<blockquote><a href="#contacts-header">Contacts</a><br>...<br><h2 id="contacts-header">Contacts</h2></blockquote>
|
||||
|
@ -11,10 +11,10 @@ You can nest links within other text elements.
|
||||
<blockquote><p><br> Here's a <a target="_blank" href="http://freecodecamp.org"> link to freecodecamp.org</a> for you to follow.<br></p></blockquote>
|
||||
Let's break down the example:
|
||||
Normal text is wrapped in the <code>p</code> element:<br> <code><p> Here's a ... for you to follow. </p></code>
|
||||
Next is the <code>anchor</code> element <code><a></code> (which requires a closing tag <code></a></code>):<br> <code><a> ... </a></code>
|
||||
Next is the <i>anchor</i> element <code><a></code> (which requires a closing tag <code></a></code>):<br> <code><a> ... </a></code>
|
||||
<code>target</code> is an anchor tag attribute that specifies where to open the link and the value <code>"_blank"</code> specifies to open the link in a new tab
|
||||
<code>href</code> is an anchor tag attribute that contains the URL address of the link:<br> <code><a href="http://freecodecamp.org"> ... </a></code>
|
||||
The text, <strong>"link to freecodecamp.org"</strong>, within the <code>anchor</code> element called <code>anchor text</code>, will display a link to click:<br> <code><a href=" ... ">link to freecodecamp.org</a></code>
|
||||
The text, <strong>"link to freecodecamp.org"</strong>, within the <code>a</code> element called <code>anchor text</code>, will display a link to click:<br> <code><a href=" ... ">link to freecodecamp.org</a></code>
|
||||
The final output of the example will look like this:<br><p>Here's a <a target="_blank" href="http://freecodecamp.org"> link to freecodecamp.org</a> for you to follow.</p>
|
||||
</section>
|
||||
|
||||
|
@ -15,7 +15,7 @@ Remember to use <code>#</code> as your <code>a</code> element's <code>href</code
|
||||
|
||||
## Instructions
|
||||
<section id='instructions'>
|
||||
Place the existing image element within an <code>anchor</code> element.
|
||||
Place the existing image element within an <code>a</code> (<i>anchor</i>) element.
|
||||
Once you've done this, hover over your image with your cursor. Your cursor's normal pointer should become the link clicking pointer. The photo is now a link.
|
||||
</section>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user