26 lines
720 B
Markdown
26 lines
720 B
Markdown
|
---
|
||
|
title: Href Attribute
|
||
|
localeTitle: Atributo Href
|
||
|
---
|
||
|
## Atributo Href
|
||
|
|
||
|
Href é a abreviação de "Hypertext Reference" e é um atributo HTML. O atributo href é usado principalmente para as tags `<a>` para especificar o URL de uma página da web que o link leva (seja em uma seção diferente da mesma página ou em uma página da Web completamente diferente).
|
||
|
|
||
|
#### Como usar
|
||
|
|
||
|
`<a href="URL"></a>`
|
||
|
|
||
|
#### Exemplos
|
||
|
|
||
|
```html
|
||
|
|
||
|
<a href="https://www.freecodecamp.org">This is an absolute URL</a>
|
||
|
|
||
|
<a href="index.html">This is a relative URL</a>
|
||
|
```
|
||
|
|
||
|
#### Mais Informações:
|
||
|
|
||
|
[W3Schools](https://www.w3schools.com/tags/att_href.asp)
|
||
|
|
||
|
[HTMLElementReference](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a)
|