I am facing the following problem : My .line div
comes above the .list div
and I do not understand why. I defined no new stacking context through z-index
so shouldn't stacking order only be defined by the order of appearance in HTML? Or is there something else defining a new stacking context in my case that I don't see?
Thanks a bunch
body {
font-family:helvetica, sans-serif;
}
.line {
background-color:red;
height: 150px;
width:1px;
float:left;
position: relative;
left: 57px;
top:20px;
}
.list {
list-style-type:none;
display: inline-block;
}
.written {
width:200px;
position: relative;
top: 5px;
}
.dot {
border: 1px solid blue;
border-radius: 20px;
width: 20px;
height: 20px;
float:left;
margin: 5px;
}
<html>
<head>
<link href="./style.css" type="text/css" rel="stylesheet">
</head>
<body>
<div class=line>
</div>
<ul class=list>
<li>
<div class=dot>
</div>
<p class=written>First thing</p>
</li>
<li>
<div class=dot>
</div>
<p class=written>Second thing</p>
</li>
<li>
<div class=dot>
</div>
<p class=written>Third thing</p>
</li>
</ul>
</body>
</html>