CSS

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

Declarations

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

CSS Rule Precedence

user agent important declarations
user important declarations
author important declarations
author normal declarations
user normal declarations
user agent normal declarations
inline style
number of ID selectors
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

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" https
class="img-circle img-responsive" https
class="img-thumbnail img-responsive" https

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