Wednesday, 25 September 2013

css tutorial

CSS Tutorial

What is CSS?

  • CSS stands for Cascading Style Sheets
  • Styles define how to display HTML elements
  • Styles were added to HTML 4.0 to solve a problem
  • External Style Sheets can save a lot of work
  • External Style Sheets are stored in CSS files

CSS Syntax

A CSS rule has two main parts: a selector, and one or more declarations:
http://www.w3schools.com/css/selector.gif
The selector is normally the HTML element you want to style.
Each declaration consists of a property and a value.
The property is the style attribute you want to change. Each property has a value.

CSS Example

A CSS declaration always ends with a semicolon, and declaration groups are surrounded by curly brackets:
p {color:red;text-align:center;}
To make the CSS more readable, you can put one declaration on each line, like this

CSS Comments

Comments are used to explain your code, and may help you when you edit the source code at a later date. Comments are ignored by browsers.
A CSS comment begins with "/*", and ends with "*/", like this:

CSS Id and Class

The id and class Selectors

In addition to setting a style for a HTML element, CSS allows you to specify your own selectors called "id" and "class".

The id Selector

The id selector is used to specify a style for a single, unique element.
The id selector uses the id attribute of the HTML element, and is defined with a "#".
The style rule below will be applied to the element with id="para1":

<!DOCTYPE html>

<html>

<head>

<style>

#para1

{

text-align:center;

color:red;

}

</style>

</head>

 

<body>

<p id="para1">Hello World!</p>

<p>This paragraph is not affected by the style.</p>

</body>

</html>

 The class Selector

The class selector is used to specify a style for a group of elements. Unlike the id selector, the class selector is most often used on several elements.
This allows you to set a particular style for many HTML elements with the same class.
The class selector uses the HTML class attribute, and is defined with a "."
In the example below, all HTML elements with class="center" will be center-aligned:

CSS How To...

When a browser reads a style sheet, it will format the document according to it.

Three Ways to Insert CSS

There are three ways of inserting a style sheet:
  • External style sheet
  • Internal style sheet
  • Inline style

External Style Sheet

An external style sheet is ideal when the style is applied to many pages. With an external style sheet, you can change the look of an entire Web site by changing one file. Each page must link to the style sheet using the <link> tag. The <link> tag goes inside the head section:
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
An external style sheet can be written in any text editor. The file should not contain any html tags. Your style sheet should be saved with a .css extension. An example of a style sheet file is shown below:
hr {color:sienna;}
p {margin-left:20px;}
body {background-image:url("images/back40.gif");}
Remark Do not add a space between the property value and the unit (such as margin-left:20 px). The correct way is: margin-left:20px

Internal Style Sheet

An internal style sheet should be used when a single document has a unique style. You define internal styles in the head section of an HTML page, by using the <style> tag, like this:
<head>
<style>
hr {color:sienna;}
p {margin-left:20px;}
body {background-image:url("images/back40.gif");}
</style>
</head>


Inline Styles

An inline style loses many of the advantages of style sheets by mixing content with presentation. Use this method sparingly!
To use inline styles you use the style attribute in the relevant tag. The style attribute can contain any CSS property. The example shows how to change the color and the left margin of a paragraph:
<p style="color:sienna;margin-left:20px">This is a paragraph.</p>


Multiple Style Sheets

If some properties have been set for the same selector in different style sheets, the values will be inherited from the more specific style sheet. 
For example, an external style sheet has these properties for the h3 selector:
h3
{
color:red;
text-align:left;
font-size:8pt;
}
And an internal style sheet has these properties for the h3 selector:
h3
{
text-align:right;
font-size:20pt;
}
If the page with the internal style sheet also links to the external style sheet the properties for h3 will be:
color:red;
text-align:right;
font-size:20pt;
The color is inherited from the external style sheet and the text-alignment and the font-size is replaced by the internal style sheet.

Multiple Styles Will Cascade into One

Styles can be specified:
  • inside an HTML element
  • inside the head section of an HTML page
  • in an external CSS file
Tip: Even multiple external style sheets can be referenced inside a single HTML document.

Cascading order

What style will be used when there is more than one style specified for an HTML element?
Generally speaking we can say that all the styles will "cascade" into a new "virtual" style sheet by the following rules, where number four has the highest priority:
1.    Browser default
2.    External style sheet
3.    Internal style sheet (in the head section)
4.    Inline style (inside an HTML element)
So, an inline style (inside an HTML element) has the highest priority, which means that it will override a style defined inside the <head> tag, or in an external style sheet, or in a browser (a default value).

CSS Background

CSS background properties are used to define the background effects of an element.
CSS properties used for background effects:
  • background-color
  • background-image
  • background-repeat
  • background-attachment
  • background-position

Background Color

The background-color property specifies the background color of an element.
The background color of a page is defined in the body selector:

