- #1
shivajikobardan
- 674
- 54
- TL;DR Summary
- Can't see what is z-index doing in CSS.
I'm following "CSS Cookbook" by Christopher Schmitt to learn CSS.
I am going through this example.
I'm seeing no difference with or without z-index. z-index should be stacking elements but not sure what does that mean here. (I don't have access to book's images that's why I'm using my own images).
Here's the image that I'm using:
https://upload.wikimedia.org/wikipe...imple.svg/800px-Circle_-_black_simple.svg.png
I am going through this example.
HTML:
<div class="image">text goes here</div>
CSS:
.image {
position: relative;
z-index: 20;
width: 130px;
height: 140px;
background-image: url(circle.png);
border: 1px solid black;
background-repeat: no-repeat;
background-size:cover;
}
Here's the image that I'm using:
https://upload.wikimedia.org/wikipe...imple.svg/800px-Circle_-_black_simple.svg.png