Тег SUP

Html тег для степени

Выводит надстрочный текст.

Время чтения: меньше 5 мин

Обновлено 8 сентября 2022

Кратко

Скопировать ссылку «Кратко» Скопировано

Тег позволяет выводить надстрочный текст, например, в математических уравнениях: c 2 = a 2 + b 2 .

Пример

Скопировать ссылку «Пример» Скопировано

Чаще всего используется для вывода степеней в математических формулах.

   Теорема Пифагора — одна из основополагающих теорем евклидовой геометрии c2 = a2 + b2.  p> Теорема Пифагора — одна из основополагающих теорем евклидовой геометрии csup>2sup> = asup>2sup> + bsup>2sup>. p>      

Как пишется

Скопировать ссылку «Как пишется» Скопировано

Помимо описанного выше примера, можно использовать тег внутри тега .

   Квадрат суммы может быть вычислен как сумма квадратов слагаемых и их удвоенное произведение: (a + b)2 = a2 + 2*a*b + b2  p> Квадрат суммы может быть вычислен как сумма квадратов слагаемых и их удвоенное произведение: var>(a + b)sup>2sup> = asup>2sup> + 2*a*b + bsup>2sup>var> p>      
 var  font-style: normal;> var  font-style: normal; >      

Теги можно вкладывать друг в друга, тогда на каждом шаге текст будет подниматься вверх, а его размер будет уменьшаться.

   Первый уровень второй уровень третий уровень четвёртый уровень    p> Первый уровень sup>второй уровень sup>третий уровень sup>четвёртый уровеньsup> sup> sup> p>      
    X  2 × log3(Z2)    p> var> X sup> 2 × logsub>3sub>(Zsup>2sup>) sup> var> p>      

Источник

Html тег для степени

Отображает шрифт в виде верхнего индекса. Шрифт при этом отображается выше базовой линии текста и уменьшенного размера.

Синтаксис

Закрывающий тег

Атрибуты

Аналог CSS

      

Великая теорема Ферма

X n + Y n = Z n

где n - целое число > 2

Результат данного примера показан ниже.

Рис. 1

Рис. 1. Вид текста, оформленного с помощью тега

Статьи по теме

Статьи по теме

Не выкладывайте свой код напрямую в комментариях, он отображается некорректно. Воспользуйтесь сервисом cssdeck.com или jsfiddle.net, сохраните код и в комментариях дайте на него ссылку. Так и результат сразу увидят.

Типы тегов

HTML5

Блочные элементы

Строчные элементы

Универсальные элементы

Нестандартные теги

Осуждаемые теги

Видео

Документ

Звук

Изображения

Объекты

Скрипты

Списки

Ссылки

Таблицы

Текст

Форматирование

Формы

Фреймы

Источник

: The Superscript element

The HTML element specifies inline text which is to be displayed as superscript for solely typographical reasons. Superscripts are usually rendered with a raised baseline using smaller text.

Try it

Attributes

This element only includes the global attributes.

Usage notes

The element should only be used for typographical reasons—that is, to change the position of the text to comply with typographical conventions or standards, rather than solely for presentation or appearance purposes.

For example, to style the wordmark of a business or product which uses a raised baseline should be done using CSS (most likely vertical-align ) rather than . This would be done using, for example, vertical-align: super or, to shift the baseline up 50%, vertical-align: 50% .

Appropriate use cases for include (but aren’t necessarily limited to):

  • Displaying exponents, such as «x 3 .» It may be worth considering the use of MathML for these, especially in more complex cases. See Exponents under Examples below.
  • Displaying superior lettering, which is used in some languages when rendering certain abbreviations. For example, in French, the word «mademoiselle» can be abbreviated «M lle «); this is an acceptable use case. See Superior lettering for examples.
  • Representing ordinal numbers, such as «4 th » instead of «fourth.» See Ordinal numbers for examples.

Examples

Exponents

Exponents, or powers of a number, are among the most common uses of superscripted text. For example:

p> One of the most common equations in all of physics is var>Evar>=var>mvar >var>cvar>sup>2sup>. p> 

Result

Superior lettering

Superior lettering is not technically the same thing as superscript. However, it is common to use to present superior lettering in HTML. Among the most common uses of superior lettering is the presentation of certain abbreviations in French:

p>Robert a présenté son rapport à Msup>llesup> Bernard.p> 

Result

Ordinal numbers

Ordinal numbers, such as «fourth» in English or «quinto» in Spanish may be abbreviated using numerals and language-specific text rendered in superscript:

p> The ordinal number "fifth" can be abbreviated in various languages as follows: p> ul> li>English: 5sup>thsup>li> li>French: 5sup>èmesup>li> ul> 

Result

Technical summary

Content categories Flow content, phrasing content, palpable content.
Permitted content Phrasing content.
Tag omission None, both the starting and ending tag are mandatory.
Permitted parents Any element that accepts phrasing content.
Implicit ARIA role No corresponding role
Permitted ARIA roles Any
DOM interface HTMLElement

Specifications

Browser compatibility

BCD tables only load in the browser

See also

  • The HTML element that produces subscripts. Note that you cannot use sub and sup at the same time: you need to use MathML to produce both a superscript and a subscript next to the chemical symbol of an element, representing its atomic number and its nuclear number.
  • The , , and MathML elements.
  • The CSS vertical-align property.

Found a content problem with this page?

This page was last modified on Apr 13, 2023 by MDN contributors.

Your blueprint for a better internet.

MDN

Support

Our communities

Developers

Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998– 2023 by individual mozilla.org contributors. Content available under a Creative Commons license.

Источник

HTML Tag

The tag defines superscript text. Superscript text appears half a character above the normal line, and is sometimes rendered in a smaller font. Superscript text can be used for footnotes, like WWW [1] .

Browser Support

Global Attributes

Event Attributes

Default CSS Settings

Most browsers will display the element with the following default values:

Example

Unlock Full Access 50% off

COLOR PICKER

colorpicker

Join our Bootcamp!

Report Error

If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail:

Thank You For Helping Us!

Your message has been sent to W3Schools.

Top Tutorials
Top References
Top Examples
Get Certified

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.

Источник

Html тег для степени

Отображает шрифт в виде верхнего индекса. Шрифт при этом отображается выше базовой линии текста и уменьшенного размера.

Синтаксис

Закрывающий тег

Атрибуты

Аналог CSS

      

Великая теорема Ферма

X n + Y n = Z n

где n - целое число > 2

Результат данного примера показан ниже.

Рис. 1

Рис. 1. Вид текста, оформленного с помощью тега

Статьи по теме

Статьи по теме

Не выкладывайте свой код напрямую в комментариях, он отображается некорректно. Воспользуйтесь сервисом cssdeck.com или jsfiddle.net, сохраните код и в комментариях дайте на него ссылку. Так и результат сразу увидят.

Типы тегов

HTML5

Блочные элементы

Строчные элементы

Универсальные элементы

Нестандартные теги

Осуждаемые теги

Видео

Документ

Звук

Изображения

Объекты

Скрипты

Списки

Ссылки

Таблицы

Текст

Форматирование

Формы

Фреймы

Источник

Читайте также:  Php минимум в массиве
Оцените статью