mozilla

Revision 233917 of font-stretch

  • Revision slug: CSS/font-stretch
  • Revision title: font-stretch
  • Revision id: 233917
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment 1 words removed

Revision Content

{{ CSSRef() }}

Summary

The font-stretch CSS property selects a normal, condensed, or extended face from a font family.

<style type="text/css"></style>
  • {{ Xref_cssinitial() }}: {{ Cssxref("normal") }}
  • Applies to: all elements
  • {{ Xref_cssinherited() }}: Yes
  • Media: {{ Xref_cssvisual() }}
  • {{ Xref_csscomputed() }}: specified value

Syntax

font-stretch:  inherit | 
               ultra-condensed | extra-condensed | condensed | semi-condensed |
               normal | semi-expanded | expanded | extra-expanded | ultra-expanded

Values

normal
Specifies a normal font face.
semi-condensed, condensed, extra-condensed, ultra-condensed
Specifies a font face condensed than normal, with ultra-condensed as the most condensed.
semi-expanded, expanded, extra-expanded, ultra-expanded
Specifies a font face expanded than normal, with ultra-expanded as the most expanded.
h1 { font-stretch: extra-expanded }
p  { font-stretch: condensed }

Specifications

font-stretch was defined in CSS 2, but dropped in CSS 2.1 due lack of implementation experience. It's newly drafted in CSS 3.

Browser compatibility

{{ CompatibilityTable() }}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support {{ CompatNo() }} {{ CompatGeckoDesktop("9.0") }} 9.0 {{ CompatNo() }} {{ CompatNo() }}
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support {{ CompatNo() }} {{ CompatGeckoMobile("9.0") }} {{ CompatUnknown() }} {{ CompatNo() }} {{ CompatNo() }}

See also

{{ CSS_Reference:Fonts() }}

{{ languages( { "fr": "fr/CSS/font-stretch", "pl": "pl/CSS/font-stretch" } ) }}

Revision Source

<p>{{ CSSRef() }}</p>
<h2>Summary</h2>
<p>The<code> font-stretch </code>CSS property selects a normal, condensed, or extended face from a font family.</p>
<nobr>
<style type="text/css"><![CDATA[.cssprop {
  display:table;
  padding: 0.4em;
  border-left:0.15em solid;
  background-color:#eeeeff
}
.cssprop li {
 display:table-row;
 padding: 3px;
 margin:0;
}
.cssprop li dfn {
  display:table-cell;
  padding: 0 5px;
  border-bottom: none;
  cursor:inherit;
}

]]></style>
<ul class="cssprop"> <li><dfn>{{ Xref_cssinitial() }}:</dfn> {{ Cssxref("normal") }}</li> <li><dfn>Applies to:</dfn> all elements</li> <li><dfn>{{ Xref_cssinherited() }}:</dfn> Yes</li> <li><dfn>Media:</dfn> {{ Xref_cssvisual() }}</li> <li><dfn>{{ Xref_csscomputed() }}:</dfn> specified value</li>
</ul></nobr><h2>Syntax</h2>
<pre>font-stretch:  inherit | 
               ultra-condensed | extra-condensed | condensed | semi-condensed |
               normal | semi-expanded | expanded | extra-expanded | ultra-expanded
</pre>
<h3>Values</h3>
<dl> <dt>normal</dt> <dd>Specifies a normal font face.</dd> <dt>semi-condensed, condensed, extra-condensed, ultra-condensed</dt> <dd>Specifies a font face condensed than normal, with ultra-condensed as the most condensed.</dd> <dt>semi-expanded, expanded, extra-expanded, ultra-expanded</dt> <dd>Specifies a font face expanded than normal, with ultra-expanded as the most expanded.</dd>
</dl>
<pre>h1 { font-stretch: extra-expanded }
p  { font-stretch: condensed }
</pre>
<h2>Specifications</h2>
<p><code>font-stretch </code>was defined in CSS 2, but dropped in CSS 2.1 due lack of implementation experience. It's newly drafted in CSS 3.</p>
<ul> <li><a class="external" href="http://www.w3.org/TR/1998/REC-CSS2-19980512/fonts.html#font-styling" title="http://www.w3.org/TR/1998/REC-CSS2-19980512/fonts.html#font-styling">CSS 2 1998-05-12 Fonts #font-styling</a> Obsolete</li> <li><a class="external" href="http://dev.w3.org/csswg/css3-fonts/#font-width-the-font-stretch-property" title="http://dev.w3.org/csswg/css3-fonts/#font-width-the-font-stretch-property">CSS 3 Fonts #font-stretch</a> Editor's draft, handle with care! </li>
</ul><h2>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>{{ CompatNo() }}</td> <td>{{ CompatGeckoDesktop("9.0") }} <a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=3512" title="https://bugzilla.mozilla.org/show_bug.cgi?id=3512"></a></td> <td>9.0</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 Phone</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td>{{ CompatNo() }}</td> <td>{{ CompatGeckoMobile("9.0") }} <a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=3512" title="https://bugzilla.mozilla.org/show_bug.cgi?id=3512"></a></td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatNo() }}</td> <td>{{ CompatNo() }}</td> </tr> </tbody> </table>
</div>
<h2>See also</h2>
<p>{{ CSS_Reference:Fonts() }}</p>
<p>{{ languages( { "fr": "fr/CSS/font-stretch", "pl": "pl/CSS/font-stretch" } ) }}</p>
Revert to this revision