blob: cd74042e3e399b5a648973e41b93018dc362ff52 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
---
title: CSSNumericValue.div()
slug: Web/API/CSSNumericValue/div
translation_of: Web/API/CSSNumericValue/div
---
<div>{{draft}}{{APIRef("CSS Typed OM")}}{{SeeCompatTable}}</div>
<p class="summary">The <strong><code>div()</code></strong> method of the {{domxref("CSSNumericValue")}} interface divides the <code>CSSNumericValue</code> by the supplied value.</p>
<h2 id="Syntax">Syntax</h2>
<pre class="syntaxbox">var cssNumericValue = CSSNumericValue.div(<em>number</em>);</pre>
<h3 id="Parameters">Parameters</h3>
<dl>
<dt>number</dt>
<dd>Either a {{jsxref('Number')}} or a {{domxref('CSSNumericValue')}}.</dd>
</dl>
<h3 id="Return_value">Return value</h3>
<p>A {{domxref('CSSMathProduct')}}.</p>
<h3 id="Exceptions">Exceptions</h3>
<dl>
<dt>TypeError</dt>
<dd>Indicates that an invalid type was passed to the method.</dd>
</dl>
<h2 id="Examples">Examples</h2>
<pre class="brush: js">let mathProduct = CSS.px("24").div(CSS.percent("4"));
// Prints "calc(24px / 4%)"
mathProduct.toString();</pre>
<h2 id="Specifications">Specifications</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">Specification</th>
<th scope="col">Status</th>
<th scope="col">Comment</th>
</tr>
<tr>
<td>{{SpecName('CSS Typed OM','#dom-cssnumericvalue-div','div')}}</td>
<td>{{Spec2('CSS Typed OM')}}</td>
<td>Initial definition.</td>
</tr>
</tbody>
</table>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>{{Compat("api.CSSNumericValue.div")}}</p>
|