how to map an image when its appear on hover - html

i m using a hover effect to change the images.when i hover on the first image it shows the another image which hasfew names which i want to link but coz this image is not visible in dreamweaver so i m unable to map it.
Here is the CSS for this:
div#content .promo{
display:block;
position:relative;
width:170px;
height:170px;
/* border:1px solid #f00;*/
float:left;
margin:10px;
/* border-radius:100px;*/
}
#content .promo .mask {
height: 100%;
width: 100%;
left: 0;
top: 0;
opacity: 1.0;
position: absolute;
transition: opacity 0.45s ease-in 0s;
z-index: 1;
background-color:#FFFFFF;
/* border-radius:100px;*/
}
#content .promo:hover .mask {
opacity: 0;
filter:alpha(opacity=0);
}
Here is the code for image in div:
<div id="content">
<div class="promo">
<img src="http://pearlacademy.com/wp-content/uploads/2013/02/Circles-back-01.png" />
<div class="mask">
<img src="http://pearlacademy.com/wp-content/uploads/2013/02/style.png"/>
</div>
</div>
</div>

There you go...
HTML
<div class="map">
<img src="http://pearlacademy.com/wp-content/uploads/2013/02/Circles-back-01.png" alt="Pearl" />
</div>
CSS
.map {position: relative;}
.link {position: absolute; width: 150px; height: 40px;}
.link.link1 {top: 20px; left: 10px;}
.link.link2 {top: 60px; left: 10px;}
.link.link3 {top: 100px; left: 10px; height: 50px;}
Fiddle: http://jsfiddle.net/praveenscience/6uwRP/
Do you want something like this?
HTML
<div class="promo">
<img src="http://pearlacademy.com/wp-content/uploads/2013/02/Circles-back-01.png" />
<img src="http://pearlacademy.com/wp-content/uploads/2013/02/style.png" class="hover" />
</div>
CSS
.promo img.hover,
.promo:hover img {display: none;}
.promo:hover img.hover {display: inline;}
Fiddle: http://jsfiddle.net/praveenscience/dYExh/

Related

Changing 1 image to slide into many images when hovering

<div class ="tc-container">
<img src ="2.jpg" alt=""/>
<img style ="margin-top:342px;margin-left: 52px;"class ="top-img" src="3.jpg" alt=""/>
</div>
**CSS:**
/*image hover*/
.tc-container{
width:500px;
height:800px;
padding-right: 1800px;
}
.tc-container img{
width: 700px;
height: 500px;
}
.top-img{
position:absolute;
left:0;
top:0;
opacity: 0;
transition:all 0.7s ease;
}
.top-img:hover{
opacity:1;
}
I want to hover 1 image and can slide it into 4-5 images. That's what I am trying to do thank you for answering my question
Something like this you mean?
.tc-container {
position: relative;
height: 100px;
width: 100px;
--horizontal-spacing: 105px;
}
.tc-container img {
position: absolute;
left: 0;
top: 0;
z-index: -1;
transition: left 0.2s ease-in;
}
.tc-container:hover #img1 {
left: calc(3 * var(--horizontal-spacing));
}
.tc-container:hover #img2 {
left: calc(2 * var(--horizontal-spacing));
}
.tc-container:hover #img3 {
left: calc(1 * var(--horizontal-spacing));
}
<div class="tc-container">
<img id="img1" class="img" src="https://picsum.photos/id/1022/100">
<img id="img2" class="img" src="https://picsum.photos/id/1012/100">
<img id="img3" class="img" src="https://picsum.photos/id/1015/100">
<img id="img4" class="img" src="https://picsum.photos/id/102/100">
</div>

Transition delay css for multiple images

