It was developed by Håkon Wium Lie and Bert Bos. It is a language
used to specify the presentation aspects (eg. layout and formating) of structurally marked up documents.
It is a style sheet language used for describing the presentation of a document written in a markup
language.
Although most often used to set the visual style of web pages and user interfaces written in HTML and XHTML,
the language can be applied to any XML document, including plain XML, SVG and XUL, and is applicable to
rendering in speech,
or on other media.
CSS Versions:
Version
Description
CSS1
CSS1 is a simple style sheet mechanism that allows authors and readers to attach style (e.g. fonts,
colors and spacing) to HTML documents.
The CSS1 language is human readable and writable, and expresses style in common desktop publishing
terminology.
CSS2
This specification defines Cascading Style Sheets, level 2 (CSS2).
CSS2 is a style sheet language that allows authors and users to attach style
(e.g., fonts, spacing, and aural cues) to structured documents (e.g., HTML documents and XML
applications).
By separating the presentation style of documents from the content of documents,
CSS2 simplifies Web authoring and site maintenance.
CSS3
CSS3 is the latest evolution of the Cascading Style Sheets language and aims at extending CSS2.1.
It brings a lot of long-awaited novelties, like rounded corners, shadows, gradients, transitions or
animations,
as well as new layouts like multi-columns, flexible box or grid layouts.
Experimental parts are vendor-prefixed and should either be avoided in production environments,
or used with extreme caution as both their syntax and semantics can change in the future.
HTML/XHTML Style Sheets
Author Style
This refers to the maker of the website who embeds all the styles of a website in CSS files or inline
into the html.
External Style Sheets
Embedded Styles
Inline Styles
User Style
This refers to you or the end-user viewing a website. You can override the author's styles by defining
your own styles or CSS.
Typically this is done if you need to have larger font sizes, varying colors, etc. for accessibility
reasons.
User Agent Style
This style sheet refers to your browser such as Internet Explorer,Chrome,Firefox or any other browser. It
has its own default style sheet and has the lowest priority.
Declarations
Normal
These are styles that are defined normally. They are processed in a top down methodology.
So if you had a background-color:#00ff00;
followed by background-color:#000000;
for the same element, the black background will have precedence.
Important
This overrides normal styles which allows more emphasis to a css value.
So in the same example, if the style was defined as: background-color:#00ff00 !important;
background-color:#000000;, the background color of the element will be yellow even though black was
defined afterwards.
CSS Statements (At-Rules)
CSS Statement
Description
@charset
It referes to the character set that the style sheet used.
@import
It is used when css engine includes an external style sheet.
@namespace
lets the css engine consider its contents to be prefixed with XML namespace.
@document
This is a conditional group rule that applies contents if document that uses the style sheet meets
defined
conditions.
@fontface
It describes external font aspect.
@keyframes
It describes css animation sequence aspect.
@media (CSS Conditionals Level 3)
This is a conditional group rule at which contents are applied only if device meets media query
defined
conditions.
@page
This describes changes in layout aspect to be applied upon document printing.
@supports (CSS Conditionals Level 3)
This is a conditional group rule that applies contents if browser meets defined conditions.
*conditional group rule - may be considered to be something like property values that can be categorized
based on common syntax.
Simple Selector
Type Selector
This selects elements of the document by node names.
number of class selectors, attribute selectors and pseudo classes
number of type selectors and pseudo classes
number of type selectors and pseudo-elements
when the CSS file is read from top to bottom, a style for a particular element or class
overrides the style before it that applies to the same element or class.
CSS Declarations
properties
shorthand properties
vendor-specific extensions
values
keywords
numbers(integers and reals in decimal notation)
dimensions
length, angle, duration, frequency, resolution
length units:
font-relative: em, ex, cn, rem
viewport-percentage: vw, vh, vmin, vmax
absolute length: cm, mm, q, in, pt, pc, px
angle units: deg, grad, rad, turn
duration units: s, ms
frequency units: h2, kh2
resolution units: dpi, dpcm, dppx
percentage
URLs and URIs
colors
strings
counters
functions: calc(), attr(), counter(), counters()
CSS Frameworks
There are a lot of css frameworks avaiable today and one of the most prominent of them all is Twitter
Bootstrap. In using such frameworks you don't have to do any kind of programming/coding to have a default
look and feel for your site.
Since this site uses Bootstrap we can demostrate it using the examples below
Tables
Here is an example of how tables can be styled by just using the class table(class="table")
First Name
Last Name
Course
Christopher
Espiritu
BSIT
Maureen
Calpito
BSIT
Christopher
Santos
BSIT
Danielle
Estrellado
BSIT
Faye
Cabalse
BSIT
Buttons
Bootstrap has its buttons class built in
Images
Here we can see the three img- class available for us: rounded | circle | thumbnail
class="img-rounded img-responsive"
class="img-circle img-responsive"
class="img-thumbnail img-responsive"
Text Colors
class="text-danger"
class="text-info"
class="text-success"
CSS Preprocessors
CSS is designed to be a simple language.
It’s intuitive to learn CSS and write it on small websites,
but on larger, more complex websites, writing CSS can become very tedious.
That’s where preprocessors come in. Developers wanted more options when writing their style sheets,
so they created CSS preprocessors to add programming functionality.
Example
Description
Sass
It is the most mature, stable, and powerful professional grade CSS extension language in the world.
It is also known as the indented syntax.
SCSS
It is a CSS-like syntax. It is closer to CSS than Sass. That being said,
Sass maintainers have also worked to make both syntaxes closer to each other by moving ! (variable
sign)
and = (assignment sign) from the indented syntax to $ and : from SCSS.
References
(n.d.). Retrieved April 23, 2017, from https://www.w3.org/TR/REC-CSS1/
Cascading Style Sheets, level 2CSS2 Specification. (n.d.). Retrieved April 23, 2017, from
https://www.w3.org/TR/REC-CSS2/
CSS3. (n.d.). Retrieved April 23, 2017, from https://developer.mozilla.org/en/docs/Web/CSS/CSS3
Cascading Style Sheets. (2017, April 19). Retrieved April 23, 2017, from
https://en.wikipedia.org/wiki/Cascading_Style_Sheets
User vs Author vs User Agent style sheets. (n.d.). Retrieved April 23, 2017, from
http://praveen-vemulapalli.blogspot.com/2013/01/user-vs-author-vs-user-agent-style.html
CSS Preprocessors and Frameworks. (n.d.). Retrieved April 23, 2017, from
https://www.codeschool.com/beginners-guide-to-web-development/css-preprocessors-and-frameworks
Syntactically Awesome Style Sheets. (n.d.). Retrieved April 23, 2017, from http://sass-lang.com/
Giraudel, H. (2014, April 28). What's the Difference Between Sass and SCSS? Retrieved April 23, 2017,
from https://www.sitepoint.com/whats-difference-sass-scss/
Bader, J. (2007, December 31). Bert Bos. Retrieved April 23, 2017, from
https://www.flickr.com/photos/jpbader/2150861734
Main Page. (n.d.). Retrieved April 23, 2017, from
https://commons.wikimedia.org/wiki/File:H%C3%A5kon_Wium_Lie.jpg
(n.d.). Retrieved April 23, 2017, from https://www.w3schools.com/css/
Type selectors. (n.d.). Retrieved April 23, 2017, from
https://developer.mozilla.org/en/docs/Web/CSS/Type_selectors
Roberts, A. (2004, February 01). Universal Selector (CSS Selector) — SitePoint. Retrieved April 23,
2017, from https://www.sitepoint.com/web-foundations/universal-selector-css-selector/