I'm making a div over another div, so when you hover the top div, you will see the one under it.
the background colors are the same, but when I check it, it makes this weird color before the animation is complete:
I tried all kind of stuff I found online and here but nothing helped.
does anyone know how to fix it?
thanks in advance.
#morningEtgarWrap{
position:relative;
width:25%;
height:260px;
}
#morningEtgar, #morningEtgarDes{
z-index:90;
text-align:center;
}
#morningEtgarExp, #morningEtgar{
background-color:#7126C6;
position:absolute;
width:100%;
height:100%;
text-align:center;
}
#morningEtgarDes, #morningEtgarName{
height:70px;
background-color:#FCED1D;
width:100%;
position:absolute;
bottom:0;
}
#morningEtgarImg{
padding:20px;
max-width:60%;
}
.headDesMorningEtgar{
font-size:14pt;
letter-spacing:2px;
}
#morningEtgarDes{
padding:10px;
}
#morningEtgarWrap:hover #morningEtgar{
opacity: 0;
-webkit-transition: all 0.5s ease-out;
-moz-transition: all 0.5s ease-out;
-o-transition: all 0.5s ease-out;
transition: all 0.5s ease-out;
-webkit-transform: translate3D(0, 0, 0);
}
#morningEtgarWrap:hover #morningEtgarDes{
opacity: 0;
-webkit-transition: all 0.5s ease-out;
-moz-transition: all 0.5s ease-out;
-o-transition: all 0.5s ease-out;
transition: all 0.5s ease-out;
-webkit-transform: translate3D(0, 0, 0);
}
<div id="morningEtgarWrap">
<div id="morningEtgar">
<img id="morningEtgarImg" src="http://localhost/et-garim/wp-content/uploads/2019/12/Asset-2-1.png"/>
</div>
<div id="morningEtgarDes">
<div><span class="headDesMorningEtgar"><b>עתגר בוקר</b></span>
<br/>
לחת צורק מונחף, בגורמי מגמש לפתיעם.<br/> <b>עוד ></b>
</div>
</div>
<div id="morningEtgarExp">
לורם איפסום דולור סיט אמט, קונסקטורר אדיפיסינג אלית לורם איפסום דולור סיט אמט, קונסקטורר אדיפיסינג אלית. סת אלמנקום ניסי נון ניבאה. דס איאקוליס וולופטה דיאם. וסטיבולום אט דולור.
</div>
<div id="morningEtgarName">
<div><span class="headDesMorningEtgar"><b>עתגר בוקר</b></span>
</div>
</div>
Related
CSS Transition is not working in chrome on image hover, please check the JSFiddle example
HTML
<div class="screenThum">
</div>
CSS
.screenThum .portfolio{
width:350px;
display:block;
height:100%;
background-size:100%;
background-repeat:no-repeat;
height:250px;
position:relative;
opacity:0.4;
-webkit-transition: all .8s ease-in-out;
-moz-transition: all .8s ease-in-out;
-ms-transition: all .8s ease-in-out;
-o-transition: all .8s ease-in-out;
transition: all .8s ease-in-out;
}
.screenThum .portfolio:hover{
opacity:0.9;
background-size:120%;
}
I have tried with previous SO answers but didn't worked with my code, not sure whats wrong?
thanks
If you are comfortable with it then you can use transform:scale
to get same effect. Edited: taking the reference of #Alexandre Beaudet
.screenThum{
overflow: hidden;
width: 350px;
height: 250px;
}
.screenThum .portfolio{
width:350px;
display:block;
height:100%;
background-size:100%;
background-repeat:no-repeat;
height:250px;
position:relative;
opacity:0.4;
-webkit-transition: all .8s ease-in-out;
-moz-transition: all .8s ease-in-out;
-ms-transition: all .8s ease-in-out;
-o-transition: all .8s ease-in-out;
transition: all .8s ease-in-out;}
.screenThum .portfolio:hover{
opacity:0.9;
-moz-transform: scale(1.2,1.2);
-webkit-transform: scale(1.2,1.2);
transform: scale(1.2,1.2);
}
<div class="screenThum"></div>
Try to set screenThump width & overflow: hidden. Then use the transform: scale(x) property. This way you will get the zoom effect and the image will not get out of the container width.
.screenThum {
overflow:hidden;
width: 350px;
}
.screenThum .portfolio{
width:350px;
display:block;
height:100%;
background-size:100%;
background-repeat:no-repeat;
height:250px;
position:relative;
opacity:0.4;
-webkit-transition: all .8s ease-in-out;
-moz-transition: all .8s ease-in-out;
-ms-transition: all .8s ease-in-out;
-o-transition: all .8s ease-in-out;
transition: all .8s ease-in-out;
}
.screenThum .portfolio:hover{
opacity:0.9;
transform: scale(3);
}
.container{
height: 700px;
width:100%;
}
.need-help-qu {
background-color:#042E49;
color:#ffffff;
padding:0px 10px;
font-size: 20px;
transition: all 0.4s ease-in-out;
-webkit-transition: all .8s ease;
-moz-transition: all .8s ease;
-ms-transition: all .8s ease;
-o-transition: all .8s ease;
transition: all .8s ease;
float:left;
height:28px;
}
.need-help {
float:left;
background-color:#06507D;
color:#ffffff;
padding:5px 10px;
overflow: hidden;
}
.need-help-full {
right:-95px;
position:fixed;
top:40%;
transition: all 0.4s ease-in-out;
-webkit-transition: all .8s ease;
-moz-transition: all .8s ease;
-ms-transition: all .8s ease;
-o-transition: all .8s ease;
transition: all .8s ease;
}
.need-help-full:hover {
right:0;
}
<div class"container">
Test sscroll
</div>
<div class="need-help-full">
<a href="#">
<span class="need-help-qu p-n-b">?</span>
<span class="need-help text-sm p-n-r">NEED A HELP</span>
</a>
</div>
I have one div with the text and '?' sign at right side center with fix position. When user hover on '?' sign the div comes out from right to left with transition (like social icon). It is working perfectly.
But when scrollbar comes in small screen the whole div come over the scrollbar instead of near the scrollbar.
Can anyone help me?
Thanks in advance.
Just add
.need-help-full {
z-index:-1;
}
On tumblr I am trying to add an image to the bottom of the page that will disappear when moused over. As it disappears I have a block of text the transitions to appear in its place. Right now both are doing these things, but when the text block is moused over the image reappears. I want it to stay completely transparent.
This is in it's current state
#bite
#bite a{
display:block
}
#bite .death {
margin-top:0px;filter: alpha(opacity = 0);
opacity:0;-webkit-transition: all 0.5s ease-out;
-moz-transition: all 0.5s ease-out;transition: all 0.5s ease-out;
}
#bite:hover .death {
margin-top:0px;
-webkit-transition: all 0.8s ease-out;
-moz-transition: all 0.8s ease-out;
transition: all 0.8s ease-out;
filter: alpha(opacity = 100);
filter: alpha(opacity = 100);
opacity:100;
}
#actualnews {
font-family: 'Rock Salt'; cursive
font-size:5px;
color: #b8b8b8;
width:150px;
height:auto;
padding-top:3px;
border:1px solid#b8b8b8;
margin-left: 30px;
margin-top:10px;
text-align:center;
position:fixed;
right:145px;
bottom:70px;
}
#thekey img{
width:150px;
margin-top: -40px;
margin-left: 45px;
position:fixed;
right:150px;
bottom:20px;
filter: alpha(opacity = 100);
opacity:100;
-webkit-transition: all 0.8s ease-out;
-moz-transition: all 0.8s ease-out;
transition: all 0.8s ease-out;
}
#thekey img:hover {
margin-top:0px;
-webkit-transition: all 0.8s ease-out;
-moz-transition: all 0.8s ease-out;
transition: all 0.8s ease-out;
filter: alpha(opacity = 0);
filter: alpha(opacity = 0);
opacity:0;
}
<div id="bite">
<div id="thekey"><img src="{image:thekey}"></div>
<div class="death">
<div id="actualnews">
<a href="www.winngstiel.tumblr.com/tagged/mine" font-color:#9d3e78>MY STUFF</a>
<p>
<a href="www.winngstiel.tumblr.com/tagged/edit" font-color:#9d3e78>PRETTY THINGS</a>
</div>
</div></div>
As you can see the text is somehow in the way. Any help is greatly appreciated as I am very new to how everything with coding works. Any confusion or questions please ask!
You can change the selector for the CSS rule that hides the image to trigger on #bite's hover.
...
#bite:hover #thekey img {
...
Full code:
#bite
#bite a{
display:block
}
#bite .death {
margin-top:0px;filter: alpha(opacity = 0);
opacity:0;-webkit-transition: all 0.5s ease-out;
-moz-transition: all 0.5s ease-out;transition: all 0.5s ease-out;
}
#bite:hover .death {
margin-top:0px;
-webkit-transition: all 0.8s ease-out;
-moz-transition: all 0.8s ease-out;
transition: all 0.8s ease-out;
filter: alpha(opacity = 100);
filter: alpha(opacity = 100);
opacity:100;
}
#actualnews {
font-family: 'Rock Salt'; cursive
font-size:5px;
color: #b8b8b8;
width:150px;
height:auto;
padding-top:3px;
border:1px solid#b8b8b8;
margin-left: 30px;
margin-top:10px;
text-align:center;
position:fixed;
right:145px;
bottom:70px;
}
#thekey img{
width:150px;
margin-top: -40px;
margin-left: 45px;
position:fixed;
right:150px;
bottom:20px;
filter: alpha(opacity = 100);
opacity:100;
-webkit-transition: all 0.8s ease-out;
-moz-transition: all 0.8s ease-out;
transition: all 0.8s ease-out;
}
#bite:hover #thekey img {
margin-top:0px;
-webkit-transition: all 0.8s ease-out;
-moz-transition: all 0.8s ease-out;
transition: all 0.8s ease-out;
filter: alpha(opacity = 0);
filter: alpha(opacity = 0);
opacity:0;
}
<div id="bite">
<div id="thekey"><img src="{image:thekey}"></div>
<div class="death">
<div id="actualnews">
<a href="www.winngstiel.tumblr.com/tagged/mine" font-color:#9d3e78>MY STUFF</a>
<p>
<a href="www.winngstiel.tumblr.com/tagged/edit" font-color:#9d3e78>PRETTY THINGS</a>
</div>
</div></div>
I'm currently using a couple divs to style my background as well as style an overlay for hovering. The problem is that I'd like to create an additional div so that I can style a box on hover as well, but I'm not sure where to place the new div in the HTML without it screwing up my formatting (class .captionbox for example).
My code and JS Fiddle is below. Any help is appreciated.
JS Fiddle
body {
background: url('http://www.bootply.com/assets/example/bg_blueplane.jpg');
height:100%;
margin:0;
padding:0;
}
.bg {
position:fixed;
width:50%;
height:50%
}
#nw {
background-image: url('clevelandnight.jpg');
background-size:cover;
}
#ne {
top:0;
left:50%;
background-image: url('news1.jpg');
background-size:cover;
}
#sw {
top:50%;
left:0;
background-image: url('drinks1.jpg');
background-size:cover;
}
#se {
top:50%;
left:50%;
background-image: url('clevelandday.jpg');
background-size:cover;
}
.overlay {
height:100%;
text-align:center;
-webkit-transition:opacity .4s ease-out, height .4s ease-out, background .4s ease-out;
-moz-transition:opacity .4s ease-out, height .4s ease-out, background .4s ease-out;
-o-transition:opacity .4s ease-out, height .4s ease-out, background .4s ease-out;
-ms-transition:opacity .4s ease-out, height .4s ease-out, background .4s ease-out;
transition:opacity .4s ease-out, height .4s ease-out, background .4s ease-out;
}
.bg:hover .overlay {
background:rgba(0, 0, 0, .75);
opacity: 1;
height:100%;
}
.caption {
font-family: 'Open Sans Condensed', sans-serif;
font-weight:100;
color:white;
font-size:36pt;
white-space:nowrap;
-webkit-transition:font-size .4s ease-out 1s, color .4s ease-out 1s, margin-right .4s ease-out 1.4s;
-moz-transition:font-size .4s ease-out 1s, color .4s ease-out 1s, margin-right .4s ease-out 1.4s;
-o-transition:font-size .4s ease-out 1s, color .4s ease-out 1s, margin-right .4s ease-out 1.4s;
transition:font-size .4s ease-out 1s, color .4s ease-out 1s, margin-right .4s ease-out 1.4s;
}
.bg:hover .caption {
color:#7D7D7D;
font-size:72px;
white-space:nowrap;
margin-right:70%;
}
.captionbox {
height:100px;
width:100px;
background-color:white;
opacity:0;
border: 5px solid red;
}
<div id='nw' class='bg'>
<div class='overlay'>
<span class='caption'>Night Life</span>
</div>
</div>
<div id='ne' class='bg'>
<div class='overlay'>
<span class='caption'>News</span>
</div>
</div>
<div id='sw' class='bg'>
<div class='overlay'>
<span class='caption'>Food & Drink</span>
</div>
</div>
<div id='se' class='bg'>
<div class='overlay'>
<span class='caption'>Events</span>
</div>
</div>
If you make the div display:none it won't take up any space on the page. I presume as a caption box it's going to be position: absolute, so once that style is applied it won't affect your layout anyway. So you should be able to put it at the top level as a child of <body>.
I have 2 images that are changing when I hover on the first one.
On the second one, I have some text because I want a link there.
My problem is now that I want the hover image to remain when I hover over the link.
Here is my code:
#blur {
border: 1px solid #bebfc1;
position:relative;
height:450px;
width:300px;
margin:0 auto;
-webkit-transition: border 1s ease-in-out;
-moz-transition: border 1s ease-in-out;
-o-transition: border 1s ease-in-out;
transition: border 1s ease-in-out;
}
#blur img {
position:absolute;
left:0;
-webkit-transition: opacity 1s ease-in-out;
-moz-transition: opacity 1s ease-in-out;
-o-transition: opacity 1s ease-in-out;
transition: opacity 1s ease-in-out;
}
#blur:hover {
z-index:2;
border: 1px solid #000000;
}
#blur img.top:hover {
opacity:0;
}
#blur .text {
position:absolute;
color:#bebfc1;
opacity:0;
-webkit-transition: opacity 1s ease-in-out;
-moz-transition: opacity 1s ease-in-out;
-o-transition: opacity 1s ease-in-out;
transition: opacity 1s ease-in-out;
font-family:"Segoe UI Light";
font-size:13px;
}
#blur:hover .text {
opacity:1;
}
<div id="blur">
<img class="bottom" src="http://s28.postimg.org/do5izc4gd/image.png" />
<img class="top" src="http://s28.postimg.org/a5tj2y3kd/image.png" />
<p class="text" style="bottom:6px; left:180px;">link</p>
</div>
When I hover over the link I want the red image to remain the same.
How can this be done?
Thanks !!!
DEMO here http://jsfiddle.net/VYR9q/
Okay, I fixed it in the fiddle line you provided :)
Here you are what I fixed:
#blur:hover .top {
opacity:0;
}
Instead of:
#blur img.top:hover {
opacity:0;
}
Edit from: #biziclop:
You can make it:
#blur:hover img.top
I think you should simply move :hover from the img to the common parent #blur
#blur img.top:hover {
to
#blur:hover img.top {
Live example: http://jsfiddle.net/VYR9q/2/
Change your css to :
#blur:hover img.top {
//your css
}