From 074785cea106179cb3305637055ab0a009ca74f2 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:42:52 -0500 Subject: initial commit --- files/ru/web/html/element/code/index.html | 116 ++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 files/ru/web/html/element/code/index.html (limited to 'files/ru/web/html/element/code') diff --git a/files/ru/web/html/element/code/index.html b/files/ru/web/html/element/code/index.html new file mode 100644 index 0000000000..2bc6c488e3 --- /dev/null +++ b/files/ru/web/html/element/code/index.html @@ -0,0 +1,116 @@ +--- +title: ': The Inline Code element' +slug: Web/HTML/Element/code +tags: + - HTML + - Код + - Элемент +translation_of: Web/HTML/Element/code +--- +
{{HTMLRef}}
+ +

Элемент HTML <code> отображает его содержимое в стиле, предназначенном для указания на то, что текст является коротким фрагментом компьютерного кода. По умолчанию текст содержимого отображается с использованием шрифта монопространства по умолчанию {{Glossary("user agent", "пользовательского агента")}}.

+ +
{{EmbedInteractiveExample("pages/tabbed/code.html", "tabbed-shorter")}}
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Content categoriesFlow content, phrasing content, palpable content.
Permitted contentPhrasing content.
Tag omission{{no_tag_omission}}
Permitted parentsAny element that accepts phrasing content.
Implicit ARIA roleNo corresponding role
Permitted ARIA rolesAny
DOM interface{{domxref("HTMLElement")}} Up to Gecko 1.9.2 (Firefox 4) inclusive, Firefox implements the {{domxref("HTMLSpanElement")}} interface for this element.
+ +

Атрибуты

+ +

Этот элемент включает в себя только глобальные атрибуты.

+ +

Пример

+ +

Текстовый абзац, включающий <code>:

+ +
<p>The function <code>selectAll()</code> highlights all the text in the
+input field so the user can, for example, copy or delete the text.</p>
+
+ +

Вывод, генерируемый этим HTML, выглядит так:

+ +

{{EmbedLiveSample("Example", 640, 70)}}

+ +

Примечания

+ +

Для представления нескольких строк кода, оберните элемент <code> в элемент {{HTMLElement("pre")}}. Элемент <code> сам по себе представляет только один элемент кода или строку кода.

+ +

CSS правило может быть определено для того, чтобы селектор code переопределил шрифт браузера по умолчанию. Предпочтения, установленные пользователем, могут иметь приоритет над указанными CSS.

+ +

Спецификации

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', 'semantics.html#the-code-element', '<code>')}}{{Spec2('HTML WHATWG')}}
{{SpecName('HTML5 W3C', 'textlevel-semantics.html#the-code-element', '<code>')}}{{Spec2('HTML5 W3C')}}
{{SpecName('HTML4.01', 'struct/text.html#h-9.2.1', '<code>')}}{{Spec2('HTML4.01')}}
+ +

Совместимость с браузерами

+ + + +

{{Compat("html.elements.code")}}

+ +

См. также

+ + -- cgit v1.2.3-54-g00ecf