Reputation: 1204
My span height (class="figure") is not stretching to 100% height of the list item
HTML
<div class="container">
<ul>
<li>
<span class="stepLabel">Step</span>
<span class="figure"></span>
<img src="indent.png" alt="ghost" class="ghost">
</li>
<li>
<span class="stepLabel">Step</span>
<span class="figure"></span>
<img src="indent.png" alt="ghost" class="ghost">
</li>
</ul>
</div>
CSS
.container { width: 90%; margin: 10px auto; border: 1px solid #d8d8d8; }
ul { list-style: none; margin: 0; padding: 0; overflow: hidden; }
ul li { display: block; width: 12.1%; height: auto; float: left; margin-left: -1%; }
ul li .stepLabel { display: block; position: absolute; z-index: 999; }
ul li img.ghost { width: 100%; height: auto; position: relative; z-index: 1; opacity: 0.1; }
.figure { display: block; width: 100%; height: 100%; background-color: rgba(0,0,0,0.2); }
Upvotes: 0
Views: 125
Reputation:
width
/heigh
100%?
You can use position: absolute
and left
/right
/top
/bottom
0
-s
Don't forget parent's position: relative
(for li
);
Upvotes: 2
Reputation: 240878
Set the height of the parent li
.
ul li {
height: 72px;
}
The initial height of an element is auto
, therefore that isn't even doing anything. The span
element will collapse upon itself, as 100%
of auto is actually just 0
.
Upvotes: 2