CSS Cheat Sheet.

A CSS cheat sheet is a very useful instrument for coders since it’s a simple one-page reference sheet, listing all CSS selectors (as of CSS 2.1) and properties. It also includes a visual example of the box model and unit reference for CSS units:

CSS cheat sheet by AddedBytes.com

CSS cheat sheet by AddedBytes.com

The CSS cheat sheet features at least the following sections: Selectors, Pseudo-Selectors and Pseudo-Classes, Sizes and Colours, Positioning, Dimensions, Color/Background, Text, Fonts, Boxes, Tables, Paging, Interfaces.

Many thanks to AddedBytes.com for this!

DiggFacebookMySpaceTwitterTechnorati FavoritesEvernoteDeliciousShare
Tagged with: CSStutorialWeb
 

Positioning CSS elements.

In this section I will explain how to position CSS elements.

CSS positioning
(more…)

DiggFacebookMySpaceTwitterTechnorati FavoritesEvernoteDeliciousShare
Tagged with: boxCSSpositioningtutorial
 

CSS Margin Collapsing

Maybe many guys out there, when they start to learn how to use CSS, don’t know that when two or more vertical margins meet in a layout, they collaps to form a single margin. Which will be the height of this margin? simple.. the larger of the two margins.

This is true only for block boxes, in the normal flow of the document (not for inline, floated, absoluted positioned boxes..).

This is the case for example of two elements vertically aligned:

Margin collapsing tutorial

The result will be the following:

Margin collapsed

(more…)

DiggFacebookMySpaceTwitterTechnorati FavoritesEvernoteDeliciousShare
Tagged with: boxCSSmarginstutorial
 

CSS BOX Model.

One of the most important thing to understand about CSS is the Box Model. The Box Model how elements are displayed. Every element that we use in the page is considered to be a rectangular box. The properties for this box are as follow: content, padding, border and margin.

You can understand how this element interact from the following visual representation:

CSS BOX Model

(more…)

DiggFacebookMySpaceTwitterTechnorati FavoritesEvernoteDeliciousShare
Tagged with: bordersboxCSSmarginspaddingtutorial
 

A Document Type Definition (DTD) is a set of rules that define the document structure in a particular version of XML or (X)HTML. A browser will parse the web page looking for the Document Type (DOCTYPE) Declaration in your CSS code and will use these rules to validate the page.

An example of Document Type (DOCTYPE) Declaration is:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

The DOCTYPE declaration is included at the start of the (X)HTML document. It is required in order for the page to validate as the browser needs to know which DTD to use in order to process the page correctly.

In the previous example the DTD XHTML 1.0 Transitional is used.

(more…)

DiggFacebookMySpaceTwitterTechnorati FavoritesEvernoteDeliciousShare
Tagged with: browserCSSdoctypeDTDhtmltutorialvalidatorw3cxml
 

CSS Simple Layouts.

Ok. Before we start.. what is CSS?

Cascading Style Sheets (CSS) is a stylesheet language used to describe the presentation of a document written in a markup language as for example HTML, HTML or even XML. The CSS specifications are maintained by the World Wide Web Consortium (W3C).

The aim of CSS is then to position the content of a web page. CSS is used by the author (and even the readers!) of websites to define colors, fonts, layout, and other aspects of the presentation of a document.

CSS layouts

(more…)

DiggFacebookMySpaceTwitterTechnorati FavoritesEvernoteDeliciousShare
Tagged with: CSSdownloadhtmllayouttutorialw3cWebxml