CSS - Cascading Style Sheet


CSS - Cascading Style Sheet

Filename extension     .css
Internet media typetext/css
Developed byWorld Wide Web Consortium
Initial release17 December 1996; 16 years ago
Type of formatStyle sheet language
Standard(s)Level 1 (Recommendation)
Level 2 (Recommendation)
Level 2 Revision 1 (Recommendation)

Cascading Style Sheets (CSS) is a style sheet language used for describing the presentation semantics (the look and formatting) of a document written in a markup language. Its most common application is to style web pages written in HTML and XHTML, but the language can also be applied to any kind of XML document, including plain XML, SVG and XUL.


CSS specifies a priority scheme to determine which style rules apply if more than one rule matches against a particular element. In this so-called cascade, priorities or weights are calculated and assigned to rules, so that the results are predictable.
The CSS specifications are maintained by the World Wide Web Consortium (W3C). Internet media type (MIME type) text/css is registered for use with CSS by RFC 2318 (March 1998), and they also operate a free CSS validation service.







Syntax of CSS

CSS has a simple syntax and uses a number of English keywords to specify the names of various style properties.
A style sheet consists of a list of rules. Each rule or rule-set consists of one or more selectors, and a declaration block. A declaration-block consists of a list of declarations in braces. Each declaration itself consists of a property, a colon (:), and a value. If there are multiple declarations in a block, a semi-colon (;) must be inserted to separate each declaration.
Pseudo-classes are used in CSS selectors to permit formatting based on information that is outside the document tree. An often-used example of a pseudo-class is :hover, which identifies content only when the user 'points to' the visible element, usually by holding the mouse cursor over it. It is appended to a selector as in a:hover or #elementid:hover. A pseudo-class classifies document elements, such as :link or :visited, whereas a pseudo-element makes a selection that may consist of partial elements, such as :first-line or :first-letter.

selector [, selector2, ...] [:pseudo-class] {
 property: value;
[property2: value2;
 ...]
}
/* comment */
How to Use CSS ?

CSS information can be provided from various sources. CSS style information can be in a separate document or it can be embedded into an HTML document. Multiple style sheets can be imported. Different styles can be applied depending on the output device being used; for example, the screen version can be quite different from the printed version, so that authors can tailor the presentation appropriately for each medium.
Priority scheme for CSS sources (from highest to lowest priority):
  1. CSS information can be provided from various sources. CSS style information can be in a separate document or it can be embedded into an HTML document. Multiple style sheets can be imported. Different styles can be applied depending on the output device being used; for example, the screen version can be quite different from the printed version, so that authors can tailor the presentation appropriately for each medium.
    Priority scheme for CSS sources (from highest to lowest priority):
    • Author styles (provided by the web page author), in the form of:
      • Inline styles, inside the HTML document, style information on a single element, specified using the style attribute
      • Embedded style, blocks of CSS information inside the HTML itself
      • External style sheets, i.e., a separate CSS file referenced from the document
    • User style:
      • A local CSS file the user specifies with a browser option, which acts as an override applied to all documents
    • User agent style
      • Default styles applied by the user agent, i.e., the browser's default settings for each element's presentation
    The style sheet with the highest priority controls the content display. Declarations not set in the highest priority source are passed on to a source of lower priority, such as the user agent style. This process is called cascading.
The style sheet with the highest priority controls the content display. Declarations not set in the highest priority source are passed on to a source of lower priority, such as the user agent style. This process is called cascading.

An "external" CSS stylesheet file, as described above, can be associated with an HTML document using the following syntax:

<link href="path/to/file.css" rel="stylesheet">

An internal CSS styling can be done easily which can be used in an HTML document

<style ="text/css">
/* css codes */
</style>

It can also be used with HTML element with style property. the syntax of this is

<div style="property:value;">
any written document
</div>
[ Read More ]

PHP - Server Side Scripting Language


Some Common Information

PHPHypertext Preprocessor
Paradigm(s)imperative, object-oriented, procedural, reflective
Appeared in1995; 18 years ago[1]
Designed byRasmus Lerdorf
DeveloperThe PHP Group
Stable release5.4.10 (December 20, 2012; 20 days ago)
Typing discipline Dynamic, weak
Major implementationsZend Engine, Phalanger, Quercus, Project Zero, HipHop
Influenced byPerl, C, C++, Java, Tcl[1]
Implementation languageC
OSCross-platform
LicensePHP License
Usual filename extensionsCommon extensions .php Older, now uncommon extensions .phtml, .php4 .php3, .php5, .phps
Websitewww.php.net

Some Introduction about PHP

PHP is an open source server-side scripting language designed for Web development to produce dynamic Web pages. It is one of the first developed server-side scripting languages to be embedded into an HTML source document rather than calling an external file to process data. The code is interpreted by a Web server with a PHP processor module which generates the resulting Web page. It also has evolved to include a command-line interface capability and can be used in standalone graphical applications. PHP can be deployed on most Web servers and also as a standalone shell on almost every operating system and platform, free of charge. A competitor to Microsoft's Active Server Pages (ASP) server-side script engine and similar languages, PHP is installed on more than 20 million Web sites and 1 million Web servers. Notable software that uses PHP includes Drupal, Joomla, MediaWiki, and WordPress.

PHP originally stood for Personal Home Page, it is now said to stand for PHP: Hypertext Preprocessor

PHP is free software released under the PHP License. From 1995. number of PHP versions has been released which include addition of new codes and various bugs fixes. From that time PHP has released various versions starting from 1.0.0 to latest release 5.4.10. The development of PHP 6 has been delayed because the developers have decided the current approach to handling of instance unicode is not a good one, and are considering alternate ways in the next version of PHP. The updates that were intended for PHP 6 were added to PHP 5.3.0 and 5.4.0 instead.

Beginning on June 28, 2011, the PHP Group began following a timeline for when new versions of PHP will be released. Under this timeline, at least one release should occur every month. Once per year, a minor release should occur which can include new features. Every minor release should at least have 2 years of security and bug fixes, followed by at least 1 year of only security fixes, for a total of a 3 year release process for every minor release. No new features (unless small and self-contained) will be introduced into a minor release during the 3 year release process.

Syntax of PHP : Server Side Scripting

The PHP interpreter only executes PHP code within its delimiters. Anything outside its delimiters is not processed by PHP. The most common delimiters are <?php to open and ?> to close PHP sections. <script language="php"> and </script> delimiters are also available, as are the shortened forms <? or<?= (which is used to echo back a string or variable) and ?> as well as ASP-style short forms <% or <%= and %>.
In terms of keywords and language syntax, PHP is similar to most high level languages that follow the C style syntax. if conditionsfor and while loops, and function returns are similar in syntax to languages such as C, C++, C#, Java and Perl.
[ Read More ]