I'm trying to add a transition-delay to the CSS but everywhere I add it is ineffective.
My CSS is:
.imageBox {
position: relative;
float: left;
transition-delay: 3s;
}
.imageBox .hoverImg {
position: absolute;
left: 0;
top: 0;
display: none;
}
.imageBox:hover .hoverImg {
display: block;
}
My HTML is:
<div style="float:left">
<div class="imageBox">
<img src="https://cdn.discordapp.com/attachments/732623682576580719/1010327699098714282/unknown.png" height="300px" width="300px">
<div class="hoverImg">
<img src="https://cdn.discordapp.com/attachments/732623682576580719/1011368277613760583/Me_Purple.png">
</div>
</div>
</div>
Where should my transition delay and ease go? Thank you!
Transition property doesn't work on "display".
Try this:
.imageBox {
position: relative;
float: left;
}
.imageBox .hoverImg {
position: absolute;
left: 0;
top: 0;
opacity:0;
transition:1s;
transition-delay: 3s;
}
.imageBox:hover .hoverImg {
opacity:1;
}
This doesn't make the div disappear, but rather invisible. It won't work in every scenario, but it should here.

I have some issue about hover and transition effect

When i testing the Hover effect and also the transition effect but it doesn't working. I can not find any problem. Please Help me. What should i do now.
What is the problem??
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<div class="test">
<h1>This is header</h1>
<div class="images"><img src="img/them.jpg" alt="" /></div>
</div>
</div>
</body>
</html>
Css
.container{
width:900px;
margin: 0 auto;
}
.test{}
.test h1{
font-size:30px;
position:relative;
}
.images {
width: 258px;
position:absolute;
right:100px;
transition:.5s;
}
.images img{
width:100%;
}
.test h1:hover .images {
left:0px;
}
I believe you are missing a sibling selector:
.test a:hover ~ .images {
display: none;
}
Snippets:
.container {
width: 900px;
margin: 0 auto;
}
.test {}
.test h1 {
font-size: 30px;
position: relative;
}
.images {
width: 258px;
position: absolute;
right: 100px;
opacity: 1;
transition: opacity .5s;
}
.images img {
width: 100%;
}
.test a:hover~.images {
opacity: 0;
}
<div class="container">
<div class="test">
<a href="#">
<h1>This is header</h1>
</a>
<div class="images">
<img src="http://via.placeholder.com/350x150" alt="" />
</div>
</div>
</div>
If you want to apply transition on left:
.container {
width: 900px;
margin: 0 auto;
}
.test {}
.test h1 {
font-size: 30px;
position: relative;
}
.images {
width: 258px;
position: absolute;
right: 100px;
left: calc(100% - 358px);
opacity: 1;
transition: left .5s;
}
.images img {
width: 100%;
}
.test a:hover~.images {
left: 0px;
}
<div class="container">
<div class="test">
<a href="#">
<h1>This is header</h1>
</a>
<div class="images">
<img src="http://via.placeholder.com/350x150" alt="" />
</div>
</div>
</div>
Docs:
transition - CSS: Cascading Style Sheets | MDN
General sibling combinator | MDN
Your HTML doesn't match the rule you wrote:
.test h1:hover .images {
display:none;
}
There are a couple things you might be trying to do:
.test a:hover + .images {
display:none;
}
That will hide .images when you hover the h1. However, since your h1 is inside of an <a> you'll need to either remove that or put a class on the <a> and reference that instead of the h1. Or you can move the images div inside of the h1 and it will match the existing rule.

Firefox not displaying header correctly

