- Get link
- X
- Other Apps
Display property in CSS -
1. inline display -
In display property if we apply inline property on it we cannot be set their width and height and element was set next to a element in line it not take extra space .
syntax -
Display: inline ;
2. block display -
In this display property line will take whole block of line or other word the line will take complete one line space if there is element is present or not it will take whole line as a block .
syntax -
Display : block ;
3. Inline-block display -
In display property if we apply inline-block property on it we can be set their width and height and element was set next to a element in line it not take extra space so in easy word it is work as both block element who's width and height can be changed and inline which do not take extra space .
Display : inline-block ;
4. none display -
in this property the element cannot get any space on the page and their display was none .
syntax -
Display: none;
code -
NOTE - THE CONTENT IN THE DIV IS FOR SHOWING YOU HOW DISPLAY PROPERTY WORK .
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Display property in css </title>
<style>
.in{
border: 2px solid red;
display: inline;
}
.block{
border: 2px solid red;
display: block;
}
.inblock{
border: 2px solid red;
display: inline-block;
}
.none{
border: 2px solid red;
display: none;
}
</style>
</head>
<body>
<h2>inline display</h2>
<div>
In display property if we apply inline-block property on it we can be set their width and height and element was set next to a element in line it not take extra space so in easy word it is work as both block element who's width and height can <P class="in">inline property</P> be changed and inline which do not take extra space In this display property line will take whole block of line or other word the line will take complete one line space if there is element is present or not it will take whole line as a block .
</div>
<h2>block display</h2>
<div>
In display property if we apply inline-block property on it we can be set their width and height and element was set next to a element in line it not take extra space so in easy word it is work as both block element who's width and height can <P class="block">inline property</P> be changed and inline which do not take extra space In this display property line will take whole block of line or other word the line will take complete one line space if there is element is present or not it will take whole line as a block .
</div>
<h2>inline-block display</h2>
<div>
In display property if we apply inline-block property on it we can be set their width and height and element was set next to a element in line it not take extra space so in easy word it is work as both block element who's width and height can <P class="inblock">inline property</P> be changed and inline which do not take extra space In this display property line will take whole block of line or other word the line will take complete one line space if there is element is present or not it will take whole line as a block .
</div>
<h2>none display</h2>
<div>
In display property if we apply inline-block property on it we can be set their width and height and element was set next to a element in line it not take extra space so in easy word it is work as both block element who's width and height can <P class="none">inline property</P> be changed and inline which do not take extra space In this display property line will take whole block of line or other word the line will take complete one line space if there is element is present or not it will take whole line as a block .
</div>
</body>
</html>
live on browser -
inline display
In display property if we apply inline-block property on it we can be set their width and height and element was set next to a element in line it not take extra space so in easy word it is work as both block element who's width and height can
inline property
be changed and inline which do not take extra space In this display property line will take whole block of line or other word the line will take complete one line space if there is element is present or not it will take whole line as a block .block display
In display property if we apply inline-block property on it we can be set their width and height and element was set next to a element in line it not take extra space so in easy word it is work as both block element who's width and height can
inline property
be changed and inline which do not take extra space In this display property line will take whole block of line or other word the line will take complete one line space if there is element is present or not it will take whole line as a block .inline-block display
In display property if we apply inline-block property on it we can be set their width and height and element was set next to a element in line it not take extra space so in easy word it is work as both block element who's width and height can
inline property
be changed and inline which do not take extra space In this display property line will take whole block of line or other word the line will take complete one line space if there is element is present or not it will take whole line as a block .none display
In display property if we apply inline-block property on it we can be set their width and height and element was set next to a element in line it not take extra space so in easy word it is work as both block element who's width and height can be changed and inline which do not take extra space In this display property line will take whole block of line or other word the line will take complete one line space if there is element is present or not it will take whole line as a block .
Comments
Post a Comment