Added backticks to inline code (#25041)
* Added backticks to inline code The page does not display properly on: https://guide.freecodecamp.org/html/attributes/a-href-attribute/ although it appears ok on github. Added missing backticks around inline code. Removed duplicate image link example. * fix: removed tag/changed to element
This commit is contained in:
committed by
Randell Dawson
parent
47e1bcbe08
commit
2c322a52ef
@ -4,7 +4,7 @@ title: A Href Attribute
|
||||
|
||||
## A Href Attribute
|
||||
|
||||
The `<a href>` attribute refers to a destination provided by a link. The `a` (anchor) tag is dead without the `<href>` attribute. Sometimes in your workflow, you don't want a live link or you won't know the link destination yet. In this case, it's useful to set the `href` attribute to `"#"` to create a dead link. The `href` attribute can be used to link to local files or files on the internet.
|
||||
The `<a href>` attribute refers to a destination provided by a link. The `a` (anchor) element is dead without the `<href>` attribute. Sometimes in your workflow, you don't want a live link or you won't know the link destination yet. In this case, it's useful to set the `href` attribute to `"#"` to create a dead link. The `href` attribute can be used to link to local files or files on the internet.
|
||||
|
||||
For instance:
|
||||
|
||||
@ -38,13 +38,13 @@ The `<a href>` attribute is supported by all browsers.
|
||||
```
|
||||
### In-page anchors
|
||||
|
||||
It's also possible to set an anchor on a specific place on the page. To do this, you should first place a tab at the location on the page with tag <a> and the necessary attribute "name" with any keyword description in it, like this:
|
||||
It's also possible to set an anchor to certain place of the page. To do this you should first place a tab at location on the page with tag `<a>` and necessary attribute "name" with any keyword description in it, like this:
|
||||
|
||||
```html
|
||||
<a name="top"></a>
|
||||
```
|
||||
|
||||
Any description between tags is not required. After that you can place a link leading to this anchor at any place on the same page. To do this you should use tag <a> with necessary attribute "href" with symbol # (sharp) and key-word description of the anchor, like this:
|
||||
Any description between tags is not required. After that you can place a link leading to this anchor at any place on the same page. To do this you should use tag `<a>` with necessary attribute "href" with symbol # (sharp) and key-word description of the anchor, like this:
|
||||
|
||||
```html
|
||||
<a href="#top">Go to Top</a>
|
||||
@ -57,11 +57,8 @@ The `<a href="#">` may also be applied to images and other HTML elements.
|
||||
### Example
|
||||
|
||||
```html
|
||||
<a href="#"><img itemprop="image" style="height: 90px;" src="http://www.chatbot.chat/assets/images/header-bg_y.jpg" alt="picture"> </a>
|
||||
|
||||
<a href="#"><img itemprop="image" style="height: 90px;" src="http://www.chatbot.chat/assets/images/header-bg_y.jpg" alt="picture"></a>
|
||||
```
|
||||
### Example
|
||||
<a href="#"><img itemprop="image" style="height: 90px;" src="http://www.chatbot.chat/assets/images/header-bg_y.jpg" alt="picture"> </a>
|
||||
### Some more examples of href
|
||||
```html
|
||||
<base href="https://www.freecodecamp.org/a-href/">This gives a base url for all further urls on the page</a>
|
||||
|
Reference in New Issue
Block a user