freeCodeCamp/guide/russian/html/attributes/a-target-attribute/index.md

54 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
title: A Target Attribute
localeTitle: Атрибут target
---
## Атрибут target
Атрибут `<a target>` указывает, где необходимо открыть связанный документ в теге `a` (ссылка).
#### Примеры:
Атрибут target со значением «\_blank» открывает связанный документ в новом окне или вкладке.
```html
<a href="https://www.freecodecamp.org" target="_blank">freeCodeCamp</a>
```
Атрибут target со значением «\_self» открывает связанный документ в том же фрейме, в котором был нажат (это значение по умолчанию и обычно его не нужно указывать).
```html
<a href="https://www.freecodecamp.org" target="_self">freeCodeCamp</a>
```
```html
<a href="https://www.freecodecamp.org">freeCodeCamp</a>
```
Атрибут target со значением «\_parent» открывает связанный документ в родительском фрейме.
```html
<a href="https://www.freecodecamp.org" target="_parent">freeCodeCamp</a>
```
Атрибут target со значением «\_top» открывает связанный документ во всем окне.
```html
<a href="https://www.freecodecamp.org" target="_top">freeCodeCamp</a>
```
Атрибут target со значением _«framename»_ Открывает связанный документ в указанном именованном фрейме.
```html
<a href="https://www.freecodecamp.org" target="framename">freeCodeCamp</a>
```
#### Дополнительная информация:
Атрибут target: [w3schools](https://www.w3schools.com/tags/att_a_target.asp)