CSS on DIV:
CSS on text:
DIV is a tag in HTML to create customized containers on a web page. It stands for Division. CSS can extensively stylize a DIV:
Property
|
Value
|
Description
|
width
|
120px;
|
Width of DIV
|
height
|
80px;
|
height of DIV
|
border
|
1px solid #ddd;
|
border of DIV
|
border-bottom border-top
border-left
border-right
|
1px solid #ddd;
|
Specific Border
|
padding
|
15px; / 15px 15px; / 15px 15px 15px; / 15px 12px 15px 12px
|
Space between DIV boundary and DIV content
|
margin
|
15px; / 15px 15px; / 15px 15px 15px; / 15px 12px 15px 12px
|
Space between page boundary and DIV
|
background-color
|
#4CAF50;
|
Background color of DIV
|
background-image
|
url("paper.gif");
|
background-image of DIV
|
float
|
Left / right
|
Floating DIV along with another
|
display
|
Inline / block / inline-block / none
|
Type of display of DIV
|
overflow
|
Visible / hidden / scroll / auto
|
Display of content of DIV
|
Example 1: height, width & border
Sample Paragraph of this first division
Sample Paragraph of this second division
Output 1:
Example 2: background-color & background-image
Sample Paragraph of this first division
Sample Paragraph of this second division
Output 2:
Example 3: padding & margin
Sample Paragraph of this first division
Sample Paragraph of this second division
Output 3:
Example 4: float
Sample Paragraph of this first division
Sample Paragraph of this second division
Output 4:
Example 5: display
Sample Paragraph of this first division
Sample Paragraph of this second division
Output 5:
Example 6: display with float
Sample Paragraph of this first division
Sample Paragraph of this second division
Output 6:
Example 7: overflow
Sample Paragraph of this first division Sample Paragraph of this first division Sample Paragraph of this first division Sample Paragraph of this first division Sample Paragraph of this first division Sample Paragraph of this first division Sample Paragraph of this first division Sample Paragraph of this first division Sample Paragraph of this first division Sample Paragraph of this first division Sample Paragraph of this first division Sample Paragraph of this first division Sample Paragraph of this first division Sample Paragraph of this first division Sample Paragraph of this first division Sample Paragraph of this first division Sample Paragraph of this first division Sample Paragraph of this first division Sample Paragraph of this first division Sample Paragraph of this first division
Sample Paragraph of this second division Sample Paragraph of this second division Sample Paragraph of this second division Sample Paragraph of this second division Sample Paragraph of this second division Sample Paragraph of this second division Sample Paragraph of this second division Sample Paragraph of this second division Sample Paragraph of this second division Sample Paragraph of this second division Sample Paragraph of this second division Sample Paragraph of this second division Sample Paragraph of this second division Sample Paragraph of this second division Sample Paragraph of this second division Sample Paragraph of this second division Sample Paragraph of this second division Sample Paragraph of this second division Sample Paragraph of this second division Sample Paragraph of this second division
Sample Paragraph of this third division Sample Paragraph of this third division Sample Paragraph of this third division Sample Paragraph of this third division Sample Paragraph of this third division Sample Paragraph of this third division Sample Paragraph of this third division Sample Paragraph of this third division Sample Paragraph of this third division Sample Paragraph of this third division Sample Paragraph of this third division Sample Paragraph of this third division Sample Paragraph of this third division Sample Paragraph of this third division Sample Paragraph of this third division Sample Paragraph of this third division Sample Paragraph of this third division Sample Paragraph of this third division Sample Paragraph of this third division Sample Paragraph of this third division
Sample Paragraph of this fourth division Sample Paragraph of this fourth division Sample Paragraph of this fourth division Sample Paragraph of this fourth division Sample Paragraph of this fourth division Sample Paragraph of this fourth division Sample Paragraph of this fourth division Sample Paragraph of this fourth division Sample Paragraph of this fourth division Sample Paragraph of this fourth division Sample Paragraph of this fourth division Sample Paragraph of this fourth division Sample Paragraph of this fourth division Sample Paragraph of this fourth division Sample Paragraph of this fourth division Sample Paragraph of this fourth division Sample Paragraph of this fourth division Sample Paragraph of this fourth division Sample Paragraph of this fourth division Sample Paragraph of this fourth division
Output 7: