- Get link
- X
- Other Apps
Property of CSS -
Z-index property -
In this property we can move an image in the z axis like if we want to move an image to front of an element or behind of an element we can do it with the help of this property this property always work with absolute , relative , fixed / sticky and flex property so you have to take care of it and that you use this property only with this positions always take care that and here an image given below where you clear your doubt so go through it also
syntax -
z-index : x(value in positive or negative );
image -
Code -
1.If we take the value of z index in negative
<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>Z index in css </title>
<style>
#index{
position: absolute;
top: 0;
z-index: -3;
}
</style>
</head>
<body>
<img id="index" src="img/A1.png" alt="">
<p class="" style="color: wheat;">
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 . 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
</p>
</body>
</html>
output -
<!DOCTYPE html>
<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>Z index in css </title>
<style>
#index{
position: absolute;
top: 0;
z-index: 3;
}
</style>
</head>
<body>
<img id="index" src="img/A1.png" alt="">
<p class="" style="color: red;">
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 . 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
</p>
</body>
</html>
output -
Comments
Post a Comment