0
Next person I own a div
Father and inside her others divs
I wanted to apply a css
where to change the background to purple and the text and image to white until then works normal the problem is that wanted to apply a scale
at the bottom that turned purple with the :hover
more doing so it applies the effect of :hover
the other elements and in this case wanted the effect of scale
stay only at the bottom. follow my code:
OBS I am using SASS attached an image to show the final result.
SASS
.box-courses{
border: 2px solid $gray-light;
padding: 15px 30px;
@include transition(.5s);
&:hover{
@include gradient-bg(gradient);
@include box-shadow(shadow);
@include scale(1.1);
border: none;
.title-course{
@include scale(1);
color: $white;
}
.icon-course{
@include scale(1);
background-image: url(../images/courses/html-hover.png);
}
.description{
@include scale(1);
color: $white;
}
}
.title-course{
font-family: 'Open Sans', sans-serif;
font-size: 15px;
font-weight: bold;
color: $gray;
}
.icon-course{
background-image: url(../images/courses/html.png);
width: 52px;
height: 57px;
}
.description{
font-size: 13px;
}
.buttons{
margin-top: 15px;
li{
.btn-custom{
padding: 10px 15px;
}
}
}
}
HTML
<div class="container">
<div class="row">
<div class="col-md-4">
<div class="box-courses">
<div class="row">
<div class="col-md-3 pull-right">
<div class="icon-course"></div>
</div>
<div class="col-md-9">
<h4 class="title-course">Curso de HTML5: Aprenda de maneira descomplicada.</h4>
</div>
</div>
<div class="row">
<div class="col-md-12">
<p class="description">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</p>
</div>
</div>
<div class="row">
<div class="col-md-12">
<ul class="list-inline list-unstyled buttons">
<li><a href="#" class="btn-gradient btn-custom">Saiba mais</a></li>
<li><a href="#" class="btn-white btn-custom"><span>Comprar curso agora</span></a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
my code realize here that font and other elements have increased and that’s not what I just want to increase the purple background:
There’s a mathematical problem there. 0.9 is not the "opposite" of 1.1 - If it increased 1.1, the inverse is 0.909090909090909... (another example: if you increase a value by 25%, you have to decrease only 20% for it to return to the original)
– Bacco
@Bacco xD true! I just don’t know if it checks out, but these days I’ve heard that CSS only understands up to 4 decimal places, 0.0001 after that it ignores....
– hugocsl
@Bacco already found a reference, the number of decimals would make from Browser to Browser. I think I’ll even ask a question about it to get registered on the site look ai http://cruft.io/posts/percentage-calculations-in-ie/
– hugocsl