Having trouble implementing the height:100;
property on hover in my portfolio section. I've tried several solutions from similar questions without success. Although it works with media queries, I believe there's a better way to achieve this but I can't seem to figure it out!
Here is a snippet of my HTML:
<!-- Begin Portfolio -->
<section id="section2">
<div class="container portfolio">
<!-- Page Title -->
<div class="row page-title-2">
<div class="col-lg-12">
<h3>Portfolio</h3>
<hr>
<p>We also create some other stuff.</p>
</div>
</div>
<!-- Portfolio Filter -->
<div class="container text-center">
<ul class="nav nav-pills">
<li class="filter" data-filter="all">all</li>
<li class="filter" data-filter="print">print</li>
<li class="filter" data-filter="web">web</li>
<li class="filter" data-filter="branding">branding</li>
<li class="filter" data-filter="branding">illustration</li>
</ul>
</div>
<!-- Portfolio Items -->
<div class="container port-holder">
<ul id="myPortfolio" class="no-padding">
<li class="item branding col-xs-4 no-padding">
<a data-toggle="modal" href="projects/project-1.html" data-target="#myModal">
<img src="img/projects/thumbs/branding1.jpg" alt="..." />
<span class="portfolio-hover">
<span>
<h4>Beach Sand</h4>
<em>Branding</em>
</span>
</span>
</a>
</li>
<li class="item web col-xs-4 no-padding">
<a data-toggle="modal" href="projects/project-2.html" data-target="#myModal">
<img src="img/projects/thumbs/web1.jpg" alt="..." />
<span class="portfolio-hover">
<span>
<h4>B&W Scene</h4>
<em>Web Design</em>
</span>
</span>
</a>
</li>
[Other portfolio items omitted for brevity]
</ul>
</div>
</div>
</section>
<!-- End Portfolio -->
The CSS code related to the hover effect:
.portfolio ul li:hover span.portfolio-hover {
opacity: 1;
}
.portfolio img {
max-width: 100%;
width: 100%;
height: 100% !important;
}
span.portfolio-hover {
background: rgba(39,39,39,0.95);
color: #8e8e8e;
width: 100%;
height: 100%;
display: table;
left: 0;
position: absolute;
top: 0;
bottom: 0;
opacity: 0;
-webkit-transition: opacity 500ms;
-moz-transition: opacity 500ms;
-o-transition: opacity 500ms;
transition: opacity 500ms;
}
span.portfolio-hover span {
display: table-cell;
text-align: center;
vertical-align: middle;
}
Any assistance would be highly appreciated!
For a live demonstration, you can visit this link and navigate to the portfolio section to hover over an image.