CSS Properties
Background-
Sets background color of a webpage
color
color Sets color of the text. Eg.Color:green
Specifies the font family or font face for texteg- font-family:”Times New
font-family
Roman”
Specifies the font size of text.
Three different units are used for setting font size.
font-size
Namely-px(pixels), % , em
Eg font-size: 20px
font-style Specifies the font style for texteg font-style: italic/normal;
Height and Width in CSS are used to set the height and width of boxes.
Eg- height: 120px;
height ,width width: 50%;
The CSS float property defines that an element should be taken out of the normal flow of the
document and placed along the left or right side of its containing block. Text and inline elements
float will then wrap around this element.
Eg - float: value;
Aligns the text in an element
text-align
Text-align:left, right, center, justify
Controls the letters in an element
text-transform
none, capitalize, uppercase, lowercase
Sets margin of a webpage
margin Margin-top:10px;Margin-left:10px;Margin-right:10px;Margin-
bottom:10px;
Sets the style of the four borders
Border-style Border-style: values(eg none, hidden, dotted, dashed, solid, double, groove,
ridge, inset, outset, inherit)
Sets the color of the four borders
Border-color
Eg border-color:green
Border-width Sets the width of the border eg border-width:thin/thick/medium/20pt
Word-spacing Provide space b/w wordsEg word-spacing:5px
Letter-spacing Provide space b/w lettersEg letter-spacing:5px
Background- This property is used to display the image.
image Background-image:url(“supernaturals.jpg”) or c:\mypic\supernaturals.jpg
Background- It is used to set whether the image will be repeated or not . It has 4
repeat possible values.
Repeat- It repeats the image of webpage.
repeat-x- It repeats the image of webpage on x axis.
repeat-y- It repeats the image of webpage on y axis.
CSS Properties
no-repeat- It does not repeats the image of webpage
Outline vs Border property(CBSE EXAM)
An outline is a line that is drawn around elements, outside the borders, to make the element
"stand out".
The outline property is a shorthand property for:
outline-width
outline-style (required)
outline-color
If outline-color is omitted, the color applied will be the color of the text.
Note: Outlines differ from borders! Unlike border, the outline is drawn outside the element's
border, and may overlap other content. Also, the outline is NOT a part of the element's
dimensions; the element's total width and height is not affected by the width of the outline.
<html>
<head>
<style>
h2 {
border: 1px solid red;
outline: 5px dotted green;