Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 683501 of CSS

  • Revision slug: Glossary/CSS
  • Revision title: CSS
  • Revision id: 683501
  • Created:
  • Creator: Avinash_Chakravarthy
  • Is current revision? No
  • Comment

Revision Content

Summary

CSS (Cascading Style Sheets) is a declarative language used to control the presentation and appearance of web pages.

 CSS follows Style Rules called Style Declarations, These rules of CSS are applied to the selected pages or a portion of the element for the better outcome of the page.  At the heart of CSS is the Style Declaration as it contains the information (properties and values) that will determine the overall appearance of a web page.

In Depth

The Cascading Style Sheets Language is one of the three core technologies of the web, along with {{Glossary("HTML")}} and {{Glossary("JavaScript")}}. It is mainly used to style {{Glossary("Element","HTML element")}}, but can be also used with other markup language such as {{Glossary("SVG")}} or any {{Glossary("XML")}} dialect.

Technically speaking, a CSS rule defines how a set of {{Glossary("Element","elements")}} must be rendered by a {{Glossary("Browser","web browser")}}. A CSS rule is a set of {{Glossary("CSS Property","properties")}} associated with a {{Glossary("selector")}}. Here is a little example that makes every HTML paragraph written in yellow text on a black background:

/* The selector "p" indicate that all paragraph in the document will be affected by that rule */
p {
  /* The "color" property define the color of the text. */
  /* In this case, it will be yellow */
  color: yellow;

  /* The "background-color" property define the color of the background */
  /* In this case, it will be black */
  background-color: black
}

The "Cascading" part of CSS come from the various rules that define how the {{Glossary("Selector", "selectors")}} are prioritized to change the look and feel of a whole page. This is a very important feature, as a professional web site can be having thousands of CSS rules.

Know more

General knowledge

Learning CSS

Technical reference

Revision Source

<h2 id="Summary">Summary</h2>
<p><strong>CSS</strong> (<em>Cascading Style Sheets</em>) is a declarative language used to control the presentation and appearance of web pages.</p>
<p>&nbsp;CSS follows Style Rules called Style Declarations, These rules of CSS are applied to the selected pages or a portion of the element for the better outcome of the page.&nbsp; At the heart of CSS is the Style Declaration as it contains the information (properties and values) that will determine the overall appearance of a web page.</p>
<h2 id="In_Depth">In Depth</h2>
<p>The Cascading Style Sheets Language is one of the three core technologies of the web, along with {{Glossary("HTML")}} and {{Glossary("JavaScript")}}. It is mainly used to style {{Glossary("Element","HTML element")}}, but can be also used with other markup language such as {{Glossary("SVG")}} or any {{Glossary("XML")}} dialect.</p>
<p>Technically speaking, a CSS rule defines how a set of {{Glossary("Element","elements")}} must be rendered by a {{Glossary("Browser","web browser")}}. A CSS rule is a set of {{Glossary("CSS Property","properties")}} associated with a {{Glossary("selector")}}. Here is a little example that makes every HTML paragraph written in yellow text on a black background:</p>
<pre class="brush: css">
/* The selector "p" indicate that all paragraph in the document will be affected by that rule */
p {
  /* The "color" property define the color of the text. */
  /* In this case, it will be yellow */
  color: yellow;

  /* The "background-color" property define the color of the background */
  /* In this case, it will be black */
  background-color: black
}</pre>
<p>The "Cascading" part of CSS come from the various rules that define how the {{Glossary("Selector", "selectors")}} are prioritized to change the look and feel of a whole page. This is a very important feature, as a professional web site can be having thousands of CSS rules.</p>
<h2 id="Know_more">Know more</h2>
<h3 id="General_knowledge">General knowledge</h3>
<ul>
 <li><a href="https://en.wikipedia.org/wiki/Cascading_Style_Sheets">CSS on Wikipedia</a></li>
</ul>
<h3 id="Learning_CSS">Learning CSS</h3>
<ul>
 <li><a href="https://www.codecademy.com/en/tracks/web" rel="external">The web course on codecademy.com</a></li>
 <li><a href="https://www.expression-web-tutorial.com/Types_CSS_Styles.html">Three Types of CSS</a></li>
 <li><a href="https://pumpula.net/p/apps/css-vocabulary/" rel="external">The CSS Vocabulary</a></li>
</ul>
<h3 id="Technical_reference">Technical reference</h3>
<ul>
 <li><a href="/en-US/docs/Web/CSS">The CSS documentation on MDN</a></li>
 <li><a href="https://www.w3.org/Style/CSS/current-work" rel="external">The CSS Working Group current work</a></li>
</ul>
Revert to this revision