MyInternships.in

HTML5 MathML

HTML5 MathML accent Attribute

The accent attribute on <mover> and <munder> controls whether the script is drawn as a tight accent, pulled close to the base, or as a separate limit. It is what turns a bar or arrow into a hat rather than a distant label.


Definition and Usage

When accent is true, the over- or under-script is treated as an accent and drawn snugly against the base - like the hat in x-hat or the arrow in a vector. When false, it is spaced away as a limit, as for the condition under a summation.

Syntax

A hat accent
Example
<mover accent="true">
  <mi>x</mi>
  <mo>&#94;</mo>
</mover>

Example

This contrasts an accent (hat, close to the base) with a non-accent overscript.

Accent versus limit overscript
Example
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>MathML accent attribute</title>
</head>
<body>
  <math display="block">
    <mrow>
      <mover accent="true">
        <mi>x</mi>
        <mo>&#94;</mo>
      </mover>
      <mo>+</mo>
      <mover accent="false">
        <mi>y</mi>
        <mo>&#8594;</mo>
      </mover>
    </mrow>
  </math>
</body>
</html>
ℹ️

accent is part of MathML Core and works on <mover> and <munder>. Use accent="true" for hats, bars, tildes and vector arrows.

Key Takeaways

  • accent decides whether a script is a tight accent or a spaced limit.
  • true is for hats, bars and arrows; false is for limits.
  • It applies to <mover> and <munder>.

Related HTML Topics

Keep learning with these closely related tutorials.

Ready to use your HTML skills?

Find web development internships and fresher jobs across India.

Browse Web Dev Internships