---
title: CSSNumericValue
slug: Web/API/CSSNumericValue
tags:
  - API
  - CSS Typed Object Model API
  - CSSNumericValue
  - Experimental
  - Houdini
  - Interface
  - NeedsTranslation
  - Reference
  - TopicStub
translation_of: Web/API/CSSNumericValue
---
<div>{{draft}}{{APIRef("CSS Typed OM")}}{{SeeCompatTable}}</div>

<p class="summary">The <strong><code>CSSNumericValue</code></strong> interface of the <a href="/docs/Web/API/CSS_Typed_Object_Model_API">CSS Typed Object Model API</a> represents operations that all numeric values can perform.</p>

<h2 id="Interfaces_based_on_CSSNumericValue">Interfaces based on CSSNumericValue</h2>

<p>Below is a list of interfaces based on the CSSNumericValue interface.</p>

<div class="index">
<ul>
 <li>{{domxref('CSSMathInvert')}}</li>
 <li>{{domxref('CSSMathMax')}}</li>
 <li>{{domxref('CSSMathMin')}}</li>
 <li>{{domxref('CSSMathNegate')}}</li>
 <li>{{domxref('CSSMathProduct')}}</li>
 <li>{{domxref('CSSMathSum')}}</li>
 <li>{{domxref('CSSMathValue')}}</li>
 <li>{{domxref('CSSNumericArray')}}</li>
 <li>{{domxref('CSSPerspective')}}</li>
 <li>{{domxref('CSSPositionValue')}}</li>
 <li>{{domxref('CSSRotate')}}</li>
 <li>{{domxref('CSSSkew')}}</li>
 <li>{{domxref('CSSSkeyX')}}</li>
 <li>{{domxref('CSSSkeyW')}}</li>
 <li>{{domxref('CSSTranslate')}}</li>
 <li>{{domxref('CSSUnitValue')}}</li>
</ul>
</div>

<h2 id="Properties">Properties</h2>

<p>None.</p>

<h3 id="Event_handlers">Event handlers</h3>

<p>No</p>

<h2 id="Methods">Methods</h2>

<dl>
 <dt>{{domxref('CSSNumericValue.add')}}</dt>
 <dd>Adds a supplied number to the <code>CSSNumericValue</code>.</dd>
 <dt>{{domxref('CSSNumericValue.sub')}}</dt>
 <dd>Subtracts a supplied number from the <code>CSSNumericValue</code>.</dd>
 <dt>{{domxref('CSSNumericValue.mul')}}</dt>
 <dd>Multiplies the <code>CSSNumericValue</code> by the supplied value.</dd>
 <dt>{{domxref('CSSNumericValue.div')}}</dt>
 <dd>Divides the <code>CSSNumericValue</code> by the supplied value.</dd>
 <dt>{{domxref('CSSNumericValue.min')}}</dt>
 <dd>Returns the minimum value passed</dd>
 <dt>{{domxref('CSSNumericValue.max')}}</dt>
 <dd>Returns the maximum value passed</dd>
 <dt>{{domxref('CSSNumericValue.equals')}}</dt>
 <dd><em>True</em> if all the values are the exact same type and value, in the same order. Otherwise, <em>false.</em></dd>
 <dt>{{domxref('CSSNumericValue.to')}}</dt>
 <dd>Converts <code>value</code> into another one with the specified <var>unit.</var></dd>
 <dt>{{domxref('CSSNumericValue.toSum')}}</dt>
 <dd>TBD</dd>
 <dt>{{domxref('CSSNumericValue.type')}}</dt>
 <dd>TBD</dd>
 <dt>{{domxref('CSSNumericValue.parse')}}</dt>
 <dd>Allows a <code class="idl">CSSNumericValue</code> to be constructed directly from a string containing CSS. </dd>
</dl>



<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','#numeric-value','CSSNumericValue')}}</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")}}</p>

<h2 id="See_Also">See Also</h2>

<ul>
 <li>{{domxref('CSSImageValue')}}</li>
 <li>{{domxref('CSSKeywordValue')}}</li>
 <li>{{domxref('CSSPositionValue')}}</li>
 <li>{{domxref('CSSTransformValue')}}</li>
 <li>{{domxref('CSSUnparsedValue')}}</li>
</ul>