Tuesday, March 14, 2006

CSS Summary

CSS (Cascading style sheets) are used to separate content from presentation. CSS describe the presentation of a document written most of the times in HTML. CSS is used to define colors, fonts and layout.


A style sheet file consists of a list of rules.
Each rule consists of:

  • -one or more comma-separated selectors
  • -declaration block (a list of semicolon-separated declarations in curly braces)


In CSS, selectors are used to declare which elements a style applies to, a kind of match expression. Here are some examples of selector syntax:


  • All elements: that is, using the * selector

  • By element name: e.g. for all p or h2 elements

  • Descendants: e.g. for a elements that are descendants of li elements (e.g links inside lists) the selector is li a

  • class or id attributes: e.g. .class and/or #id for elements with class="class" or id="id"

  • Adjacent elements: e.g. for all p elements preceded by h2 elements, the selector would be h2 + p

  • Direct child element: e.g. for all span elements inside p, but no span elements deeper within the hierarchy, the selector would be p > span

  • By attribute:e.g. for all <input type="text"> the selector would be input[type="text"]





Each declaration consists of a property, a colon : and a value.

Example:

p {

font-family: "Garamond", serif;

}

h2 {

font-size: 110%;

color: red;

background: white;

}


To use a CSS style sheet created a file with the sytle sheet file with the rules and link it or import it using:

<link rel="stylesheet" href="example.css" type="text/css" >
<style type="text/css"> @import "example.css"</style>

For more information on CSS follow the link http://en.wikipedia.org/wiki/Cascading_Style_Sheets

HTML and Dynamic HTML

HTML is a markup language used for the creation of web pages. HTML is used to structure information, define headings, paragraphs, lists, tables, etc.

Markup element types:
  • Structural (h1, h2)
  • Presentational bold (b)
  • Hypertex Wikipedia (href)

For more information on HTML elements see http://en.wikipedia.org/wiki/HTML_element.

The document type definition:

All html documents should start with a DocType declaration and Document Type Definition.

Dynamic HTML or DHTML is a way of creating interactive (non-static) web pages by using a combination of HTML static, client-side scripting language such as Java-Script, CSS (Cascading style sheets) and the DOM (Document Object Model). More information about Dynamic HTML can be find by following the link http://en.wikipedia.org/wiki/Dynamic_HTML.




World Wide Web Basics


Htpp is a protocol to transmit information in the world wide web. It is a request/response protocol between the client and the server. The client is most of the times a web browser that issues a request to a server connecting to a particular port (by default the port is 80).
The server issues a response that contains a status and a message.
The request message consists of a request line, a header, a empty line and a optional message body.

The request line contains information about the:

  • request method
  • resource identifier
  • protocol

The request method is one of the following:

  • GET
  • HEAD
  • POST
  • DELETE
  • OTHERS

The resource identifier is a path or a path and a filename.

The headers are pairs of key: value separated. An example is "Accept-Language: en" .

The protocol version can be specified by HTTP/1.0 or HTTP/1.1 (current version).

Example:

The reply:

  • HTTP/1.1 200 OK
  • ...
  • Server:...
  • Content-Type: text/html
  • And the message

More detailed information can be found at wikipedia.

Free encyclopedia online

When you are looking for some word definition look in the wikipedia. It is a good place to start...