Selector
Selector
Selector
color:rgba(244,66,220,
27) </ul>
28) </body>
29) </html>
1. * selector:
* means everything. This style is applicable for every thing in the web page.
1) *{
2) color:blue;
3) }
2. Descendant Selector:
1) li a{
2) color:white;
3) background: blue;
4) }
For every paragraph tag, which is adjacent to div tag this style is applicable.
4. Attribute Selector:
We can define style based on attributes.
Eg 1:
1) a[href]{
2) color:red;
3) background: yellow;
4) }
2. Descendant Selector:
1) li a{
2) color:white;
3) background: blue;
4) }
For every paragraph tag, which is adjacent to div tag this style is applicable.
4. Attribute Selector:
We can define style based on attributes.
Eg 1:
1) a[href]{
2) color:red;
3) background: yellow;
4) }
2. Descendant Selector:
1) li a{
2) color:white;
3) background: blue;
4) }
For every paragraph tag, which is adjacent to div tag this style is applicable.
4. Attribute Selector:
We can define style based on attributes.
Eg 1:
1) a[href]{
2) color:red;
3) background: yellow;
4) }
2. Descendant Selector:
1) li a{
2) color:white;
3) background: blue;
4) }
For every paragraph tag, which is adjacent to div tag this style is applicable.
4. Attribute Selector:
We can define style based on attributes.
Eg 1:
1) a[href]{
2) color:red;
3) background: yellow;
4) }
2. Descendant Selector:
1) li a{
2) color:white;
3) background: blue;
4) }
For every paragraph tag, which is adjacent to div tag this style is applicable.
4. Attribute Selector:
We can define style based on attributes.
Eg 1:
1) a[href]{
2) color:red;
3) background: yellow;
4) }
2. Descendant Selector:
1) li a{
2) color:white;
3) background: blue;
4) }
For every paragraph tag, which is adjacent to div tag this style is applicable.
4. Attribute Selector:
We can define style based on attributes.
Eg 1:
1) a[href]{
2) color:red;
3) background: yellow;
4) }
2. Descendant Selector:
1) li a{
2) color:white;
3) background: blue;
4) }
For every paragraph tag, which is adjacent to div tag this style is applicable.
4. Attribute Selector:
We can define style based on attributes.
Eg 1:
1) a[href]{
2) color:red;
3) background: yellow;
4) }
2. Descendant Selector:
1) li a{
2) color:white;
3) background: blue;
4) }
For every paragraph tag, which is adjacent to div tag this style is applicable.
4. Attribute Selector:
We can define style based on attributes.
Eg 1:
1) a[href]{
2) color:red;
3) background: yellow;
4) }
2. Descendant Selector:
1) li a{
2) color:white;
3) background: blue;
4) }
For every paragraph tag, which is adjacent to div tag this style is applicable.
4. Attribute Selector:
We can define style based on attributes.
Eg 1:
1) a[href]{
2) color:red;
3) background: yellow;
4) }
For every paragraph tag, which is adjacent to div tag this style is applicable.
4. Attribute Selector:
We can define style based on attributes.
Eg 1:
1) a[href]{
2) color:red;
3) background: yellow;
4) }
2. Descendant Selector:
1) li a{
2) color:white;
3) background: blue;
4) }
For every paragraph tag, which is adjacent to div tag this style is applicable.
4. Attribute Selector:
We can define style based on attributes.
Eg 1:
1) a[href]{
2) color:red;
3) background: yellow;
4) }
2. Descendant Selector:
1) li a{
2) color:white;
3) background: blue;
4) }
For every paragraph tag, which is adjacent to div tag this style is applicable.
4. Attribute Selector:
We can define style based on attributes.
Eg 1:
1) a[href]{
2) color:red;
3) background: yellow;
4) }
For all href attributes of anchor tag this style is applicable. 0.9)
a means alpha
The allowed values for a attribute are : 0.0 to 1.0
1.0 means full dark and 0.0 means full light(transparent)
http://www.december.com/html/spec/colorrgbadec.html
Note: The most commonly used approach is: hexa code
Setting Background and Borders:
In CSS, we can set Background as follows:
1) body{
2) background-color:red;
3) }
We can set Border as follows:
1) div{
2) border-color:blue;
3) border-width:thick;
4) border-style:double;
5) }