CSS

  • Revision slug: CSS
  • Revision title: CSS
  • Revision id: 310235
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment

Revision Content

Cascading Style Sheets, most of the time abbreviated in CSS, is a stylesheet language used to describe the presentation of a document written in HTML or XML (including various XML languages like SVG or XHTML).

CSS is one of the core languages of the open web and has a standardized W3C specification. Developed in levels, CSS1 is now obsolete, CSS2.1 a recommendation and CSS3, now split into smaller modules, is progressing on the standard track. The first early drafts of CSS4 modules are being written.

CSS Reference

An exhaustive reference for seasoned Web developers describing every property and concept of CSS.

CSS Tutorial

A step-by-step introduction to help complete beginners get started. It presents all the needed fundamentals.

CSS3 Demos

A collection of demos showing the latest CSS technologies in action: a boost for the creativity.

Documentation and tutorials about CSS

CSS key concepts
Describes the syntax of the language and introduces fundamentals like specificity and inheritance, the box model and margin collapsing, stacking and block-formatting contexts, or the initial, computed, used and actual values. Entities like CSS shorthand properties are also defined.
Writing efficient CSS
Explains how style sheet engines perform selector matching and describes rules for writing more efficient CSS.
Using CSS transforms
Presents the 2D operations that can be applied to each element in order to rotate, skew, translate it.
Using CSS transitions
Explains how to change the aspect of an element using a smooth animation between the initial and final state.
Using CSS animations
Describes how to define animations of an element but also how to detect in Javascript if the browser supports it.
Using CSS gradients
Explains how to define gradients, images composed of smooth variations of colors.
Using CSS multi-column layouts
Presents how to make multi-column page settings using the CSS Level 3 multi-column layout.
Using CSS multiple backgrounds
Describes how to define several backgrounds on the same element.
Scaling background images
Shows how to control the behavior of background images when these does not match exactly the size of their container.
Using CSS media queries
Presents how to select style sheets based on details of the rendering device, like its viewport size, its resolution or if it has a touchscreen.
Using CSS counters
Explains how to use automatic counters and numbering, essentially used as list counters.
Fonts and Typography
Informs about managing your fonts using {{ cssxref("@font-face") }} and the WOFF font format.
Using CSS flexible boxes
Describes how to use flexible boxes to design layouts.
Consistent List Indentation
Trying to change the indentation of lists with CSS is trickier than it looks, but only because CSS-conformant browsers took different paths to default indentation. Find out how to get them all in line.
Using dynamic styling information
How to obtain information on and manipulate styling via the DOM.

View All...

Getting help from the community

You need help on a CSS-related problem and can't find the solution in the documentation?

  • Check the common CSS questions that give hints to solve common CSS problems.
  • Go to Stack Overflow, a collaboratively built and maintained Q&A site and look if you can find the answer to your question. If not you will be able to ask your question there.
  • Consult the layout forum, which covers CSS and HTML: {{ DiscussionList("dev-tech-css", "mozilla.dev.tech.layout") }}

Don't forget about the netiquette...

Tools easing CSS development

  • The W3C CSS Validation Service checks if a given CSS is valid. It is an invaluable debugging tool.
  • Firefox' Firebug extension, a popular extension of that navigator that allows to edit live CSS on watched sites. Very practical to test some changes, though this extension does much more.
  • Firefox' Web Developer extension also allows to watch and edit live CSS on watched sites. Simpler than Firebug, though less powerful.
  • Firefox' EditCSS extension allows editing CSS in the sidebar.

View All...

 

Revision Source

<p><strong>Cascading Style Sheets</strong>, most of the time abbreviated in <strong>CSS</strong>, is a <a href="/en-US/docs/DOM/stylesheet">stylesheet</a> language used to describe the presentation of a document written in <a href="/en-US/docs/HTML" title="The HyperText Mark-up Language">HTML</a> or <a href="/en-US/docs/XML" title="en-US/docs/XML">XML</a> (including various XML languages like <a href="/en-US/docs/SVG" title="en-US/docs/SVG">SVG</a> or <a href="/en-US/docs/XHTML" title="en-US/docs/XHTML">XHTML</a>).</p>
<p>CSS is one of the core languages of the <em>open web</em> and has a standardized <a class="external" href="http://w3.org/Style/CSS/#specs">W3C specification</a>. Developed in levels, CSS1 is now obsolete, CSS2.1 a recommendation and <a href="/en-US/docs/CSS/CSS3" title="CSS3">CSS3</a>, now split into smaller modules, is progressing on the standard track. The first early drafts of CSS4 modules are being written.</p>
<div style="margin:auto;text-align:center;">
  <div class="callout-box action-driven">
    <div>
      CSS Reference</div>
    <p>An <a href="/en-US/docs/CSS/CSS_Reference" title="en-US/docs/CSS/CSS_Reference">exhaustive reference</a> for <u>seasoned Web developers</u> describing every property and concept of CSS.</p>
  </div>
  <div class="callout-box action-driven">
    <div>
      CSS Tutorial</div>
    <p>A <a href="/en-US/docs/CSS/Getting_Started" title="en-US/docs/CSS/Getting_Started">step-by-step introduction</a> to help <u>complete beginners</u> get started. It presents all the needed fundamentals.</p>
  </div>
  <div class="callout-box action-driven">
    <div>
      CSS3 Demos</div>
    <p>A <a href="/en-US/demos/tag/tech:css3" title="https://developer.mozilla.org/en-US/demos/tag/tech:css3">collection of demos</a> showing the <u>latest CSS technologies</u> in action: a boost for the creativity.</p>
  </div>