body {background-color:#b0c4de;}

h1 {background-color:#6495ed;}
p {background-color:#e0ffff;}
div {background-color:#b0c4de;}

Background Image

The background-image property specifies an image to use as the background of an element.
By default, the image is repeated so it covers the entire element.
The background image for a page can be set like this:

body {background-image:url('paper.gif');}

Background Image - Repeat Horizontally or Vertically

By default, the background-image property repeats an image both horizontally and vertically.
Some images should be repeated only horizontally or vertically, or they will look strange, like this: 

body
{
background-image:url('gradient2.png');
}

If the image is repeated only horizontally (repeat-x), the background will look better:

body
{
background-image:url('gradient2.png');
background-repeat:repeat-x;
}

Background Image - Set position and no-repeat

Remark When using a background image, use an image that does not disturb the text.
Showing the image only once is specified by the background-repeat property:

body
{
background-image:url('img_tree.png');
background-repeat:no-repeat;
}

In the example above, the background image is shown in the same place as the text. We want to change the position of the image, so that it does not disturb the text too much.
The position of the image is specified by the background-position property:

Example

body
{
background-image:url('img_tree.png');
background-repeat:no-repeat;
background-position:right top;
}

Text Color

The color property is used to set the color of the text.
With CSS, a color is most often specified by:
  • a HEX value - like "#ff0000"
  • an RGB value - like "rgb(255,0,0)"
  • a color name - like "red"

body {color:blue;}
h1 {color:#00ff00;}
h2 {color:rgb(255,0,0);}

Text Alignment

The text-align property is used to set the horizontal alignment of a text.
Text can be centered, or aligned to the left or right, or justified.
When text-align is set to "justify", each line is stretched so that every line has equal width, and the left and right margins are straight (like in magazines and newspapers).

h1 {text-align:center;}
p.date {text-align:right;}
p.main {text-align:justify;}

Text Decoration

The text-decoration property is used to set or remove decorations from text.
The text-decoration property is mostly used to remove underlines from links for design purposes:

 

a {text-decoration:none;}

h1 {text-decoration:overline;}
h2 {text-decoration:line-through;}
h3 {text-decoration:underline;}

Text Transformation

The text-transform property is used to specify uppercase and lowercase letters in a text.
It can be used to turn everything into uppercase or lowercase letters, or capitalize the first letter of each word.

 

p.uppercase {text-transform:uppercase;}
p.lowercase {text-transform:lowercase;}
p.capitalize {text-transform:capitalize;}

Use a Combination of Percent and Em

The solution that works in all browsers, is to set a default font-size in percent for the <body> element:

body {font-size:100%;}
h1 {font-size:2.5em;}
h2 {font-size:1.875em;}
p {font-size:0.875em;}

CSS Links

Links can be styled in different ways.

Styling Links

Links can be styled with any CSS property (e.g. color, font-family, background, etc.).
In addition, links can be styled differently depending on what state they are in.
The four links states are:
  • a:link - a normal, unvisited link
  • a:visited - a link the user has visited
  • a:hover - a link when the user mouses over it
  • a:active - a link the moment it is clicked

Example

a:link {color:#FF0000;}      /* unvisited link */
a:visited {color:#00FF00;}  /* visited link */
a:hover {color:#FF00FF;}  /* mouse over link */
a:active {color:#0000FF;}  /* selected link */

CSS Lists

The CSS list properties allow you to:
·         Set different list item markers for ordered lists
·         Set different list item markers for unordered lists
·         Set an image as the list item marker

List

In HTML, there are two types of lists:
  • unordered lists - the list items are marked with bullets
  • ordered lists - the list items are marked with numbers or letters
With CSS, lists can be styled further, and images can be used as the list item marker.

Different List Item Markers

The type of list item marker is specified with the list-style-type property:

<!DOCTYPE html>

<html>

<head>

<style>

ul.a {list-style-type:circle;}

ul.b {list-style-type:square;}

ol.c {list-style-type:upper-roman;}

ol.d {list-style-type:lower-alpha;}

</style>

</head>

 

<body>

<p>Example of unordered lists:</p>

 

<ul class="a">

  <li>Coffee</li>

  <li>Tea</li>

  <li>Coca Cola</li>

</ul>

 

<ul class="b">

  <li>Coffee</li>

  <li>Tea</li>

  <li>Coca Cola</li>

</ul>

 

<p>Example of ordered lists:</p>

 

<ol class="c">

  <li>Coffee</li>

  <li>Tea</li>

  <li>Coca Cola</li>

</ol>

 

<ol class="d">

  <li>Coffee</li>

  <li>Tea</li>

  <li>Coca Cola</li>

</ol>

 

</body>

</html>

…………………………………………………..

<!DOCTYPE html>

<html>

<head>

<style>

ul.a {list-style-type:circle;}

ul.b {list-style-type:square;}

ol.c {list-style-type:upper-roman;}

ol.d {list-style-type:lower-alpha;}

</style>

</head>

 

<body>

<p>Example of unordered lists:</p>

 

<ul class="a">

  <li>Coffee</li>

  <li>Tea</li>

  <li>Coca Cola</li>

</ul>

 

<ul class="b">

  <li>Coffee</li>

  <li>Tea</li>

  <li>Coca Cola</li>

</ul>

 

<p>Example of ordered lists:</p>

 

<ol class="c">

  <li>Coffee</li>

  <li>Tea</li>

  <li>Coca Cola</li>

</ol>

 

<ol class="d">

  <li>Coffee</li>

  <li>Tea</li>

  <li>Coca Cola</li>

</ol>

 

</body>

</html>

 

CSS Box Model

The CSS Box Model

All HTML elements can be considered as boxes. In CSS, the term "box model" is used when talking about design and layout.
The CSS box model is essentially a box that wraps around HTML elements, and it consists of: margins, borders, padding, and the actual content.
The box model allows us to place a border around elements and space elements in relation to other elements.
The image below illustrates the box model:


CSS box-model

Explanation of the different parts:
  • Margin - Clears an area around the border. The margin does not have a background color, it is completely transparent
  • Border - A border that goes around the padding and content. The border is affected by the background color of the box
  • Padding - Clears an area around the content. The padding is affected by the background color of the box
  • Content - The content of the box, where text and images appear
In order to set the width and height of an element correctly in all browsers, you need to know how the box model works.

Width and Height of an Element

Remark Important: When you set the width and height properties of an element with CSS, you just set the width and height of the content area. To calculate the full size of an element, you must also add the padding, borders and margins.
The total width of the element in the example below is 300px:
width:250px;
padding:10px;
border:5px solid gray;
margin:10px;
Let's do the math:
250px (width)
+ 20px (left + right padding)
+ 10px (left + right border)
+ 20px (left + right margin)
= 300px
Assume that you had only 250px of space. Let's make an element with a total width of 250px:

<!DOCTYPE html>

<html>

<head>

<style>

div.ex

{

width:220px;

padding:10px;

border:5px solid gray;

margin:0px;

}

</style>

</head>

 

<body>

 

<img src="w3css.gif" width="250" height="250" />

 

<div class="ex">The picture above is 250px wide.

The total width of this element is also 250px.</div>

 

</body>

</html>

…………………………

The total width of an element should be calculated like this:
Total element width = width + left padding + right padding + left border + right border + left margin + right margin
The total height of an element should be calculated like this:
Total element height = height + top padding + bottom padding + top border + bottom border + top margin + bottom margin

CSS Border

CSS Border


CSS Border Properties

The CSS border properties allow you to specify the style and color of an element's border.

Border Style

The border-style property specifies what kind of border to display.
Remark None of the border properties will have ANY effect unless the border-style property is set!

border-style values:

none: Defines no border
dotted: Defines a dotted border
dashed: Defines a dashed border
solid: Defines a solid border
double: Defines two borders. The width of the two borders are the same as the border-width value
groove: Defines a 3D grooved border. The effect depends on the border-color value
ridge: Defines a 3D ridged border. The effect depends on the border-color value
inset: Defines a 3D inset border. The effect depends on the border-color value
outset: Defines a 3D outset border. The effect depends on the border-color value
Try it yourself: Set the style of the border

Border Width

The border-width property is used to set the width of the border.
The width is set in pixels, or by using one of the three pre-defined values: thin, medium, or thick.
Note: The "border-width" property does not work if it is used alone. Use the "border-style" property to set the borders first.

Example

p.one
{
border-style:solid;
border-width:5px;
}
p.two
{
border-style:solid;
border-width:medium;
}


Border Color

The border-color property is used to set the color of the border. The color can be set by:
  • name - specify a color name, like "red"
  • RGB - specify a RGB value, like "rgb(255,0,0)"
  • Hex - specify a hex value, like "#ff0000"
You can also set the border color to "transparent".
Note: The "border-color" property does not work if it is used alone. Use the "border-style" property to set the borders first.

Example

p.one
{
border-style:solid;
border-color:red;
}
p.two
{
border-style:solid;
border-color:#98bf21;
}


Border - Individual sides

In CSS it is possible to specify different borders for different sides:

Example

p
{
border-top-style:dotted;
border-right-style:solid;
border-bottom-style:dotted;
border-left-style:solid;
}
The example above can also be set with a single property:

Example

border-style:dotted solid;
The border-style property can have from one to four values.
  • border-style:dotted solid double dashed;
    • top border is dotted
    • right border is solid
    • bottom border is double
    • left border is dashed

  • border-style:dotted solid double;
    • top border is dotted
    • right and left borders are solid
    • bottom border is double

  • border-style:dotted solid;
    • top and bottom borders are dotted
    • right and left borders are solid

  • border-style:dotted;
    • all four borders are dotted
The border-style property is used in the example above. However, it also works with border-width and border-color.

Border - Shorthand property

As you can see from the examples above, there are many properties to consider when dealing with borders.
To shorten the code, it is also possible to specify all the individual border properties in one property. This is called a shorthand property.
The border property is a shorthand for the following individual border properties:
  • border-width
  • border-style (required)
  • border-color

Example

border:5px solid red;

CSS Outlines

An outline is a line that is drawn around elements (outside the borders) to make the element "stand out".
The outline properties specify the style, color, and width of an outline.

CSS Outline

An outline is a line that is drawn around elements (outside the borders) to make the element "stand out".
However, the outline property is different from the border property.
The outline is not a part of an element's dimensions; the element's total width and height is not affected by the width of the outline.
Outline 

CSS Margin

The CSS margin properties define the space around elements.

Margin

The margin clears an area around an element (outside the border). The margin does not have a background color, and is completely transparent.
The top, right, bottom, and left margin can be changed independently using separate properties. A shorthand margin property can also be used, to change all margins at once.

Possible Values

Value
Description
auto
The browser calculates a margin
length
Specifies a margin in px, pt, cm, etc. Default value is 0px
%
Specifies a margin in percent of the width of the containing element
inherit
Specifies that the margin should be inherited from the parent element
Remark It is possible to use negative values, to overlap content.

Margin - Individual sides

In CSS, it is possible to specify different margins for different sides:

Example

margin-top:100px;
margin-bottom:100px;
margin-right:50px;
margin-left:50px;


Margin - Shorthand property

To shorten the code, it is possible to specify all the margin properties in one property. This is called a shorthand property.
The shorthand property for all the margin properties is "margin":

Example

margin:100px 50px;
The margin property can have from one to four values.
  • margin:25px 50px 75px 100px;
    • top margin is 25px
    • right margin is 50px
    • bottom margin is 75px
    • left margin is 100px

  • margin:25px 50px 75px;
    • top margin is 25px
    • right and left margins are 50px
    • bottom margin is 75px

  • margin:25px 50px;
    • top and bottom margins are 25px
    • right and left margins are 50px

  • margin:25px;
    • all four margins are 25px

CSS Padding

The CSS padding properties define the space between the element border and the element content.

Padding

The padding clears an area around the content (inside the border) of an element. The padding is affected by the background color of the element.
The top, right, bottom, and left padding can be changed independently using separate properties. A shorthand padding property can also be used, to change all paddings at once.

Possible Values

Value
Description
length
Defines a fixed padding (in pixels, pt, em, etc.)
%
Defines a padding in % of the containing element


Padding - Individual sides

In CSS, it is possible to specify different padding for different sides:

Example

padding-top:25px;
padding-bottom:25px;
padding-right:50px;
padding-left:50px;


Padding - Shorthand property

To shorten the code, it is possible to specify all the padding properties in one property. This is called a shorthand property.
The shorthand property for all the padding properties is "padding":

Example

padding:25px 50px;
The padding property can have from one to four values.
  • padding:25px 50px 75px 100px;
    • top padding is 25px
    • right padding is 50px
    • bottom padding is 75px
    • left padding is 100px

  • padding:25px 50px 75px;
    • top padding is 25px
    • right and left paddings are 50px
    • bottom padding is 75px

  • padding:25px 50px;
    • top and bottom paddings are 25px
    • right and left paddings are 50px

  • padding:25px;
    • all four paddings are 25px

CSS Grouping and Nesting Selectors

Grouping Selectors

In style sheets there are often elements with the same style.
h1
{
color:green;
}
h2
{
color:green;
}
p
{
color:green;
}
To minimize the code, you can group selectors.
Separate each selector with a comma.
In the example below we have grouped the selectors from the code above:
h1,h2,p
{
color:green;
}

Nesting Selectors

It is possible to apply a style for a selector within a selector.
In the example below, one style is specified for all p elements, one style is specified for all elements with class="marked", and a third style is specified only for p elements within elements with class="marked":

Example

p
{
color:blue;
text-align:center;
}
.marked
{
background-color:red;
}
.marked p
{
color:white;
}

Positioning

The CSS positioning properties allow you to position an element. It can also place an element behind another, and specify what should happen when an element's content is too big.
Elements can be positioned using the top, bottom, left, and right properties. However, these properties will not work unless the position property is set first. They also work differently depending on the positioning method.
There are four different positioning methods.

Static Positioning

HTML elements are positioned static by default. A static positioned element is always positioned according to the normal flow of the page.
Static positioned elements are not affected by the top, bottom, left, and right properties.

Fixed Positioning

An element with fixed position is positioned relative to the browser window.
It will not move even if the window is scrolled:
p.pos_fixed
{
position:fixed;
top:30px;
right:5px;
}

Relative Positioning

A relative positioned element is positioned relative to its normal position.

Example

h2.pos_left
{
position:relative;
left:-20px;
}
h2.pos_right
{
position:relative;
left:20px;
}
The content of relatively positioned elements can be moved and overlap other elements, but the reserved space for the element is still preserved in the normal flow.

Example

h2.pos_top
{
position:relative;
top:-50px;
}
Relatively positioned elements are often used as container blocks for absolutely positioned elements.

Absolute Positioning

An absolute position element is positioned relative to the first parent element that has a position other than static. If no such element is found, the containing block is <html>:

Example

h2
{
position:absolute;
left:100px;
top:150px;
}
Absolutely positioned elements are removed from the normal flow. The document and other elements behave like the absolutely positioned element does not exist.
Absolutely positioned elements can overlap other elements.

Overlapping Elements

When elements are positioned outside the normal flow, they can overlap other elements.
The z-index property specifies the stack order of an element (which element should be placed in front of, or behind, the others).
An element can have a positive or negative stack order:

Example

img
{
position:absolute;
left:0px;
top:0px;
z-index:-1;
}

CSS Horizontal Align

Aligning Block Elements

A block element is an element that takes up the full width available, and has a line break before and after it.
Examples of block elements:
  • <h1>
  • <p>
  • <div>
For aligning text, see the CSS Text chapter.
In this chapter we will show you how to horizontally align block elements for layout purposes.

Center Aligning Using the margin Property

Block elements can be aligned by setting the left and right margins to "auto".
Note: Using margin:auto will not work in IE8 and earlier, unless a !DOCTYPE is declared.
Setting the left and right margins to auto specifies that they should split the available margin equally. The result is a centered element:

Example

.center
{
margin-left:auto;
margin-right:auto;
width:70%;
background-color:#b0e0e6;
}
Tip: Aligning has no effect if the width is 100%.
Note: In IE5 there is a margin handling bug for block elements. To make the example above work in IE5, add some extra code. Try it yourself

Left and Right Aligning Using the position Property

One method of aligning elements is to use absolute positioning:

Example

.right
{
position:absolute;
right:0px;
width:300px;
background-color:#b0e0e6;
}
Note: Absolute positioned elements are removed from the normal flow, and can overlap elements.

Crossbrowser Compatibility Issues

When aligning elements like this, it is always a good idea to predefine margin and padding for the <body> element. This is to avoid visual differences in different browsers.
There is a problem with IE8 and earlier, when using the position property. If a container element (in our case <div class="container">) has a specified width, and the !DOCTYPE declaration is missing, IE8 and earlier versions will add a 17px margin on the right side. This seems to be space reserved for a scrollbar. Always set the !DOCTYPE declaration when using the position property:

Example

body
{
margin:0;
padding:0;
}
.container
{
position:relative;
width:100%;
}
.right
{
position:absolute;
right:0px;
width:300px;
background-color:#b0e0e6;
}


Left and Right Aligning Using the float Property

One method of aligning elements is to use the float property:

Example

.right
{
float:right;
width:300px;
background-color:#b0e0e6;
}


Crossbrowser Compatibility Issues

When aligning elements like this, it is always a good idea to predefine margin and padding for the <body> element. This is to avoid visual differences in different browsers.
There is a problem with IE8 and earlier when using the float property. If the !DOCTYPE declaration is missing, IE8 and earlier versions will add a 17px margin on the right side. This seems to be space reserved for a scrollbar. Always set the !DOCTYPE declaration when using the float property:

Example

body
{
margin:0;
padding:0;
}
.right
{
float:right;
width:300px;
background-color:#
CSS Tutorial

What is CSS?

  • CSS stands for Cascading Style Sheets
  • Styles define how to display HTML elements
  • Styles were added to HTML 4.0 to solve a problem
  • External Style Sheets can save a lot of work
  • External Style Sheets are stored in CSS files

CSS Syntax

A CSS rule has two main parts: a selector, and one or more declarations:
http://www.w3schools.com/css/selector.gif
The selector is normally the HTML element you want to style.
Each declaration consists of a property and a value.
The property is the style attribute you want to change. Each property has a value.

CSS Example

A CSS declaration always ends with a semicolon, and declaration groups are surrounded by curly brackets:
p {color:red;text-align:center;}
To make the CSS more readable, you can put one declaration on each line, like this

CSS Comments

Comments are used to explain your code, and may help you when you edit the source code at a later date. Comments are ignored by browsers.
A CSS comment begins with "/*", and ends with "*/", like this:

CSS Id and Class

The id and class Selectors

In addition to setting a style for a HTML element, CSS allows you to specify your own selectors called "id" and "class".

The id Selector

The id selector is used to specify a style for a single, unique element.
The id selector uses the id attribute of the HTML element, and is defined with a "#".
The style rule below will be applied to the element with id="para1":

<!DOCTYPE html>

<html>

<head>

<style>

#para1

{

text-align:center;

color:red;

}

</style>

</head>

 

<body>

<p id="para1">Hello World!</p>

<p>This paragraph is not affected by the style.</p>

</body>

</html>

 The class Selector

The class selector is used to specify a style for a group of elements. Unlike the id selector, the class selector is most often used on several elements.
This allows you to set a particular style for many HTML elements with the same class.
The class selector uses the HTML class attribute, and is defined with a "."
In the example below, all HTML elements with class="center" will be center-aligned:

CSS How To...

When a browser reads a style sheet, it will format the document according to it.

Three Ways to Insert CSS

There are three ways of inserting a style sheet:
  • External style sheet
  • Internal style sheet
  • Inline style

External Style Sheet

An external style sheet is ideal when the style is applied to many pages. With an external style sheet, you can change the look of an entire Web site by changing one file. Each page must link to the style sheet using the <link> tag. The <link> tag goes inside the head section:
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
An external style sheet can be written in any text editor. The file should not contain any html tags. Your style sheet should be saved with a .css extension. An example of a style sheet file is shown below:
hr {color:sienna;}
p {margin-left:20px;}
body {background-image:url("images/back40.gif");}
Remark Do not add a space between the property value and the unit (such as margin-left:20 px). The correct way is: margin-left:20px

Internal Style Sheet

An internal style sheet should be used when a single document has a unique style. You define internal styles in the head section of an HTML page, by using the <style> tag, like this:
<head>
<style>
hr {color:sienna;}
p {margin-left:20px;}
body {background-image:url("images/back40.gif");}
</style>
</head>


Inline Styles

An inline style loses many of the advantages of style sheets by mixing content with presentation. Use this method sparingly!
To use inline styles you use the style attribute in the relevant tag. The style attribute can contain any CSS property. The example shows how to change the color and the left margin of a paragraph:
<p style="color:sienna;margin-left:20px">This is a paragraph.</p>


Multiple Style Sheets

If some properties have been set for the same selector in different style sheets, the values will be inherited from the more specific style sheet. 
For example, an external style sheet has these properties for the h3 selector:
h3
{
color:red;
text-align:left;
font-size:8pt;
}
And an internal style sheet has these properties for the h3 selector:
h3
{
text-align:right;
font-size:20pt;
}
If the page with the internal style sheet also links to the external style sheet the properties for h3 will be:
color:red;
text-align:right;
font-size:20pt;
The color is inherited from the external style sheet and the text-alignment and the font-size is replaced by the internal style sheet.

Multiple Styles Will Cascade into One

Styles can be specified:
  • inside an HTML element
  • inside the head section of an HTML page
  • in an external CSS file
Tip: Even multiple external style sheets can be referenced inside a single HTML document.

Cascading order

What style will be used when there is more than one style specified for an HTML element?
Generally speaking we can say that all the styles will "cascade" into a new "virtual" style sheet by the following rules, where number four has the highest priority:
1.    Browser default
2.    External style sheet
3.    Internal style sheet (in the head section)
4.    Inline style (inside an HTML element)
So, an inline style (inside an HTML element) has the highest priority, which means that it will override a style defined inside the <head> tag, or in an external style sheet, or in a browser (a default value).

CSS Background

CSS background properties are used to define the background effects of an element.
CSS properties used for background effects:
  • background-color
  • background-image
  • background-repeat
  • background-attachment
  • background-position

Background Color

The background-color property specifies the background color of an element.
The background color of a page is defined in the body selector:

body {background-color:#b0c4de;}

h1 {background-color:#6495ed;}
p {background-color:#e0ffff;}
div {background-color:#b0c4de;}

Background Image

The background-image property specifies an image to use as the background of an element.
By default, the image is repeated so it covers the entire element.
The background image for a page can be set like this:

body {background-image:url('paper.gif');}

Background Image - Repeat Horizontally or Vertically

By default, the background-image property repeats an image both horizontally and vertically.
Some images should be repeated only horizontally or vertically, or they will look strange, like this: 

body
{
background-image:url('gradient2.png');
}

If the image is repeated only horizontally (repeat-x), the background will look better:

body
{
background-image:url('gradient2.png');
background-repeat:repeat-x;
}

Background Image - Set position and no-repeat

Remark When using a background image, use an image that does not disturb the text.
Showing the image only once is specified by the background-repeat property:

body
{
background-image:url('img_tree.png');
background-repeat:no-repeat;
}

In the example above, the background image is shown in the same place as the text. We want to change the position of the image, so that it does not disturb the text too much.
The position of the image is specified by the background-position property:

Example

body
{
background-image:url('img_tree.png');
background-repeat:no-repeat;
background-position:right top;
}

Text Color

The color property is used to set the color of the text.
With CSS, a color is most often specified by:
  • a HEX value - like "#ff0000"
  • an RGB value - like "rgb(255,0,0)"
  • a color name - like "red"

body {color:blue;}
h1 {color:#00ff00;}
h2 {color:rgb(255,0,0);}

Text Alignment

The text-align property is used to set the horizontal alignment of a text.
Text can be centered, or aligned to the left or right, or justified.
When text-align is set to "justify", each line is stretched so that every line has equal width, and the left and right margins are straight (like in magazines and newspapers).

h1 {text-align:center;}
p.date {text-align:right;}
p.main {text-align:justify;}

Text Decoration

The text-decoration property is used to set or remove decorations from text.
The text-decoration property is mostly used to remove underlines from links for design purposes:

 

a {text-decoration:none;}

h1 {text-decoration:overline;}
h2 {text-decoration:line-through;}
h3 {text-decoration:underline;}

Text Transformation

The text-transform property is used to specify uppercase and lowercase letters in a text.
It can be used to turn everything into uppercase or lowercase letters, or capitalize the first letter of each word.

 

p.uppercase {text-transform:uppercase;}
p.lowercase {text-transform:lowercase;}
p.capitalize {text-transform:capitalize;}

Use a Combination of Percent and Em

The solution that works in all browsers, is to set a default font-size in percent for the <body> element:

body {font-size:100%;}
h1 {font-size:2.5em;}
h2 {font-size:1.875em;}
p {font-size:0.875em;}

CSS Links

Links can be styled in different ways.

Styling Links

Links can be styled with any CSS property (e.g. color, font-family, background, etc.).
In addition, links can be styled differently depending on what state they are in.
The four links states are:
  • a:link - a normal, unvisited link
  • a:visited - a link the user has visited
  • a:hover - a link when the user mouses over it
  • a:active - a link the moment it is clicked

Example

a:link {color:#FF0000;}      /* unvisited link */
a:visited {color:#00FF00;}  /* visited link */
a:hover {color:#FF00FF;}  /* mouse over link */
a:active {color:#0000FF;}  /* selected link */

CSS Lists

The CSS list properties allow you to:
·         Set different list item markers for ordered lists
·         Set different list item markers for unordered lists
·         Set an image as the list item marker

List

In HTML, there are two types of lists:
  • unordered lists - the list items are marked with bullets
  • ordered lists - the list items are marked with numbers or letters
With CSS, lists can be styled further, and images can be used as the list item marker.

Different List Item Markers

The type of list item marker is specified with the list-style-type property:

<!DOCTYPE html>

<html>

<head>

<style>

ul.a {list-style-type:circle;}

ul.b {list-style-type:square;}

ol.c {list-style-type:upper-roman;}

ol.d {list-style-type:lower-alpha;}

</style>

</head>

 

<body>

<p>Example of unordered lists:</p>

 

<ul class="a">

  <li>Coffee</li>

  <li>Tea</li>

  <li>Coca Cola</li>

</ul>

 

<ul class="b">

  <li>Coffee</li>

  <li>Tea</li>

  <li>Coca Cola</li>

</ul>

 

<p>Example of ordered lists:</p>

 

<ol class="c">

  <li>Coffee</li>

  <li>Tea</li>

  <li>Coca Cola</li>

</ol>

 

<ol class="d">

  <li>Coffee</li>

  <li>Tea</li>

  <li>Coca Cola</li>

</ol>

 

</body>

</html>

…………………………………………………..

<!DOCTYPE html>

<html>

<head>

<style>

ul.a {list-style-type:circle;}

ul.b {list-style-type:square;}

ol.c {list-style-type:upper-roman;}

ol.d {list-style-type:lower-alpha;}

</style>

</head>

 

<body>

<p>Example of unordered lists:</p>

 

<ul class="a">

  <li>Coffee</li>

  <li>Tea</li>

  <li>Coca Cola</li>

</ul>

 

<ul class="b">

  <li>Coffee</li>

  <li>Tea</li>

  <li>Coca Cola</li>

</ul>

 

<p>Example of ordered lists:</p>

 

<ol class="c">

  <li>Coffee</li>

  <li>Tea</li>

  <li>Coca Cola</li>

</ol>

 

<ol class="d">

  <li>Coffee</li>

  <li>Tea</li>

  <li>Coca Cola</li>

</ol>

 

</body>

</html>

 

CSS Box Model

The CSS Box Model

All HTML elements can be considered as boxes. In CSS, the term "box model" is used when talking about design and layout.
The CSS box model is essentially a box that wraps around HTML elements, and it consists of: margins, borders, padding, and the actual content.
The box model allows us to place a border around elements and space elements in relation to other elements.
The image below illustrates the box model:


CSS box-model

Explanation of the different parts:
  • Margin - Clears an area around the border. The margin does not have a background color, it is completely transparent
  • Border - A border that goes around the padding and content. The border is affected by the background color of the box
  • Padding - Clears an area around the content. The padding is affected by the background color of the box
  • Content - The content of the box, where text and images appear
In order to set the width and height of an element correctly in all browsers, you need to know how the box model works.

Width and Height of an Element

Remark Important: When you set the width and height properties of an element with CSS, you just set the width and height of the content area. To calculate the full size of an element, you must also add the padding, borders and margins.
The total width of the element in the example below is 300px:
width:250px;
padding:10px;
border:5px solid gray;
margin:10px;
Let's do the math:
250px (width)
+ 20px (left + right padding)
+ 10px (left + right border)
+ 20px (left + right margin)
= 300px
Assume that you had only 250px of space. Let's make an element with a total width of 250px:

<!DOCTYPE html>

<html>

<head>

<style>

div.ex

{

width:220px;

padding:10px;

border:5px solid gray;

margin:0px;

}

</style>

</head>

 

<body>

 

<img src="w3css.gif" width="250" height="250" />

 

<div class="ex">The picture above is 250px wide.

The total width of this element is also 250px.</div>

 

</body>

</html>

…………………………

The total width of an element should be calculated like this:
Total element width = width + left padding + right padding + left border + right border + left margin + right margin
The total height of an element should be calculated like this:
Total element height = height + top padding + bottom padding + top border + bottom border + top margin + bottom margin

CSS Border

CSS Border


CSS Border Properties

The CSS border properties allow you to specify the style and color of an element's border.

Border Style

The border-style property specifies what kind of border to display.
Remark None of the border properties will have ANY effect unless the border-style property is set!

border-style values:

none: Defines no border
dotted: Defines a dotted border
dashed: Defines a dashed border
solid: Defines a solid border
double: Defines two borders. The width of the two borders are the same as the border-width value
groove: Defines a 3D grooved border. The effect depends on the border-color value
ridge: Defines a 3D ridged border. The effect depends on the border-color value
inset: Defines a 3D inset border. The effect depends on the border-color value
outset: Defines a 3D outset border. The effect depends on the border-color value
Try it yourself: Set the style of the border

Border Width

The border-width property is used to set the width of the border.
The width is set in pixels, or by using one of the three pre-defined values: thin, medium, or thick.
Note: The "border-width" property does not work if it is used alone. Use the "border-style" property to set the borders first.

Example

p.one
{
border-style:solid;
border-width:5px;
}
p.two
{
border-style:solid;
border-width:medium;
}


Border Color

The border-color property is used to set the color of the border. The color can be set by:
  • name - specify a color name, like "red"
  • RGB - specify a RGB value, like "rgb(255,0,0)"
  • Hex - specify a hex value, like "#ff0000"
You can also set the border color to "transparent".
Note: The "border-color" property does not work if it is used alone. Use the "border-style" property to set the borders first.

Example

p.one
{
border-style:solid;
border-color:red;
}
p.two
{
border-style:solid;
border-color:#98bf21;
}


Border - Individual sides

In CSS it is possible to specify different borders for different sides:

Example

p
{
border-top-style:dotted;
border-right-style:solid;
border-bottom-style:dotted;
border-left-style:solid;
}
The example above can also be set with a single property:

Example

border-style:dotted solid;
The border-style property can have from one to four values.
  • border-style:dotted solid double dashed;
    • top border is dotted
    • right border is solid
    • bottom border is double
    • left border is dashed

  • border-style:dotted solid double;
    • top border is dotted
    • right and left borders are solid
    • bottom border is double

  • border-style:dotted solid;
    • top and bottom borders are dotted
    • right and left borders are solid

  • border-style:dotted;
    • all four borders are dotted
The border-style property is used in the example above. However, it also works with border-width and border-color.

Border - Shorthand property

As you can see from the examples above, there are many properties to consider when dealing with borders.
To shorten the code, it is also possible to specify all the individual border properties in one property. This is called a shorthand property.
The border property is a shorthand for the following individual border properties:
  • border-width
  • border-style (required)
  • border-color

Example

border:5px solid red;

CSS Outlines

An outline is a line that is drawn around elements (outside the borders) to make the element "stand out".
The outline properties specify the style, color, and width of an outline.

CSS Outline

An outline is a line that is drawn around elements (outside the borders) to make the element "stand out".
However, the outline property is different from the border property.
The outline is not a part of an element's dimensions; the element's total width and height is not affected by the width of the outline.
Outline 

CSS Margin

The CSS margin properties define the space around elements.

Margin

The margin clears an area around an element (outside the border). The margin does not have a background color, and is completely transparent.
The top, right, bottom, and left margin can be changed independently using separate properties. A shorthand margin property can also be used, to change all margins at once.

Possible Values

Value
Description
auto
The browser calculates a margin
length
Specifies a margin in px, pt, cm, etc. Default value is 0px
%
Specifies a margin in percent of the width of the containing element
inherit
Specifies that the margin should be inherited from the parent element
Remark It is possible to use negative values, to overlap content.

Margin - Individual sides

In CSS, it is possible to specify different margins for different sides:

Example

margin-top:100px;
margin-bottom:100px;
margin-right:50px;
margin-left:50px;


Margin - Shorthand property

To shorten the code, it is possible to specify all the margin properties in one property. This is called a shorthand property.
The shorthand property for all the margin properties is "margin":

Example

margin:100px 50px;
The margin property can have from one to four values.
  • margin:25px 50px 75px 100px;
    • top margin is 25px
    • right margin is 50px
    • bottom margin is 75px
    • left margin is 100px

  • margin:25px 50px 75px;
    • top margin is 25px
    • right and left margins are 50px
    • bottom margin is 75px

  • margin:25px 50px;
    • top and bottom margins are 25px
    • right and left margins are 50px

  • margin:25px;
    • all four margins are 25px

CSS Padding

The CSS padding properties define the space between the element border and the element content.

Padding

The padding clears an area around the content (inside the border) of an element. The padding is affected by the background color of the element.
The top, right, bottom, and left padding can be changed independently using separate properties. A shorthand padding property can also be used, to change all paddings at once.

Possible Values

Value
Description
length
Defines a fixed padding (in pixels, pt, em, etc.)
%
Defines a padding in % of the containing element


Padding - Individual sides

In CSS, it is possible to specify different padding for different sides:

Example

padding-top:25px;
padding-bottom:25px;
padding-right:50px;
padding-left:50px;


Padding - Shorthand property

To shorten the code, it is possible to specify all the padding properties in one property. This is called a shorthand property.
The shorthand property for all the padding properties is "padding":

Example

padding:25px 50px;
The padding property can have from one to four values.
  • padding:25px 50px 75px 100px;
    • top padding is 25px
    • right padding is 50px
    • bottom padding is 75px
    • left padding is 100px

  • padding:25px 50px 75px;
    • top padding is 25px
    • right and left paddings are 50px
    • bottom padding is 75px

  • padding:25px 50px;
    • top and bottom paddings are 25px
    • right and left paddings are 50px

  • padding:25px;
    • all four paddings are 25px

CSS Grouping and Nesting Selectors

Grouping Selectors

In style sheets there are often elements with the same style.
h1
{
color:green;
}
h2
{
color:green;
}
p
{
color:green;
}
To minimize the code, you can group selectors.
Separate each selector with a comma.
In the example below we have grouped the selectors from the code above:
h1,h2,p
{
color:green;
}

Nesting Selectors

It is possible to apply a style for a selector within a selector.
In the example below, one style is specified for all p elements, one style is specified for all elements with class="marked", and a third style is specified only for p elements within elements with class="marked":

Example

p
{
color:blue;
text-align:center;
}
.marked
{
background-color:red;
}
.marked p
{
color:white;
}

Positioning

The CSS positioning properties allow you to position an element. It can also place an element behind another, and specify what should happen when an element's content is too big.
Elements can be positioned using the top, bottom, left, and right properties. However, these properties will not work unless the position property is set first. They also work differently depending on the positioning method.
There are four different positioning methods.

Static Positioning

HTML elements are positioned static by default. A static positioned element is always positioned according to the normal flow of the page.
Static positioned elements are not affected by the top, bottom, left, and right properties.

Fixed Positioning

An element with fixed position is positioned relative to the browser window.
It will not move even if the window is scrolled:
p.pos_fixed
{
position:fixed;
top:30px;
right:5px;
}

Relative Positioning

A relative positioned element is positioned relative to its normal position.

Example

h2.pos_left
{
position:relative;
left:-20px;
}
h2.pos_right
{
position:relative;
left:20px;
}
The content of relatively positioned elements can be moved and overlap other elements, but the reserved space for the element is still preserved in the normal flow.

Example

h2.pos_top
{
position:relative;
top:-50px;
}
Relatively positioned elements are often used as container blocks for absolutely positioned elements.

Absolute Positioning

An absolute position element is positioned relative to the first parent element that has a position other than static. If no such element is found, the containing block is <html>:

Example

h2
{
position:absolute;
left:100px;
top:150px;
}
Absolutely positioned elements are removed from the normal flow. The document and other elements behave like the absolutely positioned element does not exist.
Absolutely positioned elements can overlap other elements.

Overlapping Elements

When elements are positioned outside the normal flow, they can overlap other elements.
The z-index property specifies the stack order of an element (which element should be placed in front of, or behind, the others).
An element can have a positive or negative stack order:

Example

img
{
position:absolute;
left:0px;
top:0px;
z-index:-1;
}

CSS Horizontal Align

Aligning Block Elements

A block element is an element that takes up the full width available, and has a line break before and after it.
Examples of block elements:
  • <h1>
  • <p>
  • <div>
For aligning text, see the CSS Text chapter.
In this chapter we will show you how to horizontally align block elements for layout purposes.

Center Aligning Using the margin Property

Block elements can be aligned by setting the left and right margins to "auto".
Note: Using margin:auto will not work in IE8 and earlier, unless a !DOCTYPE is declared.
Setting the left and right margins to auto specifies that they should split the available margin equally. The result is a centered element:

Example

.center
{
margin-left:auto;
margin-right:auto;
width:70%;
background-color:#b0e0e6;
}
Tip: Aligning has no effect if the width is 100%.
Note: In IE5 there is a margin handling bug for block elements. To make the example above work in IE5, add some extra code. Try it yourself

Left and Right Aligning Using the position Property

One method of aligning elements is to use absolute positioning:

Example

.right
{
position:absolute;
right:0px;
width:300px;
background-color:#b0e0e6;
}
Note: Absolute positioned elements are removed from the normal flow, and can overlap elements.

Crossbrowser Compatibility Issues

When aligning elements like this, it is always a good idea to predefine margin and padding for the <body> element. This is to avoid visual differences in different browsers.
There is a problem with IE8 and earlier, when using the position property. If a container element (in our case <div class="container">) has a specified width, and the !DOCTYPE declaration is missing, IE8 and earlier versions will add a 17px margin on the right side. This seems to be space reserved for a scrollbar. Always set the !DOCTYPE declaration when using the position property:

Example

body
{
margin:0;
padding:0;
}
.container
{
position:relative;
width:100%;
}
.right
{
position:absolute;
right:0px;
width:300px;
background-color:#b0e0e6;
}


Left and Right Aligning Using the float Property

One method of aligning elements is to use the float property:

Example

.right
{
float:right;
width:300px;
background-color:#b0e0e6;
}


Crossbrowser Compatibility Issues

When aligning elements like this, it is always a good idea to predefine margin and padding for the <body> element. This is to avoid visual differences in different browsers.
There is a problem with IE8 and earlier when using the float property. If the !DOCTYPE declaration is missing, IE8 and earlier versions will add a 17px margin on the right side. This seems to be space reserved for a scrollbar. Always set the !DOCTYPE declaration when using the float property:

Example

body
{
margin:0;
padding:0;
}
.right
{
float:right;
width:300px;
background-color:#b0e0e6;
}



 


 ;
}



 



Monday, 23 September 2013

Keyboard Shortcuts For Windows and Mac

Keyboard Shortcuts For Windows and Mac

Keyboard shortcuts are often used in modern operating systems and computer software programs.
Using keyboard shortcuts could save you a lot of time.

Basic Shortcuts



Description Windows Mac OS
Edit menu Alt + E Ctrl + F2 + F
File menu Alt + F Ctrl + F2 + E
View menu Alt + V Ctrl + F2 + V
Select all text Ctrl + A Cmd + A
Copy text Ctrl + C Cmd + C
Find text Ctrl + F Cmd + F
Find and replace text Ctrl + H Cmd + F
New Document Ctrl + N Cmd + N
Open a file Ctrl + O Cmd + O
Print options Ctrl + P Cmd + P
Save file Ctrl + S Cmd + S
Paste text Ctrl + V Cmd + V
Cut text Ctrl + X Cmd + X
Redo text Ctrl + Y Shift + Cmd + Z
Undo text Ctrl + Z Cmd + Z




Text Editing



Description Windows Mac OS
Cursor Movement
Go to the right or to the beginning of next line break Right Arrow Right Arrow
Go to the left or to the end of previous line break Left Arrow Left Arrow
Go up one row Up Arrow Up Arrow
Go down one row Down Arrow Down Arrow
Go to the beginning of the current line Home Cmd + Left Arrow
Go to the end of the current line End Cmd + Right Arrow
Go to the beginning of the document Ctrl + Home Cmd + Up Arrow
Go to the end of the document Ctrl + End Cmd + Down Arrow
Move up one frame Page Up Fn + Up Arrow
Move down one frame Page Down Fn + Down Arrow
Go to beginning of previous word Ctrl + Left Arrow Option + Left Arrow
Go to beginning of next word Ctrl + Right Arrow Option + Right Arrow
Go to beginning of line break Ctrl + Up Arrow Cmd + Left Arrow
Go to end of line break Ctrl + Down Arrow Cmd + Right Arrow
     
Text Selection
Select characters to the left Shift + Left Arrow Shift + Left Arrow
Select characters to the right Shift + Right Arrow Shift + Right Arrow
Select lines upwards Shift + Up Arrow Shift + Up Arrow
Select lines downwards Shift + Down Arrow Shift + Down Arrow
Select words to the left Shift + Ctrl + Left Shift + Opt + Left
Select words to the right Shift + Ctrl + Right Shift + Opt + Right
Select paragraphs to the left Shift + Ctrl + Up Shift + Opt + Up
Select paragraphs to the right Shift + Ctrl + Down Shift + Opt + Down
Select text between the cursor and the beginning of the current line Shift + Home Cmd + Shift + Left Arrow
Select text between the cursor and the end of the current line Shift + End Cmd + Shift + Right Arrow
Select text between the cursor and the beginning of the document Shift + Ctrl + Home Cmd + Shift + Up Arrow or Cmd + Shift + Fn + Left Arrow
Select text between the cursor and the end of the document Shift + Ctrl + End Cmd + Shift + Down Arrow or Cmd + Shift + Fn + Right Arrow
Select one frame at a time of text above the cursor Shift + Page Up Shift + Fn + Up Arrow
Select one frame at a time of text below the cursor Shift + Page Down Shift + Fn + Down Arrow
Select all text Ctrl + A Cmd + A
Find text Ctrl + F Cmd + F
     
Text Formatting
Make selected text bold Ctrl + B Cmd + B
Make selected text italic Ctrl + I Cmd + I
Underline selected text Ctrl + U Cmd + U
Make selected text superscript Ctrl + Shift + = Cmd + Shift + =
Make selected text subscript Ctrl + = Cmd + =
     
Text Editing
Delete characters to the left Backspace Backspace
Delete characters to the right Delete Fn + Backspace
Delete words to the right Ctrl + Del Cmd + Backspace
Delete words to the left Ctrl + Backspace Cmd + Fn + Backspace
Indent Tab Tab
Outdent Shift + Tab Shift + Tab
Copy text Ctrl + C Cmd + C
Find and replace text Ctrl + H Cmd + F
Paste text Ctrl + V Cmd + V
Cut text Ctrl + X Cmd + X
Redo text Ctrl + Y Shift + Cmd + Z
Undo text Ctrl + Z Cmd + Z




Web Browsers



Description Windows Mac OS
Navigation
Scroll down a frame Space or Page Down Space or Fn + Down Arrow
Scroll up a frame Shift + Space or Page Up Shift + Space or Fn + Up Arrow
Go to bottom of the page End Cmd + Down Arrow
Go to top of the page Home Cmd + Up Arrow
Go back Alt + Left Arrow or Backspace Cmd + Left Arrow
Go forward Alt + Right Arrow or Shift + Backspace Cmd + Right Arrow
Refresh a webpage F5 Cmd + R
Refresh a webpage (no cache) Ctrl + F5 Cmd + Shift + R
Stop Esc Esc
Toggle full-screen F11 Cmd + Shift + F
Zoom in Ctrl + + Cmd + +
Zoom out Ctrl + - Cmd + -
Zoom 100% (default) Ctrl + 0 Cmd + 0
Open homepage Alt + Home Option + Home or Option + Fn + Left Arrow
Find text Ctrl + F Cmd + F
     
Tab / Window Management
Open a new tab Ctrl + T Cmd + T
Close current tab Ctrl + W Cmd + W
Close all tabs Ctrl + Shift + W Cmd + Q
Close all tabs except the current tab Ctrl + Alt + F4 Cmd + Opt + W
Go to next tab Ctrl + Tab Control + Tab or Cmd + Shift + Right Arrow
Go to previous tab Ctrl + Shift + Tab Shift + Control + Tab or Cmd + Shift + Left Arrow
Go to a specific tab number Ctrl + 1-8 Cmd + 1-8
Go to the last tab Ctrl + 9 Cmd + 9
Reopen the last closed tab Ctrl + Shift + T Cmd + Shift + T
Open a new window Ctrl + N Cmd + N
Close current window Alt + F4 Cmd + W
Go to next window Alt + Tab Cmd + Tab
Go to previous window Alt + Shift + Tab Cmd + Shift + Tab
Reopen the last closed window Ctrl + Shift + N  
Open links in a new tab in the background Ctrl + Click Cmd + Click
Open links in a new tab in the foreground Ctrl + Shift + Click Cmd + Shift + Click
Print current webpage Ctrl + P Cmd + P
Save current webpage Ctrl + S Cmd + S
     
Address Bar
Cycle between toolbar, search bar, and page elements Tab Tab
Go to browser's address bar Ctrl + L or Alt + D Cmd + L
Focus and select the browser's search bar Ctrl + E Cmd + E / Cmd + K
Open the address bar location in a new tab Alt + Enter Opt + Enter
Display a list of previously typed addresses F4  
Add "www." to the beginning and ".com" to the end of the text typed in the address bar (e.g., type "w3schools" and press Ctrl + Enter to open "www.w3schools.com") Ctrl + Enter Cmd + Enter or Control + Enter
     
Bookmarks
Open the bookmarks menu Ctrl + B Cmd + B
Add bookmark for current page Ctrl + D Cmd + Opt + B or Cmd + Shift + B
Open browsing history Ctrl + H Cmd + Shift + H or Cmd + Y
Open download history Ctrl + J Cmd + J or Cmd + Shift + J




Screenshots



Description Windows Mac OS
Save screenshot of the whole screen as file   Cmd + Shift + 3
Copy screenshot of the whole screen to the clipboard PrtScr (Print Screen) or Ctrl + PrtScr Cmd + Ctrl + Shift + 3
Save screenshot of window as file   Cmd + Shift + 4, then Space
Copy screenshot of window to the clipboard Alt + PrtScr Cmd + Ctrl + Shift + 4, then Space
Copy screenshot of wanted area to the clipboard Cmd + Ctrl + Shift + 4
Save screenshot of wanted area as file   Cmd + Shift + 4

The ASCII Character Set HTML ASCII Reference

The ASCII character-set is used to send information between computers on the Internet.

The ASCII Character Set

ASCII stands for the "American Standard Code for Information Interchange".  It was designed in the early 60's, as a standard character-set for computers and hardware devices like teleprinters and tapedrives.
ASCII is a 7-bit character set containing 128 characters.
It contains the numbers from 0-9, the uppercase and lowercase English letters from A to Z, and some special characters.
The character-sets used in modern computers, HTML, and Internet are all based on ASCII.
The following table lists the 128 ASCII characters and their equivalent HTML entity codes.

ASCII Printable Characters

ASCII Character HTML Entity Code Description
  &#32; space
! &#33; exclamation mark
" &#34; quotation mark
# &#35; number sign
$ &#36; dollar sign
% &#37; percent sign
& &#38; ampersand
' &#39; apostrophe
( &#40; left parenthesis
) &#41; right parenthesis
* &#42; asterisk
+ &#43; plus sign
, &#44; comma
- &#45; hyphen
. &#46; period
/ &#47; slash
0 &#48; digit 0
1 &#49; digit 1
2 &#50; digit 2
3 &#51; digit 3
4 &#52; digit 4
5 &#53; digit 5
6 &#54; digit 6
7 &#55; digit 7
8 &#56; digit 8
9 &#57; digit 9
: &#58; colon
; &#59; semicolon
< &#60; less-than
= &#61; equals-to
> &#62; greater-than
? &#63; question mark
@ &#64; at sign
A &#65; uppercase A
B &#66; uppercase B
C &#67; uppercase C
D &#68; uppercase D
E &#69; uppercase E
F &#70; uppercase F
G &#71; uppercase G
H &#72; uppercase H
I &#73; uppercase I
J &#74; uppercase J
K &#75; uppercase K
L &#76; uppercase L
M &#77; uppercase M
N &#78; uppercase N
O &#79; uppercase O
P &#80; uppercase P
Q &#81; uppercase Q
R &#82; uppercase R
S &#83; uppercase S
T &#84; uppercase T
U &#85; uppercase U
V &#86; uppercase V
W &#87; uppercase W
X &#88; uppercase X
Y &#89; uppercase Y
Z &#90; uppercase Z
[ &#91; left square bracket
\ &#92; backslash
] &#93; right square bracket
^ &#94; caret
_ &#95; underscore
` &#96; grave accent
a &#97; lowercase a
b &#98; lowercase b
c &#99; lowercase c
d &#100; lowercase d
e &#101; lowercase e
f &#102; lowercase f
g &#103; lowercase g
h &#104; lowercase h
i &#105; lowercase i
j &#106; lowercase j
k &#107; lowercase k
l &#108; lowercase l
m &#109; lowercase m
n &#110; lowercase n
o &#111; lowercase o
p &#112; lowercase p
q &#113; lowercase q
r &#114; lowercase r
s &#115; lowercase s
t &#116; lowercase t
u &#117; lowercase u
v &#118; lowercase v
w &#119; lowercase w
x &#120; lowercase x
y &#121; lowercase y
z &#122; lowercase z
{ &#123; left curly brace
| &#124; vertical bar
} &#125; right curly brace
~ &#126; tilde



ASCII Device Control Characters

The ASCII device control characters were originally designed to control hardware devices.
Control characters have nothing to do inside an HTML document.

ASCII Character HTML Entity Code Description
NUL &#00; null character
SOH &#01; start of header
STX &#02; start of text
ETX &#03; end of text
EOT &#04; end of transmission
ENQ &#05; enquiry
ACK &#06; acknowledge
BEL &#07; bell (ring)
BS &#08; backspace
HT &#09; horizontal tab
LF &#10; line feed
VT &#11; vertical tab
FF &#12; form feed
CR &#13; carriage return
SO &#14; shift out
SI &#15; shift in
DLE &#16; data link escape
DC1 &#17; device control 1
DC2 &#18; device control 2
DC3 &#19; device control 3
DC4 &#20; device control 4
NAK &#21; negative acknowledge
SYN &#22; synchronize
ETB &#23; end transmission block
CAN &#24; cancel
EM &#25; end of medium
SUB &#26; substitute
ESC &#27; escape
FS &#28; file separator
GS &#29; group separator
RS &#30; record separator
US &#31; unit separator
     
DEL &#127; delete (rubout)

Wednesday, 18 September 2013

YOU CAN WIN By Shiv Khera

YOU CAN WIN
By
Shiv Khera

WINNERS VERSUS LOSERS

The Winner is always part of the answer;
 The Loser is always part of the problem.
The Winner always has a program;
 The Loser always has an excuse.
The Winner says, "Let me do it for you";
 The Loser says, "That is not my job."
The Winner sees an answer for every problem;
 The Loser sees a problem for every answer.
The Winner says, "It may be difficult but it is possible";
 The Loser says, "It may be possible but it is too difficult."
When a Winner makes a mistake, he says, "I was wrong";

When a Loser makes a mistake, he says, "It wasn't my fault."

A Winner makes commitments;
 A Loser makes promises.
Winners have dreams;
 Losers have schemes.
Winners say, "I must do something";
 Losers say, "Something must be done."
Winners are a part of the team;
 Losers are apart from the team.
Winners see the gain;
 Losers see the pain.
Winners see possibilities;
 Losers see problems.
Winners believe in win-win;
 Losers believe for them to win someone has to lose.
Winners see the potential;
 Losers see the past.
Winners are like a thermostat;
 Losers are like thermometers.
Winners choose what they say;
 Losers say what they choose.
Winners use hard arguments but soft words;
 Losers use soft arguments but hard words.
Winners stand firm on values but compromise on petty things
Winners follow the philosophy of empathy: "Don't do to others what you would not
want them to do to you";
 Losers follow the philosophy, "Do it to others before they do it to you."
Winners make it happen;
 Losers let it happen.
Winners plan and prepare to win.
 The key word is preparation.

How to remove autorun recycler virus completely

How to remove autorun recycler virus completely


How to remove autorun recycler virus completely

autorun.inf folder in driveSometimes, you may see an Recycler folder in the root of each drive in USB drives or
hard disk and you may treat it as recycler virus. The Recycler folder is an system folder that used to keep the deleted files, when you want to recover the deleted data before, the system will recover them from the Recyclers folder. You can click into the folder, and find the deleted files, picture, folders in it.
deleted files in recyclerThe attribute of Recycler folder is hidden, only when the 'show hidden files and folders' option is checked, you can see it.
Also System Volume Information is a system folder, it save the system restoration information.

However, more and more autorun virus hide themselves in the recycler bin folder, if you find any executable file such as RECYCLER.exe, or vbs file in it, and autorun.inf file in the root of the drive, and the content as
[AutoRun]
open=RECYCLER.exe
shellexecute=RECYCLER.exe
shell\Auto\command=RECYCLE.exe
recycler.exe
That means your computer and USB sticks have been infected with virus.

Remove viruses in Recycler folder

Update antivirus software such as AVG, kaspersky, Nod32 to the latest version, do a thorough scan of the computer and USB storage devices. If the virus/worms come back again after removal, or the antivirus software could not detect the virus even, try to remove the virus manually.
  1. Reboot your system and tap F8 to enter safe mode;
  2. Close the RECYCLER.exe process in the task manager;
  3. Delete the autorun.inf and other suspicious exe files in the recycler folder
  4. Open registry editor and modify the NoDriveTypeAutoRun key with 03ffffff in following key: HKEY_LOCAL_MACHINE\SOFTWARE\ and HKEY_CURRENT_USER\SOFTWARE
  5. Using the antivirus product to scan again.
The manual removal of the infection is not recommended because it requires an expertise to edit registry. In case you modify a registry entry wrongly, that may cause damage to the system. Therefore, it is always better to remove virus with a specialized removal tool.

Using Recycler Virus Removal Tool to delete the virus automatically

Autorun Remover is a specialized autorun removal tool to clean the autorun type virus including recycler virus, with it, you can get rid of the autorun.inf and recycler.exe easily and quickly.
  1. Download and install Autorun Virus Remover;
  2. if you USB drives has autorun.inf folder in it, insert it into computer;
  3. Execute the tool, Click 'Start' to execute the scan.
  recycler virus removal
If Autorun Remover is blocked by the recyclers virus then run system in safe mode and try again. To do this reboot your system and tap F8 repeatedly when system starts up.
Autorun Virus Remover is the most effectively autorun antivirus software in the market, with the product, it is an easy job for you to block any autorun.inf virus from USB drives, click to get more information about it.

REMOVE VIRUSES IN RECYCLER FOLDER AND SYSTEM VOLUME INFORMATION FOLDER

REMOVE VIRUSES IN RECYCLER FOLDER AND SYSTEM VOLUME INFORMATION FOLDER

Here is a  simple and easy sequence of  instructions on how to remove viruses the "recycler"  folder and System Volume Information folder  in windows XP ..... Your drives will have such folders as the ones below  . e.g if its c:

in case you attempt to delete either ..... you get  these annoying message box .........

FIRST ......TO DELETE  RECYCLER FOLDER ...... Follow these .....
1. Access the Task Manager >>> this can be done by ge ....Start > go to  Run ......... and type Taskmgr on the run Prompt as shown below
 2. The Task Manager will Pop Up as shown below  and kill  the process called Ctfmon.exe

 3. Right click on My computer Icon  and go to properties  and after the pop below go toSystem Restore  Tab and tick  the  "Turn System Restore on all Drives" check box as shown below and  Click Apply  button and then Ok



 4. Delete the RECYCLER FOLDER in each drive (e.g in my Scenario I would  delete in C,D, and  E) and empty  the recycle bin .... Alternatively Shift + Delete  the folder in each drive.

After These the RECYCLER FOLDER is GONE......GONE ...GONE......!

SECONDLY  ..... TO ACCESS THE AND DELETE THE CONTENT OF  SYSTEM VOLUME INFORMATION FOLDER

Note: its advised you only delete the content of these folder not the folder itself ..... it will be recreated  by windows after the rebooting.
here are the steps 
  1. Click Start, and then click My Computer.
  2. On the Tools menu, click Folder Options.
  3. On the View tab, click Show hidden files and folders.
  4. Clear the Hide protected operating system files (Recommended) check box. Click Yes when you are prompted to confirm the change.
  5. Clear the Use simple file sharing (Recommended) check box.
  6. Click OK.
  7. Right-click the System Volume Information folder in the root folder, and then click Properties.
  8. Click the Security tab.
  9. Click Add, and then type the name of the user to whom you want to give access to the folder. Typically, this is the account with which you are logged on. Give the user full control if not access Click OK, and then click OK again.
  10. Double-click the System Volume Information folder in the root folder to open it.
  11. Delete the content of these System Volume Information folder in each drive ...... or Delete the folder itself ...... It will recreated a fresh and virus free ......
Hope this helps ........ In case you need more .......ask

How To Remove Autorun Recycler Virus from Windows


How To Remove Autorun Recycler Virus from Windows
Sometimes you might find a folder called recycler in the root directory of all disks available on your computer (Mainly in hard disk drives and USB drives). 
Most people have a misconception that recycler is a Computer Virus, however its not true. The recycler is nothing but a system folder which is used to keep all deleted data.
In simple words, it means if you delete anything on your D drive then the data will be moved inside a hidden folder called recycler which is in the root directory of D drive. If you open this folder, you can find all deleted images, files, videos, etc.
Recycler Virus with System Volume Information
Along with recycler you can find another folder called System Volume Information. It contains the system restoration information.
The recycler and system volume information folders have the attribute ‘hidden’ by default in Windows XP. So you can only see them if you choose to Show Hidden Files and Folders in Windows XP.
But in Windows 8, these folders have a new name as well as new stealth mode. So these folders are not visible even if you choose to ‘Show Hidden files and folders in Windows 8′.

But recycler is a virus, isn’t it ?

Recycler Virus ExampleSometimes autorun viruses hide themselves inside recycler folder. If you find any executable file such as RECYCLER.exe then that particular file is a virus. Also if your computer is infected with a recycler.exe virus, you might find a vbs file or an autorun file with the following content in it:
[AutoRun]
open=RECYCLER.exe
shellexecute=RECYCLER.exe
shell\Auto\command=RECYCLE.exe
If you encounter these type of files, then your computer might be infected with a recycler virus. But remember that the recycler folder is not itself a virus. Its a system folder.

Should I Delete Recycler?

As i said, its a system folder. And it is required by the system. So if you try and delete it. It will again appear on a system reboot. You don’t need to delete the recycler folder or the system volume information folder. Remember that recycler folder is a system folder while recycler.exe is the recycler virus which you should delete.

So How Do I Delete RECYCLER.exe ?

First of all, do not execute any instance of recycler virus ( recycler.exe ). This particular file is an executable file with a ‘folder’ icon. So you might double click on it with the intention of opening the folder. But it turns out to be a process. So when you double click, the virus is executed and remains active. It adds itself to your Windows startup programs list. And thus the recycler virus will be executed each time you run the Operating System.
If recycler virus is active, then no matter how many times you delete it, it will re-appear and create a copy of itself everywhere on the disk drive.
  1. So first Kill the process by opening Task Manager.
  2. Open task manager(right click on taskbar, select task manager). Go in processes tab
  3. Find recycler.exe
  4. Right click on it and click end process
  5. Open start menu > run > type msconfig > hit enter > go to startup tab.
  6. If recycler.exe is present in the list, then uncheck it.
  7. Open start menu > all programs > startup folder.
  8. If you find recycler.exe there, then delete it.
  9. Boot your computer in Safe Mode by hitting “F8″ until the “Advanced Boot Options” menu appears. Select “Safe Mode” from the prompt.
  10. Now search your computer for recycler.exe
  11. And delete each and every instance of it if you find any.
  12. Restart your computer.
  13. And install a proper Anti-virus or Anti-malware.
There are other methods to remove recycler virus, but it involves messing with the system registry. But i prefer the graphical method rather than registry and command line.
And it works, if it doesn’t then either you didn’t do it right or its not at all a recycler virus ( recycler.exe ). But if you need any help, comment on this thread below and i will try and help asap.

Tuesday, 17 September 2013

History of Lucknow

History of Lucknow

Avadh is claimed to be among the most ancient of Hindu states. According to popular legend, Ramchandra of Ayodhya, the hero of the Ramayana, gifted,the territory of Lucknow to his devoted brother Lakshman after he had conquered Sri Lanka and completed his term of exile in the jungle. Therefore, people say that the original name of Lucknow was Lakshmanpur, popularly known as Lakhanpur or Lachmanpur. The city of Ayodhya itself, forty miles away from Lakshmanpur, was reported to be full of great riches: "Its streets, well arranged, were refreshed with ceaseless streams of water ~ its walls, variously ornamented, resembled the checkered surface of a chess-board. It was filled with merchants, dramatists, elephants, horses and chariots. The cloud of fragrant incense darkened the sun at noonday: but the glowing radiance of the resplendent diamonds and jewels that adorned the persons of the ladies relieved the gloom!.." (Ramayana). The ancient metropolis of Ayodhya was situated on the banks of the Ghagra, a river as wide as the Ganges at Chunar and its extensive ruins can still be seen. There is no record of when and how Ayodhya came to be deserted or allowed to decay : the legend is that Rama ascended to heaven, carrying with him all the population of the place. So large had the city been that Lakshmanpur was described as its suburb! Taking a descent through the mists of time we alight upon Ayodhya again in the record books of the Emperor Akbar. It is a prodigious descent in time -from fifteen centuries before the Christian era to fifteen centuries after. Incredibly though, not much is known about the history of Avadh during this time. We know that after the conquest of Kanauj by the Afghans at the. end of the twelfth century, Avadh submitted to the Sultan of Ghazni, and so became part of the empire of Delhi. Avadh then as- serted its independence for a while under a Muslim ruler, but he was over- thrown by Babur, and Avadh became a subah or province of the Moghul empire. As the Moghul power declined and the emperors lost their paramountcy and they became first the puppets and then the prisoners of their feudatories, so Avadh grew stronger and more independent.
Its capital city was Faizabad. Of all the Muslim states and dependencies of the Moghul empire, Avadh had the newest royal family. They were descended from a Persian adventurer called Sadat Khan, originally from Khurasan in Persia. There were many Khurasanis in the service of the Moghuls, mostly soldiers, and if successful, they could hope for rich rewards. Sadat Khan proved to be amongst the most successful of this group. In 1732, he was made governor of the province of Avadh. His original title was Nazim, which means Governor, but soon he was made Nawab. In 1740, the Nawab was called Wazir or vizier, which means Chief Minister, and thereafter he was known as the Nawab Wazir. In practice, from Sadat Khan onwards, the titles had been hereditary, though in theory they were in the gift of the Moghul emperor, to whom allegiance was paid. A nazar, or token tribute, was sent each year to Delhi, and members of the imperial family were treated with great deference: two of them actually lived in Lucknow after 1819, and were treated with great courtesy. Achieving a certain degree of independence from the Moghuls in Delhi did not, unfortunately, mean that the Nawabs could rule entirely as they pleased. They had merely exchanged one master for another. The British, in the form of the East India Company based in Calcutta, had long looked with predatory eyes at the wealth of Avadh. Excuses for interference in the province were not hard to find. The most catastrophic from the Avadh point of view came when Shuja-ud-Daula invaded Bengal, and actually briefly held Calcutta. But British military victories at Plassey in 1757 and Buxar in 1764 utterly routed the Nawab. When peace was made, Avadh had lost much land. But the enemies became friends, on the surface anyway, and the Nawab Wazir was extolled in the British Parliament as the Chief native allay of the East India Company in all India. The Nawabs surrendered their independence little by little over many years. To pay for the protection of British forces and assistance in war, Avadh gave up first the fort of Chunar, then the districts of Benares and Ghazipur , then the fort at Allahabad; all the time the cash subsidy which the Nawab paid to the Company grew and grew. In 1773, the fatal step was taken by the Nawab of accepting a British Resident at Lucknow, and surrendering to the Company all control over foreign policy. Soon the Resident, however much he might defer ceremonially to the Nawab, became the real ruler. Asaf -ud-Daula, son of Shuja-ud- Daula, moved the capital from Faizabad to Lucknow in 1775 and made it one of the most prosperous and glittering cities in all India. Why did he move? On a whim, it is said, because he wanted to get away from the control of a dominant mother. On such a thread did the fate of the great city of Lucknow depend! Nawab Asaf-ud-Daula was a generous and sympathetic ruler, an inveterate builder of monuments and a discriminate patron of the arts. He built the Bara Imambara with its intricate bhul-bhulayya and adjoining mosque, primarily to create employment for his subjects during a time of drought. The Rumi Darwaza also testifies to his architectural zeal. His son, Wazir Ali, was the one who most regretted his grandfather's ac- ceptance of a British resident at Lucknow. In 1798, the Governor-General removed him from the throne, on the excuse that there was doubt as to whether he was a true son of Asaf-ud- Daula, but more probably because he was displaying tendencies to independence. They put Asafs brother, Sadat Ali Khan, on the throne. Sadat Ali Khan, though economical in fiscal management, was nevertheless an enthusiastic builder and commissioned many grand palaces, including Dilkusha, Hayat Baksh and Farhat Baksh, as well as the famous Lal Baradari. Hereafter the dynasty had to look to Calcutta rather than to Delhi to settle the succession. The assassination of a British Resident in 1798 in Benares by the deposed Wazir Ali gave further excuse for interference, and Lord Wellesley (brother of the Duke of Wellington) was just the man to exploit it.
By the treaty of 1801, the Nawab had to give up his own army, and pay heavily for a British-led one in its place. The southern doab (Rohilkhand) was ceded, and the remainder of the district of Allahabad and other areas became part of British India. In thirty years, Avadh had lost half its territory to the British. The Nawab demanded in return for these concessions that he should have a free hand in governing his remaining territory, unchecked by the advice or interference of the British. But in this, he was badly handicapped by the fact that he had to rely on British troops to enforce his orders. Wellesley had another trick up his sleeve: a clause of the treaty by which the Nawab under- took to establish a system of administration "by the advice of and acting in conformity to the counsel of the officers of the Honourable Company" which should be conducive to the prosperity of his subjects. It seemed a harmless clause, but was to be the means by which the British eventually annexed Avadh. Thus, from 1819 onwards, things ran their course in Avadh. Sadat Ali being gathered to his fathers, Ghazi his son, sat on the musnud, the throne, and took the cognomen "ud-Din", implying Defender of the Faith. He was formally invested with the title of King by the British, though ironically the proclamation of kingship coincided with a period of almost complete dependence on the British. He lent two millions of rupees to the British feringhee for the Nepal War, and at its close got the Nepalese Terai ~ a marshy forest extending along the foot of the Himalayas -in liquidation of half the debt. Some might have thought it a poor bargain, but in fact the Terai eventually produced some very valuable timber. Ghazi-ud-Din was a good monarch, responsible for much building and public works of all kinds, and he paid due attention to the administration of justice. He built the Mubarak Manzil and Shah Manzil as well as Hazari Bagh, in whjch he introduced Lucknow society to the sport of animal contests for the first time.
However, his son Nasir -ud-Din who succeeded to the throne, had an attachment to the English, not founded upon those things the English would like to be admired for -justice, liberty, democracy -but upon their dress, their eating habits and, more unfortunately, the drinking -habits of the more disreputable element of English adventurer with whom he surrounded himself. Nasir -ud-Din, despite such a temperament, was a popular monarch, who was responsible for the construction of an astrological centre, Tarunvali Kothi. Equipped with sophisticated instruments, it was entrusted to the care of a British astronomer. When he died there was another disputed succession and the British insisted on Muhammed Ali, another son of Sadat Ali, being enthroned. Muhammed Ali was a just and popular ruler and under him, Lucknow regained its splendour for a brief spell. He was however sorely troubled by rheumatism. He died in 1842 and his son Arnjad Ali succeeded, a man more inclined towards matters religious and spiritual, leading to the neglect of governance.

He was succeeded by Wajid Ali Shah, poet, singer, avid patron of the arts and lover of Lucknow. Of him it was written, "He is entirely taken up in the pursuit of his personal gratifications. He has no desire to be thought to take any interest whatever in public affairs and is altogether regardless of the duties and responsibilities of his high office. He lives exclusively in the society of fiddlers, eunuchs and women: he has done so since his childhood, and is likely to do so till his last." ('The Private Life of an Eastern King' by William Knighton.) This portrait of Wajid Ali Shah was used to justify British annexation of Avadh. If the charges of mismanagement levied against Wajid Ali Shah were true, the British were as much responsible for this as the Nawab. They were more in control of the administration and finances of Avadh since the 1780's than the Nawab. In addition, Avadh had been impoverished by the incessant cash demands of the British on the Nawab. The excuse at last came for the British to invoke that clause of the 1801 Treaty. And the Governor General in 1856, Lord Dalhousie, was just the man to do it. Avadh was annexed, Wajid Ali Shah shipped off to virtual imprisonment in Matiyaburj in Calcutta and, though this was not on the British programme, the stage set for the greatest rebellion to date against their power in India. One of Wajid Ali Shah's wives, the Begum Hazrat Mahal, remained in Lucknow, and when the Mutiny came in 1857, she put herself at the head of those fighting for freedom. The Begum never did surrender, she died in Nepal in 1879.

Types of Dinosaurs Types of Dinosaurs

Fun Dinosaur Facts for Kids
Learn about different types of dinosaursTypes of Dinosaurs
How many types of dinosaurs do you know? Check out our list of dinosaur kinds for kids which includes some of the most well known types of dinosaurs.
From ferocious Theropods such as the Tyrannosaurus rex and Spinosaurus to huge Sauropods such as the Diplodocus and Brachiosaurus. Read on and find out where your favorite dinosaur fits in while enjoying some fun facts.
 


In 1888, a man named Harry Seeley proposed a way of classifying dinosaurs into two groups by looking at their hip structure, these groups are called Saurischia (lizard hipped) and Ornithischia (bird hipped). The two groups can be further broken down into sub-groups such as families, sub-families and so on. Let’s take a look at some of the interesting sub-groups and examples of the dinosaurs that are part of them.

Saurischia (lizard hipped dinosaurs)
Theropods - The name Theropod means ‘beast foot’ and this group includes all of the carnivorous (meat eating) dinosaurs. Although it might be surprising, birds actually evolved from Theropods rather than from Ornithischian (bird hipped) dinosaurs. Theropods moved on two legs and include a number of scary looking but popular dinosaurs such as Tyrannosaurus rex and Velociraptor.
Sauropods - Sauropods evolved to walk on four legs and typically grew to enormous sizes. They were herbivores (plant eaters) and included classic dinosaurs such as the Diplodocus and Brachiosaurus.

Ornithiscia (bird hipped dinosaurs)
Thyreophora - The name Thyreophora means ‘shield bearers’ and this group includes armored dinosaurs such as the Stegosaurus and Ankylosaurus. They were herbivores that lived from the early Jurassic Period to the late Cretaceous.
Cerapods - Cerapods included a variety of interesting groups such as Ceratopsian (horned faced) dinosaurs like the Triceratops as well as Ornithopods (bird footed) dinosaurs like the Iguanodon.

Featured post

Life Infotech now a leading brand in the field of technology training

  Life Infotech now a leading brand in the field of technology training & its invites students around the nation to be a part of the Tra...