What Are Selectors And Properties In CSS

Selector forms


Simple selector forms:

h1 { font-size: 24px;}
h2,h3{font-size:20px;}


Id selectors:

#header{
Background: #000000;
Color:#ffffff;
}
<h2 id="header">White collar</h2>


class selectors:

p.normal{ font-size:20px;}
<p class="normal">
The text in this paragraph will be of font size 20px.


Generic Selectors:

.sale{ font-size:20px;}
Any element with the class sale will be of font size 20px
<h1 class="sale">weekend sale</h1>
<p class="sale">offers of the day!...</p>


Universal selectors:

*{color:#555;}
All the text in the document will be of that color.


Property groups

    Basic CSS Property Groups
  • * Animation
  • * Background
  • * Border and outline
  • * Box
  • * Color
  • * Font
  • * Generated content
  • * Grid
  • * Hyperlink
  • * Linebox
  • * List
  • * Margin
  • * Marquee
  • * Multi-column
  • * Padding
  • * Paged Media
  • * Positioning
  • * Print
  • * Ruby
  • * Speech
  • * Table
  • * Text
  • * 2D/3D Transform
  • * Transition
  • * User-interface

Each group has its own set of style attributes. Applying these styles to html is explained further in the next tutorials.


Guys follow the various other tutorials to catch on further in CSS coding and designing