</div>
<table class="topicpage-table">
  <tbody>
    <tr>
      <td>
        <h2 class="Documentation" id="Documentation_and_tutorials_about_CSS">Documentation and tutorials about CSS</h2>
        <dl>
          <dt>
            CSS key concepts</dt>
          <dd>
            Describes the <a href="/en-US/docs/CSS/Syntax" title="/en-US/docs/CSS/Syntax">syntax of the language</a> and introduces fundamentals like <a href="/en-US/docs/CSS/Specificity" title="Specificity">specificity</a> and <a href="/en-US/docs/CSS/inheritance" title="inheritance">inheritance</a>, the <a href="/en-US/docs/CSS/box_model" title="Box model">box model</a> and <a href="/en-US/docs/CSS/margin_collapsing" title="Margin collapsing">margin collapsing</a>, <a href="/en-US/docs/CSS/Understanding_z-index/The_stacking_context" title="The stacking context">stacking</a> and <a href="/en-US/docs/CSS/block_formatting_context" title="block formatting context">block-formatting</a> contexts, or the <a href="/en-US/docs/CSS/initial_value" title="initial value">initial</a>, <a href="/en-US/docs/CSS/computed_value" title="computed value">computed</a>, <a href="/en-US/docs/CSS/used_value" title="used value">used</a> and <a href="/en-US/docs/CSS/actual_value" title="actual value">actual</a> values. Entities like <a href="/en-US/docs/CSS/Shorthand_properties" title="CSS/Shorthand_properties">CSS shorthand properties</a> are also defined.</dd>
          <dt>
            <a href="/en-US/docs/CSS/Writing_Efficient_CSS" title="CSS/Writing_Efficient_CSS">Writing efficient CSS</a></dt>
          <dd>
            Explains how style sheet engines perform selector matching and describes rules for writing more efficient CSS.</dd>
          <dt>
            <a href="/en-US/docs/CSS/Using_CSS_transforms" title="How to use CSS3 Transforms (2D and 3D)">Using CSS transforms</a></dt>
          <dd>
            Presents the 2D operations that can be applied to each element in order to rotate, skew, translate it.</dd>
          <dt>
            <a href="/en-US/docs/CSS/Using_CSS_transitions" title="How to use CSS3 Transitions">Using CSS transitions</a></dt>
          <dd>
            Explains how to change the aspect of an element using a smooth animation between the initial and final state.</dd>
          <dt>
            <a href="/en-US/docs/CSS/Using_CSS_animations" title="How to use CSS3 Animations">Using CSS animations</a></dt>
          <dd>
            Describes how to define animations of an element but also how to <a href="/en-US/docs/CSS/CSS_animations/Detecting_CSS_animation_support" title="https://developer.mozilla.org/en-US/docs/CSS/CSS_animations/Detecting_CSS_animation_support">detect</a> in Javascript if the browser supports it.</dd>
          <dt>
            <a href="/en-US/docs/CSS/Using_CSS_gradients" title="How to use CSS3 Gradients">Using CSS gradients</a></dt>
          <dd>
            Explains how to define gradients, images composed of smooth variations of colors.</dd>
          <dt>
            <a href="/en-US/docs/CSS/Using_CSS_multi-column_layouts" title="How to use CSS3 Multicol layout">Using CSS multi-column layouts</a></dt>
          <dd>
            Presents how to make multi-column page settings using the CSS Level 3 multi-column layout.</dd>
          <dt>
            <a href="/en-US/docs/CSS/Multiple_backgrounds" title="How to use the CSS3 multiple background feature">Using CSS multiple backgrounds</a></dt>
          <dd>
            Describes how to define several backgrounds on the same element.</dd>
          <dt>
            <a href="/en-US/docs/CSS/Scaling_background_images" title="CSS/Scaling_background_images">Scaling background images</a></dt>
          <dd>
            Shows how to control the behavior of background images when these does not match exactly the size of their container.</dd>
          <dt>
            <a class="internal" href="/en-US/docs/CSS/Media_queries" title="How to use CSS3 Media Queries">Using CSS media queries</a></dt>
          <dd>
            Presents how to select style sheets based on details of the rendering device, like its viewport size, its resolution or if it has a touchscreen.</dd>
          <dt>
            <a href="/en-US/docs/CSS_Counters" title="CSS Counters">Using CSS counters</a></dt>
          <dd>
            Explains how to use automatic counters and numbering, essentially used as list counters.</dd>
          <dt>
            Fonts and Typography</dt>
          <dd>
            Informs about managing your <a href="/en-US/docs/CSS/font" title="font">fonts</a> using {{ cssxref("@font-face") }} and the <a href="/en-US/docs/WOFF" title="About_WOFF">WOFF font</a> format.</dd>
          <dt>
            <a href="/en-US/docs/CSS/Using_CSS_flexible_boxes" title="Using CSS flexible boxes">Using CSS flexible boxes</a></dt>
          <dd>
            Describes how to use flexible boxes to design layouts.</dd>
          <dt>
            <a href="/en-US/docs/Consistent_List_Indentation" title="Consistent_List_Indentation">Consistent List Indentation</a></dt>
          <dd>
            Trying to change the indentation of lists with CSS is trickier than it looks, but only because CSS-conformant browsers took different paths to default indentation. Find out how to get them all in line.</dd>
          <dt>
            <a href="/en-US/docs/DOM/Using_dynamic_styling_information" title="DOM/Using_dynamic_styling_information">Using dynamic styling information</a></dt>
          <dd>
            How to obtain information on and manipulate styling via the DOM.</dd>
        </dl>
        <p><span class="alllinks"><a href="/en-US/docs/tag/CSS" title="/en-US/docs/tag/CSS">View All...</a></span></p>
      </td>
      <td>
        <h2 class="Community" id="Community" name="Community">Getting help from the community</h2>
        <p>You need help on a CSS-related problem and can't find the solution in the documentation?</p>
        <ul>
          <li>Check the <a href="/en-US/docs/CSS/Common_CSS_Questions" title="en-US/docs/CSS/Common_CSS_Questions">common CSS questions</a> that give hints to solve common CSS problems.</li>
          <li>Go to <a href="http://stackoverflow.com/questions/tagged/css" title="http://stackoverflow.com/questions/tagged/css">Stack Overflow</a>, a collaboratively built and maintained Q&amp;A site and look if you can find the answer to your question. If not you will be able to ask your question there.</li>
          <li>Consult the layout forum, which covers CSS and HTML: {{ DiscussionList("dev-tech-css", "mozilla.dev.tech.layout") }}
            <ul>
              <li>Ask your question on the Mozilla IRC channel: <a class="link-irc" href="irc://irc.mozilla.org/css">#css</a></li>
              <li>Ask your question on the <a class="external" href="http://www.css-discuss.org/">CSS-Discuss site and list</a></li>
            </ul>
          </li>
        </ul>
        <p><span class="alllinks"><a class="external" href="http://www.catb.org/~esr/faqs/smart-questions.html" title="http://www.catb.org/~esr/faqs/smart-questions.html">Don't forget about the <em>netiquette</em>...</a></span></p>
        <h2 class="Tools" id="Tools" name="Tools">Tools easing CSS development</h2>
        <ul>
          <li><span class="external">The </span><a class="external" href="http://jigsaw.w3.org/css-validator/">W3C CSS Validation Service</a> checks if a given CSS is valid. It is an invaluable debugging tool.</li>
          <li>Firefox' <a class="link-https" href="https://addons.mozilla.org/en-US/firefox/addon/1843">Firebug extension</a><span class="external">, a popular</span> extension of that navigator that allows to edit live CSS on watched sites. Very practical to test some changes, though this extension does much more.</li>
          <li><span class="external">Firefox' </span><a class="link-https" href="https://addons.mozilla.org/en-US/firefox/addon/60">Web Developer extension</a> also allows to watch and edit live CSS on watched sites. Simpler than Firebug, though less powerful.</li>
          <li>Firefox' <a class="external link-https" href="https://addons.mozilla.org/en-US/firefox/addon/179">EditCSS extension</a> allows editing CSS in the sidebar.</li>
        </ul>
        <p><span class="alllinks"><a href="/en-US/docs/tag/CSS:Tools" title="/en-US/docs/tag/CSS:Tools">View All...</a></span></p>
        <h2 class="Related_Topics" id="Related_Topics" name="Related_Topics">Related Topics</h2>
        <ul>
          <li>Mozilla Learn <a href="/en-US/learn/css" title="https://developer.mozilla.org/en-US/learn/css">CSS resources</a>.</li>
          <li>Open Web languages on which CSS is often applied: <a href="/en-US/docs/HTML" title="en-US/docs/HTML">HTML</a>, <a href="/en-US/docs/SVG" title="SVG">SVG</a>, <a href="/en-US/docs/XHTML" title="en-US/docs/XHTML">XHTML</a>, <a href="/en-US/docs/XML" title="en-US/docs/XML">XML</a>.</li>
          <li>Mozilla technologies which make extensive use of CSS: <a href="/en-US/docs/XUL" title="en-US/docs/XUL">XUL</a>, Firefox and Thunderbird <a href="/en-US/docs/Extensions" title="en-US/docs/Extensions">extensions</a> and <a href="/en-US/docs/Themes" title="en-US/docs/Themes">themes</a>.</li>
        </ul>
      </td>
    </tr>
  </tbody>
</table>
<p>&nbsp;</p>
Revert to this revision