1
.item-case {
position: relative;
overflow: hidden;
padding-right: 0;
padding-left: 0;
margin-right: 15px;
margin-left: 15px;
}
.item-case .info {
min-width: 100%;
max-width: 100%;
background-color: #00afb5;
padding-top: 7px;
position: absolute;
bottom: 0;
height: auto;
transition: height 5s linear;
}
.item-case .info h2{
margin-top: 0;
margin-left: 10px;
margin-right: 10px;
}
.item-case .info p {
margin-left: 10px;
margin-right: 10px;
display: none;
visibility: hidden;
transition: visibility 5s linear;
}
.item-case:hover .info p {
display: block;
}
.item-case .info h2,
.item-case .info h2 * {
font-family: 'Open Sans', sans-serif;
font-weight: 700;
font-size: 140%;
text-align: center;
color: #fefefe;
}
.item-case .info p,
.item-case .info p * {
color: #5be8ed;
font-family: 'Open Sans', sans-serif;
font-weight: 400;
text-align: center;
font-size: 90%;
}
.item-case .imagem{
position: relative;
}
.item-case .imagem .efeito-imagem {
min-width: 100%;
max-width: 100%;
min-height: 100%;
max-height: 100%;
position: absolute;
top:0;
}
.item-case:hover .imagem .efeito-imagem {
background-color: rgba(62, 62, 62, 0.6);
transition: background 1000ms linear;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap-theme.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
<section class="col-md-4 col-sm-4 col-xs-12 item-case">
<div class="imagem">
<img src="http://devimg.com/550x330/dogs" class="img-responsive center-block" alt="">
<div class="efeito-imagem"></div>
</div><!--imagem-->
<div class="info">
<h2>Unimed Alto São Francisco</h2>
<p>lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras ac dolor dinissim, consequat enin sed, convallis massa. Fusce vel nins nibh</p>
</div><!--info-->
</section><!--col-md-4 col-sm-4 col-xs-12 item-case-->
In the div
"info" I’m trying to put a soft effect on the expansion when the element p
gains visibility and block.
But I could not obtain the result, only with absolute measures, of heigth:10px
to height:50px
for example.
Is there any way to do this preferably without using Javascript?
According to the research I conducted, you could use the
max-height
for that. related question in the English OS http://stackoverflow.com/questions/3508605/css-transition-height-0-to-height-auto– Wallace Maxters