• Read this article : http://www.w3schools.com/html/html_attributes.asp

 

 

class Specifies one or more classnames for an element (refers to a class in a style sheet)
id Specifies a unique id for an element
style Specifies an inline CSS style for an element
title Specifies extra information about an element (displayed as a tool tip)

 

 

 

CSS Terms and Definitions

http://www.impressivewebs.com/css-terms-definitions/

Selectors

The selector is the part of the rule that appears before the opening curly brace.

.box { background-color:red; } form textarea { background-color:blue; }

Universal Selector

* { background-color:red; }

Element Type Selector

The selector matches the HTML elements by tag name.

h2 { background-color: red; } div { background-color: red; }

Class Selector

.myelement { background-color: red; } <p class="myelement">Hello</p>

ID Selector

#myelement { background-color:red; } <p id="myelement">Nice to meet you</p>

Descendant Selector

.parent .child { background-color:red; }

Attribute Selector

div[style] { background-color: red; } input[type="text"] { background-color: red; }

Child Selector

.one > .two { background-color: red; }

Adjacent Sibling Selector

This selector, which uses the plus sign, targets elements that are “adjacent” to each other, or immediate siblings, and they must have the same parent element.

h2+p { background-color:red; }

General Siblind Selector

This uses the tilde character and is exactly the same as the adjacent sibling selector except the elements don’t have to be immediate siblings.

h2~p { background-color: red; }

Pseudo Class

These select an element based on a state the element is in.

a:visited { background-color: red; } input:focus { background-color: red; }

Pseudo-element

http://coding.smashingmagazine.com/2011/07/13/learning-to-use-the-before-and-after-pseudo-elements-in-css/