I have a question regarding my previous post:
Animation stop with css3
The slider works perfect in Chrome. In firefox however it is not working properly. Does anyone here have an idea?
Slider can be found here http://jimmytenbrink.nl/slider/
It looks like there is a problem in firefox with positioning absolute + display: table-cell.
My code is as follows:
<header>
<div>
<img src="./images/ironman.png">
<span>Ironman</span>
</div>
<div>
<img src="./images/ironman.png">
<span>Ironman</span>
</div>
<div>
<img src="./images/ironman.png">
<span>Ironman</span>
</div>
<div>
<img src="./images/ironman.png">
<span>Ironman</span>
</div>
<div >
<img src="./images/ironman.png">
<span>Ironman</span>
</div>
<div>
<img src="./images/ironman.png">
<span>Ironman</span>
</div>
<div>
<img src="./images/ironman.png">
<span>Ironman</span>
</div>
<div>
<img src="./images/ironman.png">
<span>Ironman</span>
</div>
</header>
And the css;
header {
margin-top: 10px;
width: 1185px;
display: table;
overflow: hidden;
background-color: #000;
height: 500px;
}
header > div {
background: url('./images/iron_man_bg.jpg');
width: 123.8px;
height: 500px;
position: relative;
-webkit-transition: width .3s;
transition: width .3s;
display: table-cell;
border: 2px solid #fff;
overflow: hidden;
}
header div:first-child {
margin-left: 0px;
}
header div:last-child{
margin-right: 0px;
}
header div:hover span {
left: 50px;
opacity: 1;
}
header > div img {
position: absolute;
left: -240px;
-webkit-transition: all .3s;
transition: all .3s;
-webkit-filter: grayscale(1);
overflow:hidden;
}
header > div span {
-webkit-transition: left .3s;
transition: left .3s;
position: absolute;
bottom: 30px;
color: white;
left: -70px;
opacity: 0;
width: 151px;
font-family: 'Fugaz One', cursive;
text-transform: uppercase;
color: #fff;
font-size: 24px;
text-shadow: 0px 0px 10px #f1f1f1;
filter: dropshadow(color=#f1f1f1, offx=0, offy=0);
}
header > div:hover {
width: 920px;
}
header div:hover img {
left: 0px;
-webkit-filter: grayscale(0);
}
Here is what works:
http://codepen.io/jeremyzahner/full/cAEbv
Basically, i added a new container inside the "div" with class .inside. On that i do width:100%; height:100; position:relative; overflow:hidden;. Plus, i did remove the fixed height on the outer divs, since the header already holds that fixed height, it is not necessary to set it again.
It is a knonw "bug" of firefox that it treats display:table-cell; divs like that. I don't think they will fix it soon. So the best workaround (at least in my experience) is another inner wrapper like here.
CSS Modification:
header > div .inside {
position:relative;
width:100%;
height:100%;
overflow:hidden;
}
header > div {
background: url('./images/iron_man_bg.jpg');
width: 123.8px;
position: relative;
-webkit-transition: width .3s;
transition: width .3s;
display: table-cell;
border: 2px solid #fff;
overflow: hidden;
}
HTML Modification:
<div>
<div class="inside">
<img src="./images/ironman.png">
<span>Ironman</span>
</div>
</div>
This was tested in actual version of Chrome and Firefox (on Ubuntu).
Hope this helps

Thumbnail rollover with text

I'm using the following CSS code to do a rollover effect with text:
.thumb {
position:relative;
}
.thumb img:hover {
filter:alpha(opacity=0);
-moz-opacity:0;
-khtml-opacity:0;
opacity:0;
}
.thumb:hover {
background:#f00;
}
.thumb span {
z-index:-10;
position:absolute;
top:10px;
left:10px;
}
.thumb:hover span {
z-index:10;
color:#fff;
}
HTML code:
<div class="thumb">
<img src="thumbnail.jpg" />
<span>Text</span>
</div>
Everything is working well except when I hover over the text: the rollover effect disappears and I can see the image again.
Any ideas?
Thanks in advance
I guess that is too much of styles for simple overlay effect, if you are interested to see a demo I've made from scratch than here you go
Demo
HTML
<div class="wrap">
<img src="http://images.google.com/intl/en_ALL/images/logos/images_logo_lg.gif" />
<div class="overlay">Hello This Is So Simple</div>
</div>
CSS
.wrap {
position: relative;
display: inline-block;
}
.overlay {
opacity: 0;
background: rgba(0,0,0,.8);
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
transition: opacity 1s;
color: #fff;
text-align: center;
}
.wrap:hover .overlay {
opacity: 1;
}