diff options
Diffstat (limited to 'files/pt-pt/web/mathml/element/math/index.html')
| -rw-r--r-- | files/pt-pt/web/mathml/element/math/index.html | 161 |
1 files changed, 161 insertions, 0 deletions
diff --git a/files/pt-pt/web/mathml/element/math/index.html b/files/pt-pt/web/mathml/element/math/index.html new file mode 100644 index 0000000000..3439ad15e9 --- /dev/null +++ b/files/pt-pt/web/mathml/element/math/index.html @@ -0,0 +1,161 @@ +--- +title: <math> +slug: Web/MathML/Element/math +tags: + - MathML + - 'MathML:Element' + - Referência MathML +translation_of: Web/MathML/Element/math +--- +<div>{{MathMLRef}}</div> + +<p class="summary">O elemento top-level em MathML é <code><math></code>. Qualquer instância valida de MathML tem de ser envolto por <code><math></code>. Ademais não se deve por um elemento de <code><math></code> dentro de outro, mas pode se ter qualquer numero de outros elementos dentro desse elemento.</p> + +<h2 id="Atributos">Atributos</h2> + +<p>Para além dos seguintes atributos, o elemento <code><math></code> aceita qualquer atributo do elemento {{ MathMLElement("mstyle") }}.</p> + +<dl> + <dt id="attr-class-id-style">class, id, style</dt> + <dd>Para uso com <em><a href="/pt-PT/docs/CSS">stylesheets</a></em>.</dd> + <dt id="attr-dir">dir</dt> + <dd>A direção geral das fórmulas. Valores aceites são <code>ltr</code> (da esquerda para a direita) ou <code>rtl</code> (da direita para a esquerda).</dd> + <dt id="attr-href">href</dt> + <dd>Usado para criar uma hiperligação para um URI.</dd> + <dt id="attr-mathbackground">mathbackground</dt> + <dd>A cor de fundo. Pode usar <code>#rgb</code>, <code>#rrggbb</code> e <a href="/en-US/docs/CSS/color_value#Color_Keywords">nomes de cores HTML</a>.</dd> + <dt id="attr-mathcolor">mathcolor</dt> + <dd>A cor do texto. Pode usar <code>#rgb</code>, <code>#rrggbb</code> e <a href="/en-US/docs/CSS/color_value#Color_Keywords">nomes de cores HTML</a>.</dd> + <dt id="attr-display">display</dt> + <dd>Este atributo enumerado especifica como é que o <em>markup</em> da MathML deve ser impressa. Pode ter um dos seguintes valores: + <ul> + <li><code>block</code>, que significa que o elemento será impresso fora do <em>span</em> de texto em que se encontra, como um <em>block</em> que pode ser posicionado em qualquer lugar sem mudar o significado do texto;</li> + <li><code>inline</code>, que significa que o elemento será impresso dentro do <em>span</em> de texto em que se encontra, e não pode ser movido para fora dele sem mudar o significado do texto.</li> + </ul> + + <p>Se não estiver presente, o valor padrão é <code>inline</code>.</p> + </dd> + <dt id="attr-mode">mode {{deprecated_inline}}</dt> + <dd>Obsoleto, use antes o <a href="/pt-PT/docs/Web/MathML/Element/math#attr-display">atributo display</a>.<br> + Valores aceites são: <code>display</code> (que tem o mesmo efeito que <code>display="block"</code>) e <code>inline</code>.</dd> + <dt id="attr-overflow">overflow</dt> + <dd>Especifica como a expressão se comporta no caso de ser demasiada comprida para a largura máxima permitida. Valores aceites são: <code>linebreak</code> (valor padrão), <code>scroll</code>, <code>elide</code>, <code>truncate</code> e <code>scale</code>.</dd> +</dl> + +<h2 id="Exemplos">Exemplos</h2> + +<p><img alt="Theorem of Pythagoras" src="/files/3157/math.jpg"></p> + +<h3 id="Notação_HTML5">Notação HTML5</h3> + +<pre class="brush: html notranslate"><!DOCTYPE html> +<html> + <head> + <title>MathML in HTML5</title> + </head> + <body> + + <math> + <mrow> + <mrow> + <msup> + <mi>a</mi> + <mn>2</mn> + </msup> + <mo>+</mo> + <msup> + <mi>b</mi> + <mn>2</mn> + </msup> + </mrow> + <mo>=</mo> + <msup> + <mi>c</mi> + <mn>2</mn> + </msup> + </mrow> + </math> + + </body> +</html> +</pre> + +<h3 id="Notação_de_XHTML">Notação de XHTML</h3> + +<pre class="brush: xml notranslate"><?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> + <title>MathML in XHTML</title> +</head> +<body> + + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <mrow> + <mrow> + <msup> + <mi>a</mi> + <mn>2</mn> + </msup> + <mo>+</mo> + <msup> + <mi>b</mi> + <mn>2</mn> + </msup> + </mrow> + <mo>=</mo> + <msup> + <mi>c</mi> + <mn>2</mn> + </msup> + </mrow> + </math> + +</body> +</html></pre> + +<p><strong>Notes</strong>: Documentos de XHTML com MathML devem ser servidos como <code>application/xhtml+xml</code>. Pode satisfazer isto facilmente usando a extensão <code>.xhtml</code> para ficheiros locais. Para um servidor Apache <a class="external" href="http://httpd.apache.org/docs/2.4/mod/mod_mime.html#addtype">configura o seu ficheiro <code>.htaccess</code></a> para mapear as extensões ao tipo Mime correto. Já que o MathML está num documento XML, também deve se certificar que o documento XML está corretamente estruturado.</p> + +<h2 id="Especificações">Especificações</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">Especificação</th> + <th scope="col">Estado</th> + <th scope="col">Comentários</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{ SpecName('MathML3', 'chapter2.html#interf.toplevel', 'The Top-Level math Element') }}</td> + <td>{{ Spec2('MathML3') }}</td> + <td>Especificação atual</td> + </tr> + <tr> + <td>{{ SpecName('MathML2', 'chapter7.html#interf.toplevel', 'The Top-Level math Element') }}</td> + <td>{{ Spec2('MathML2') }}</td> + <td>Especificação inicial</td> + </tr> + </tbody> +</table> + +<h2 id="Compatibilidade">Compatibilidade</h2> + + + +<p>{{Compat("mathml.elements.math")}}</p> + +<h2 id="Notas_para_Firefox">Notas para Firefox</h2> + +<p>Firefox 7 introduziu suporte para aceitar todos os atributos de MathML no elemento top-level <code>math</code> (i.e. o mesmo comportamento que o elemento {{ MathMLElement("mstyle") }}). Contudo, o atributo <code>displaystyle</code> foi falhado e <a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=669719">só foi adicionado</a> no Firefox 8.</p> + +<p>Um apoio textual (<code>alttext</code>) ou referir a uma imagem alternativa usando os atributos <code>altimg</code>, <code>altimg-width</code>, <code>altimg-height</code> ou <code>altimg-valign</code> não está implementado no Firefox de momento.</p> + +<h2 id="Ver_também">Ver também</h2> + +<ul> + <li>Elemento de HTML <em>top-level</em>: {{ HTMLElement("html") }}</li> + <li>Elemento de SVG <em>top-level</em>: {{ SVGElement("svg") }}</li> + <li><a href="http://eyeasme.com/Joe/MathML/MathML_browser_test.html">Teste de navegador MathML</a></li> +</ul> |
