Home » » The Most Cascading Style Sheets Property

The Most Cascading Style Sheets Property

The Cascading Style Sheets property border defines the div border size type and color to be used for an HTML element. The property CSS background-color defines the background color to be used for an HTML element. 

A Style sheets rule modify a selector, and declaration (property, value) and selector show how element can be selected for other styling as it can. For example, the selector for a paragraph element is p ; selectors is include element name by Class and ID.
Using Cascading Style Sheets, there are three way(inline style, internal style, external style) but it rule and declaration is the same.
The most CSS properties:


Color: use to set color.
h1{color:red;}

backgroundSets all the background properties in one declaration
ex:
body{background: url(images/dotted-line.png) no-repeat right top; }
or
body{
background-image:url(images/dotted-line.png);
background-color:red;
background-repeat:no-repeat / repeat-x / repeat-y;
background-position:top / left / right / bottom;
background-size:100px;
}

Border: Sets all the border properties in one declaration( border-left, border-right, border-top, border-bottom)
ex:
p{border-left:solid thin red;}

border-radiusA shorthand property for setting all the four border-*-radius properties
ex:
p{border-radius: 5px;}
or
p{border-radius:5px 3px 9px 2px;}

box-shadowAttaches one or more drop-shadows to the box
ex:
p{
    box-shadow: 5px 10px 5px #888888;
}


floatSpecifies whether or not a box should float
ex:
div{float: left;}
or
div{float:right;}


clearSpecifies which sides of an element where other floating elements are not allowed
ex:
div {
    float: left;
}

div.clear {
    clear: both;
}



PaddingSets all the padding properties in one declaration
ex:
div{
         padding:2px;
}
or
div{ padding-left:2px; padding-right:10px;}



MarginSets all the margin properties in one declaration
ex:
div{
         margin:2px;
}
or
div{ margin-left:2px; margin-right:10px;}



text-alignSpecifies the horizontal alignment of text
ex:
div{ text-align:justify;}
or
div{ text-align:left;}
or
div{ text-align:center;}



text-decorationSpecifies the decoration added to text
ex:
p{ text-decoration: overline;  }
or
p{ text-decoration: line-through;  }
or
p{ text-decoration: underline;  }



font: Sets all the font properties in one declaration
ex:
p{font-size:14px;}
or
p{font-weight:bold;}

Share this acticle :

0 comments:

Post a Comment

 

Proudly powered by Blogger