CSSMediaRule

  • Revision slug: DOM/CSSMediaRule
  • Revision title: CSSMediaRule
  • Revision id: 336863
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment

Revision Content

{{ CSSOMRef() }}

CSSMediaRule is an object representing a single CSS media rule. It implements {{domxref("CSSConditionRule")}} interface.

Properties

As a {{ domxref("CSSConditionRule") }} and therefore a {{ domxref("CSSRule") }}, CSSSupportsRule also implements the properties of these interfaces. It has the following specific properties:

media
Specifies a {{domxref("MediaList")}} representing the intended destination medium for style information.

Methods

As a {{ domxref("CSSConditionRule") }} and therefore a {{ domxref("CSSRule") }}, CSSSupportsRule also implements the methods of that interface. It has no specific methods.

Specification

Specification Status Comment
{{ SpecName('CSS3 Conditional', '#the-cssmediarule-interface', 'CSSMediaRule') }} {{ Spec2('CSS3 Conditional')}} Make it derived from the {{domxref("CSSConditionRule")}}.
{{ SpecName('CSSOM', '#the-cssmediarule-interface', 'CSSMediaRule') }} {{ Spec2('CSSOM') }} No changes from {{SpecName('DOM2 Style')}}
{{SpecName('DOM2 Style', 'css.html#CSS-CSSMediaRule', 'CSSMediaRule') }} {{ Spec2('DOM2 Style') }}  

Browser compatibility

{{ CompatibilityTable() }}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support {{ CompatUnknown() }} {{ CompatVersionUnknown }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }}
Derives from {{domxref("CSSConditionRule")}} {{experimental_inline()}} {{CompatNo}} {{ CompatGeckoDesktop("20.0") }} {{CompatNo}} {{CompatNo}} {{CompatNo}}
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support {{ CompatUnknown() }} {{ CompatGeckoMobile("17") }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }}
Derives from {{domxref("CSSConditionRule")}} {{experimental_inline()}} {{CompatNo}} {{ CompatGeckoMobile("20.0") }} {{CompatNo}} {{CompatNo}} {{CompatNo}}

See also

  • {{ domxref("CSSRule") }}

Revision Source

<p>{{ CSSOMRef() }}</p>
<p><code>CSSMediaRule</code> is an object representing a single CSS media rule. It implements {{domxref("CSSConditionRule")}} interface.</p>
<h2 id="Properties" name="Properties">Properties</h2>
<p>As a {{ domxref("CSSConditionRule") }} and therefore a {{ domxref("CSSRule") }}, <code>CSSSupportsRule</code> also implements the properties of these interfaces. It has the following specific properties<code>:</code></p>
<dl>
  <dt>
    <code>media</code></dt>
  <dd>
    Specifies a {{domxref("MediaList")}} representing the intended destination medium for style information.</dd>
</dl>
<h2 id="Methods" name="Methods">Methods</h2>
<p>As a {{ domxref("CSSConditionRule") }} and therefore a {{ domxref("CSSRule") }}, <code>CSSSupportsRule</code> also implements the methods of that interface. It has no specific methods.</p>
<h2 id="Specification" name="Specification">Specification</h2>
<table class="standard-table">
  <thead>
    <tr>
      <th scope="col">Specification</th>
      <th scope="col">Status</th>
      <th scope="col">Comment</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>{{ SpecName('CSS3 Conditional', '#the-cssmediarule-interface', 'CSSMediaRule') }}</td>
      <td>{{ Spec2('CSS3 Conditional')}}</td>
      <td>Make it derived from the {{domxref("CSSConditionRule")}}.</td>
    </tr>
    <tr>
      <td>{{ SpecName('CSSOM', '#the-cssmediarule-interface', 'CSSMediaRule') }}</td>
      <td>{{ Spec2('CSSOM') }}</td>
      <td>No changes from {{SpecName('DOM2 Style')}}</td>
    </tr>
    <tr>
      <td>{{SpecName('DOM2 Style', 'css.html#CSS-CSSMediaRule', 'CSSMediaRule') }}</td>
      <td>{{ Spec2('DOM2 Style') }}</td>
      <td>&nbsp;</td>
    </tr>
  </tbody>
</table>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>{{ CompatibilityTable() }}</p>
<div id="compat-desktop">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Chrome</th>
        <th>Firefox (Gecko)</th>
        <th>Internet Explorer</th>
        <th>Opera</th>
        <th>Safari (WebKit)</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatVersionUnknown }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
      </tr>
      <tr>
        <td>Derives from {{domxref("CSSConditionRule")}} {{experimental_inline()}}</td>
        <td>{{CompatNo}}</td>
        <td>{{ CompatGeckoDesktop("20.0") }}</td>
        <td>{{CompatNo}}</td>
        <td>{{CompatNo}}</td>
        <td>{{CompatNo}}</td>
      </tr>
    </tbody>
  </table>
</div>
<div id="compat-mobile">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Android</th>
        <th>Firefox Mobile (Gecko)</th>
        <th>IE&nbsp;Phone</th>
        <th>Opera Mobile</th>
        <th>Safari Mobile</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatGeckoMobile("17") }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
      </tr>
      <tr>
        <td>Derives from {{domxref("CSSConditionRule")}} {{experimental_inline()}}</td>
        <td>{{CompatNo}}</td>
        <td>{{ CompatGeckoMobile("20.0") }}</td>
        <td>{{CompatNo}}</td>
        <td>{{CompatNo}}</td>
        <td>{{CompatNo}}</td>
      </tr>
    </tbody>
  </table>
</div>
<h2 id="See_also">See also</h2>
<ul>
  <li>{{ domxref("CSSRule") }}</li>
</ul>
Revert to this revision