I just cant seem to fix this issue where on hover, the DIV expands and then shrinks giving a "jumpy" or "jitter" look. This only seems to happen in IE 11 and I cant pinpoint why.
I have a list which will be for images and I want the hover state to be a block that is 10px less than its parent;
Here is my fiddle:
Here is my code;
HTML
<div id="container">
<li class="item w2 h2"> <div class="inner"></div></li>
<li class="item w2 h2"> <div class="inner"></div></li>
<li class="item w2 h2"> <div class="inner"></div></li>
<li class="item w2 h2"> <div class="inner"></div></li>
<li class="item w2 h2"> <div class="inner"></div></li>
<li class="item w2 h2"> <div class="inner"></div></li>
</div>
CSS - the inner class is the one with the hover
#container {
padding: 5px;
margin: 0 auto;
border: 2px solid black;
}
.item {
display:block !important;
list-style:none;
float: left;
background: #CCC;
margin: 5px;
width: 50px;
height: 50px;
}
.item.w2 { width: 300px; }
.item.h2 { height: 200px; }
.inner {
background:#fff;
background: rgba(255, 255, 255, 1);
position: absolute;
top: 10px;
left: 10px;
bottom: 10px;
right: 10px;
margin:0;
padding:0;
text-align: center;
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
opacity: 0;
-webkit-transition: opacity .4s ease-in-out;
-moz-transition: opacity .4s ease-in-out;
-ms-transition: opacity .4s ease-in-out;
-o-transition: opacity .4s ease-in-out;
transition: opacity .4s ease-in-out;
}
.inner:hover {
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=95)";
filter: alpha(opacity=95);
opacity: .95;
z-index:1;
}
/* no transition on .isotope container */
.isotope .isotope-item {
/* change duration value to whatever you like */
-webkit-transition-duration: 1s;
-moz-transition-duration: 1s;
transition-duration: .6s;
}
.isotope .isotope-item {
-webkit-transition-property: -webkit-transform, opacity;
-moz-transition-property: -moz-transform, opacity;
transition-property: transform, opacity;
opacity:.5;
}
Consequently the "jumpy" or "jitter" disappears when there is no -transition such as ease-in-out or opacity.
I appreciate anyone who has a look! any suggestions would be great this is a huge learning curve for me :)
I created a simplified example of this problem:
http://jsfiddle.net/DqUvL/14/
I also reported the problem to MSFT:
https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/107987/
HTML:
<a class="bad" href="#">
<img src="http://placekitten.com/200/200" width="200" height="200" alt="cat">
<div class="detail">
<h2>Heading</h2>
<div class="margin">
Margin
</div>
<div class="clear"></div>
</div>
</a><a class="bad" href="#">
<div class="detail">
<h2>Heading</h2>
<div class="clear"></div>
</div>
</a>
CSS:
.bad {
display: block;
outline: 1px solid blue;
}
.clear {
clear: both;
}
.bad:hover {
outline-color: red;
}
img {
float:left;
}
h2 {
margin: 0;
}
.margin {
margin: 1em 0;
}
I worked around the problem by adding a container style="overflow:hidden" around the hover elements:
http://jsfiddle.net/DqUvL/16/
This solves the simplified problem.
Thanks #mohitp:
https://stackoverflow.com/a/12665222/973470
I tested with IE 10. Seems that your divs are too big, because they have position: absolute.
Therefore they are aligned to the container. Add this to your item class:
.item {
position: relative;
}
Absolute elements are aligned to the next parent that is not static. It might be that IE's default stylesheet differs from the other browsers when it comes to list elements position. Did not checked this yet.
Related
When I try to hover the image area, the colour of text gets rendered instead of the border.
How do i get the colour of the border to be rendered instead of the text colour when I hover on the image area.
just need to fill up the details that stackoverflow wants me to
.............................................................................................................................................................................................................................................
heres the codepen https://codepen.io/anon/pen/wVeYwv
someone help me plz
// CSS CODE
$primary: #e5594b;
.product {
border: 1px solid black;
}
.item{
transition: color 0.25s;
&::before,
&::after {
border: 2px solid transparent;
width: 0;
height: 0;
}
// This covers the top & right borders (expands right, then down)
&::before {
top: 0;
left: 0;
}
// And this the bottom & left borders (expands left, then up)
&::after {
bottom: 0;
right: 0;
}
&:hover {
color: $primary;
}
// Hover styles
&:hover::before,
&:hover::after {
width: 100%;
height: 100%;
}
&:hover::before {
border-top-color: $primary; // Make borders visible
border-right-color: $primary;
transition:
width 0.25s ease-out, // Width expands first
height 0.25s ease-out 0.25s; // And then height
}
&:hover::after {
border-bottom-color: $primary; // Make borders visible
border-left-color: $primary;
transition:
border-color 0s ease-out 0.5s, // Wait for ::before to finish before showing border
width 0.25s ease-out 0.5s, // And then exanding width
height 0.25s ease-out 0.75s; // And finally height
}
}
//HTML
<div class="item">
<div class="product">
<div class="box">
<a class="img-prod">
<img
class="img-fluid product-image"
<img src="https://colorlib.com/wp/wp-content/uploads/sites/2/store-free-template.jpg" alt="Product Item" class="img-fluid product-image">
</a>
<div class="text pt-3 px-3">
<h3>A5 Photo</h3>
<div class="d-flex">
<div class="pricing">
<p v-if="item.discounts.length != 0" class="price">
<span class="mr-2 price-dc">$2</span>
<span class="price-sale">$3</span>
</p>
</p>
</div>
</div>
</div>
</div>
</div>
</div>
I have updated you code. you have applied border to .product class so we have to hover that and remove hover from .item class.
$primary: #e5594b;
.product {
border: 1px solid black;
}
.product:hover {
border: 1px solid red;
}
.item{
transition: color 0.25s;
&::before,
&::after {
// Set border to invisible, so we don't see a 4px border on a 0x0 element before the transition starts
border: 2px solid transparent;
width: 0;
height: 0;
}
// This covers the top & right borders (expands right, then down)
&::before {
top: 0;
left: 0;
}
// And this the bottom & left borders (expands left, then up)
&::after {
bottom: 0;
right: 0;
}
// Hover styles
&:hover::before,
&:hover::after {
width: 100%;
height: 100%;
}
&:hover::before {
border-top-color: $primary; // Make borders visible
border-right-color: $primary;
transition:
width 0.25s ease-out, // Width expands first
height 0.25s ease-out 0.25s; // And then height
}
&:hover::after {
border-bottom-color: $primary; // Make borders visible
border-left-color: $primary;
transition:
border-color 0s ease-out 0.5s, // Wait for ::before to finish before showing border
width 0.25s ease-out 0.5s, // And then exanding width
height 0.25s ease-out 0.75s; // And finally height
}
}
<div class="item">
<div class="product">
<div class="box">
<a class="img-prod">
<img
class="img-fluid product-image"
<img src="https://colorlib.com/wp/wp-content/uploads/sites/2/store-free-template.jpg" alt="Product Item" class="img-fluid product-image">
</a>
<div class="text pt-3 px-3">
<h3>A5 Photo</h3>
<div class="d-flex">
<div class="pricing">
<p v-if="item.discounts.length != 0" class="price">
<span class="mr-2 price-dc">$2</span>
<span class="price-sale">$3</span>
</p>
</p>
</div>
</div>
</div>
</div>
</div>
</div>
I am trying to create an overlay that will cover an entire div/card. I have three cards that I want to rollover black when active. For some reason, I can't get the entire div to be selected.
HTML:
<div class="item ">
<div class="overlay">
<img src="http://placehold.it/600x350">
<h2>Title</h2>
<p> Text</p>
</div><div class="overlay"> </div>
</div>
and CSS:
.item {
padding: 0px 0;
margin: 1%;
border-radius: 2px;
flex: 1 250px;
height: auto;
text-align: center;
background: linear-gradient(0deg, #efefef, #ffffff);
}
.overlay {
position: relative;
background-color: rgba(0,0,0,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;
}
.overlay:hover {
opacity: 1;
background-color: rgba(0,0,0,1);
}
CODEPEN EXAMPLE
div.item has a certain size and shape. Style it as relative so that the next thing will work
Make div.overlay position:absolute - that will overlay it, but it has no size, so it will still be invisible.
Then, make div.overlay the full height of its parent (div.item).
When made visible (at :hover) it will be 100% height/width of .item, and will overlay it.
body {background-color: #C70025;}
img {width: 100%;}
#container {width:90%;margin:0 auto;display:flex;flex-wrap:wrap;
justify-content:space-between;}
.item {color:#000;padding:0px 0;margin:1%;border-radius:2px;flex:1 250px;height:auto;text-align:center;background:linear-gradient(0deg, #efefef, #ffffff);}
.item{position:relative;}
.overlay {
position:absolute;
top:0;left:0;right:0;bottom:0;
background-color: rgba(0,0,0,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;
}
.overlay:hover {
opacity: 1;
background-color: rgba(0,0,0,1);
}
<div id="container">
<div class="item ">
<img src="http://placehold.it/600x350">
<h2>Title</h2>
<p> Text</p>
<div class="overlay"> </div>
</div>
<div class="item">
<img src="http://placehold.it/600x350">
<h2> Title </h2>
<p>Text</p>
<div class="overlay"> </div>
</div>
<div class="item">
<img src="http://placehold.it/600x350">
<h2> Title </h2>
<p>Text</p>
<div class="overlay"> </div>
</div>
</div>
Okay so I have been doing some renovations to my website and I am trying to make it so on the home page you see several images and what I want to happen is that when you hover over the image it blurs and and text appears in the center of the image. I've been able to make the images blur but the thing is is that all the tutorials and Q&A on Forums that I've found use absolute positioning.
When I do that though I end up with all the images stacked on top of each other. I then put divs around each image and made the images relatively positioned. The result was the same. I checked my code in validators and it came out with no errors. I could really need some help.
Here is my current setup (the images are where I want them and they blur on hover)
https://jsfiddle.net/u9smc561/
Here is my HTML
<!-- title div -->
<div id="head">
<img src=http://www.mem3500films.minksfamily.com/pic/title.png alt="title" class="M35F">
</div>
<!-- menu bar line for anything bigger than 800px -->
<div class="menuBar line">
<img class='menu home' src=http://www.mem3500films.minksfamily.com/pic/home.png alt="Home" onclick="window.location='index.html';">
<img class="blank" src=http://www.mem3500films.minksfamily.com/pic/blank.png alt="b">
<img class='menu about' src=http://www.mem3500films.minksfamily.com/pic/about.jpg alt="About" onclick="window.location='About.html';">
<img class="blank" src=http://www.mem3500films.minksfamily.com/pic/blank.png alt="b">
<img class='menu comment' src=http://www.mem3500films.minksfamily.com/pic/comment.jpg alt="Comments" onclick="window.location='Comments.html';">
<img class="blank" src=http://www.mem3500films.minksfamily.com/pic/blank.png alt="b">
<img class='menu pic' src=http://www.mem3500films.minksfamily.com/pic/pic.png alt="Pictures" onclick="window.location='Pictures.html';">
<img class="blank" src=http://www.mem3500films.minksfamily.com/pic/blank.png alt="b">
<img class='menu active' src=http://www.mem3500films.minksfamily.com/pic/active.png alt="Activities" onclick="window.location='games.html';">
<img class="blank" src=http://www.mem3500films.minksfamily.com/pic/blank.png alt="b">
</div>
<!-- menu bar line for anything smaller than 800px -->
<div class="smenuBar" style="font-size: 2px;">
<nav>
<ul>
<li class="line">
<img class='menuPic menu' src=http://www.mem3500films.minksfamily.com/pic/mobileMenu.png alt="Menu">
<ul class="selector">
<li><img class='menu' src=http://www.mem3500films.minksfamily.com/pic/home.png alt="Home" onclick="window.location='index.html';"></li>
<li><img class='menu' src=http://www.mem3500films.minksfamily.com/pic/about.jpg alt="About" onclick="window.location='About.html';"></li>
<li><img class='menu' src=http://www.mem3500films.minksfamily.com/pic/comment.jpg alt="Comments" onclick="window.location='Comments.html';"></li>
<li><img class='menu' src=http://www.mem3500films.minksfamily.com/pic/pic.png alt="Pictures" onclick="window.location='Pictures.html';"></li>
<li><img class='menu' src=http://www.mem3500films.minksfamily.com/pic/active.png alt="Activities" onclick="window.location='games.html';"></li>
</ul>
</li>
<li class="close">
<img src=http://www.mem3500films.minksfamily.com/pic/close.png alt="Close" style="margin-top: 5px;">
</li>
</ul>
</nav>
</div>
<!-- Explanation area -->
<br>
<br>MEM 3500 Films is a collection of stop-motion animated videos.
<br>To learn more about MEM 3500 Films check out the About Page.
<br>Just click on the movie poster to go to that movies page where you can watch it.
<!-- main div section with the posters -->
<div style="margin-left:0%; margin-right:0%; width:100%; text-align:left;font-size: 25px">
<br>
<br>
<div class="left">
<img class="poster1" src=http://www.mem3500films.minksfamily.com/pic/tcb.png alt="The Coffee Break" />
<br>
<img class="poster1" src=http://www.mem3500films.minksfamily.com/pic/tvsr.png alt="tvsr" />
<br>
<img class="poster" src=http://www.mem3500films.minksfamily.com/pic/lt.james.png alt="Lt. James">
<br>
<img class="poster" src=http://www.mem3500films.minksfamily.com/pic/TRR.jpg alt="The robbers race">
<br>
<img class="poster" src=http://www.mem3500films.minksfamily.com/pic/TFP.jpg alt="The French Plane">
</div>
<div class="right">
<img class="poster1" src=http://www.mem3500films.minksfamily.com/pic/MKI6.png alt="MKI6" />
<br>
<img class="poster" src=http://www.mem3500films.minksfamily.com/pic/TPSPoster.png alt="tps">
<br>
<img class="poster1" src=http://www.mem3500films.minksfamily.com/pic/ag.jpg alt="The Air-to-Ground Attack">
<br>
<img class="poster" src=http://www.mem3500films.minksfamily.com/pic/tcp.jpg alt="The Counterfeiters">
<br>
<img class="poster" src=http://www.mem3500films.minksfamily.com/pic/mem3500films.jpg alt="mem 3500 films">
</div>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</div>
<!-- footer credits -->
<div style="width:100%; text-align:center; font-size: 25px;">
<br>
<footer style="">LEGO, the LEGO logo, and the Minifigure are trademarks and/or copyrights of the LEGO Group. I am not supported by LEGO or in any way is this website. Check out the LEGO website for more cool stuff. LEGO.com
<br>
<p style="margin: 0;">
<a href="http://jigsaw.w3.org/css-validator/check/referer">
<img style="border:0; width:88px; height:31px; margin: 10px;" src="http://jigsaw.w3.org/css-validator/images/vcss-blue" alt="Valid CSS!" />
</a>
</p>
</footer>
</div>
And my CSS
/* makes the stuff for the tall posters */
.poster {
-webkit-transition: -webkit-filter 0.4s;
-moz-transition: -webkit-filter 0.4s;
-ms-transition: -webkit-filter 0.4s;
-o-transition: -webkit-filter 0.4s;
transition: -webkit-filter 0.4s;
width: 100%;
border-radius: 15px;
max-width: 450px;
max-height: 601px;
}
.poster:hover{
-webkit-filter: blur(7px);
filter: blur(7px);
}
/* makes the stuff for the wide posters */
.poster1 {
-webkit-transition: -webkit-filter 0.3s;
-moz-transition: -webkit-filter 0.3s;
-ms-transition: -webkit-filter 0.3s;
-o-transition: -webkit-filter 0.3s;
transition: -webkit-filter 0.3s;
width: 100%;
border-radius: 15px;
max-width: 450px;
max-height: 260px;
}
.poster1:hover{
-webkit-filter: blur(7px);
filter: blur(7px);
}
/* the main div holders for the posters */
.left {
width: 49%;
display: inline-block;
margin-left: 1px;
text-align: right;
}
.right {
width: 49%;
display: inline-block;
margin-right: 0px;
text-align: left;
}
/* the menu bar stuff */
#media only screen
and (min-width : 801px) {
.menuBar {
display: block;
}
.smenuBar, .close{
display: none;
}
/* makes sure the buttons are not to big */
.home {
width: 10.1%;
max-width: 107px;
}
.about {
width: 11.1%;
max-width: 117px;
}
.comment {
width: 16.7%;
max-width: 173px;
}
.pic {
width: 16.8%;
max-width: 174px;
}
.active {
width: 16.1%;
max-width: 167px;
}
.blank {
width: 1%;
max-width: 3px;
max-height: 25px;
margin-top: 10px;
margin-bottom: 10px;
}
/* makes the hover effect for the menu buttons */
.menu {
cursor: pointer;
margin-top: 10px;
margin-bottom: 10px;
-webkit-transition: -webkit-filter 0.5s; /* Safari */
-moz-transition: -webkit-filter 0.5s;
-ms-transition: -webkit-filter 0.5s;
-o-transition: -webkit-filter 0.5s;
transition: -webkit-filter 0.5s;
}
.menu:hover {
cursor: pointer;
margin-top: 10px;
margin-bottom: 10px;
-webkit-filter: invert(1); /* Safari */
-moz-filter: invert(1);
-ms-filter: invert(1);
-o-filter: invert(1);
filter: invert(1);
}
}
/* end of computer menu bar config */
/* start of mobile menu config */
#media only screen
and (max-width : 800px) {
/* stuff to make sure the other menu doesn't show */
.menuBar {
display: none;
}
.smenuBar, .close {
display: block;
}
.menuPic {
width: 90%;
max-width: 143px;
}
/* stuff to make sure there isn't indenting */
li {
list-style-type: none;
padding: 0;
}
ul {
list-style-type: none;
padding: 0;
margin: 0;
}
/* drop down part of the menu stuff */
nav ul ul {
height: 0px;
overflow: hidden;
-webkit-transition: height 0.5s; /* Safari */
-moz-transition: height 0.5s;
-ms-transition: height 0.5s;
-o-transition: height 0.5s;
transition: height 0.5s;
}
nav ul .line:hover > ul {
height: 335px;
}
nav ul .line:active > ul {
height: 335px;
}
nav ul .line:hover + .close {
height: 52px;
}
nav ul .line:active + .cose {
height: 52px;
}
.close {
text-align: center;
background:rgba(0,0,0,0.8);
height: 0px;
overflow: hidden;
-webkit-transition: all 0.5s; /* Safari */
-moz-transition: all 0.5s;
-ms-transition: all 0.5s;
-o-transition: all 0.5s;
transition: all 0.5s;
}
/* makes the hover effect for the menu buttons */
.menu {
cursor: pointer;
margin-top: 10px;
margin-bottom: 10px;
-webkit-transition: -webkit-filter 0.5s; /* Safari */
-moz-transition: -webkit-filter 0.5s;
-ms-transition: -webkit-filter 0.5s;
-o-transition: -webkit-filter 0.5s;
transition: -webkit-filter 0.5s;
}
.menu:hover {
cursor: pointer;
margin-top: 10px;
margin-bottom: 10px;
-webkit-filter: invert(1); /* Safari */
-moz-filter: invert(1);
-ms-filter: invert(1);
-o-filter: invert(1);
filter: invert(1);
}
}
.selector {
width: 100%;
background-image:url('pic/wline.jpeg');
padding: 0;
}
/* end of menu config */
/* sets the body properties */
body {
background-image:url('http://www.mem3500films.minksfamily.com/pic/lego.jpeg');
background-color: #ffd700;
text-align:center;
font-size: 25px;
}
/* the title attributes */
body{margin:0;padding:0}
#head {
background-image:url('http://www.mem3500films.minksfamily.com/pic/lego1.jpeg');
background-repeat:repeat;
width: 100%;
}
/*the menu line div attributes */
body{margin:0;padding:0}
.line {
background-image:url('http://www.mem3500films.minksfamily.com/pic/line.jpeg');
background-repeat:repeat;
width: 100%;
}
/* makes sure that the website title is not to big */
.M35F {
width: 100%;
max-width: 905px;
margin-top: 20px;
margin-bottom: 20px;
}
/* makes sure links never get underlined */
a {
text-decoration:none;
}
/* gives the footer a background image */
footer {
background-image:url('pic/white.jpeg');
background-repeat:repeat;
text-align: left;
background-color: #FFFFFF;
color: #888888;
font-size: 25px;
}
In my current setup I have it so the images resize with the window then stop getting bigger at a certain size. This works fine now and I want it to be able to do this in the end.
But I have tried SOOOO many things to get this to work and spent hours (literally) but no matter what I've done it doesn't seem to work. Is what I am shooting for not even possible with CSS and HTML?
Remember an important concept. Absolute positioned elements are positioned relatively the first ANCESTOR that has positon different from "static"
Thus, to position your "strings" you need to
wrap the images in a div
make that div "position: relative"
put the text in a div or a span or other container
make the container "position: abolute"
This way you should not have problem with images staing one over another.
.poster p {
position:relative;
top:50%;
transform:translateY(-50%);
}
This will position itself in the vertical center.
add the following to .poster:
text-align:center;
I have created a video player controls but I want to know how can I make it responsive as to make only the scrubber move but the play button or volume button to stay in the same place and keep the same distance?
CSS
#videoControls{
height:8%;
top:92%;
width:100%;
background-color:#d92a2e;
background-color: rgba(0,0,0,0.4);
position:relative;
-webkit-transition: top .5s ease-in;
-moz-transition: top .5s ease-in;
-ms-transition: top .5s ease-in;
-o-transition: top .5s ease-in;
transition: top .5s ease-in;
}
[class^="col-"] ,[class*= " col-"]{
position: relative;
top: 50%;
float: left;
}
.col-80{
width: 80%;
}
.col-7-5{
width: 32px;
padding-left: 10px;
padding-right: 10px;
text-align: center;
}
.col-7-6{
width: 7.5%;
}
.col-5{
width: 5%;
}
HTML
<div class='controls' id='videoControls'>
<div class='col-5'>
<div class='btnGrp'>
<div id='play' class='playBtn'></div>
<div id='pause' class='pauseBtn'></div>
</div>
</div>
<div class='col-80'>
<div id='scrubber'>
<div id='track'></div>
<div id='handle' class='draggable'></div>
<div id='handle2' class=''></div>
</div>
</div>
<div class='col-7-5'>
<div class='btnGrp'>
<div id='mute' class='muteBtn'></div>
<div id='unmute' class='unmuteBtn'></div>
</div>
</div>
<div class='col-7-6'>
<div id='timeDisplay'>
<span id='currentTime'></span>
/
<span id='duration'></span>
</div>
</div>
</div>
I have created the Responsive design if you have multiple div when you re-size the browser?
Following is my html structure:
<div id="div-wrap">
<div class="column-1-7"> ... </div>
<div class="column-2-7"> ... </div>
<div class="column-3-7"> ... </div>
</div>
Below is my css structure:
#div-wrap {
white-space: nowrap;
max-width: 100%;
}
.column-1-7,.column-2-7,.column-3-7 {
width: calc(100% / 3);
display: inline-block;
text-align: center;
}
.column-1-7{
background: #ffcc00;
}
.column-2-7{
background: #ffff00;
}
.column-3-7{
background: #ffccff;
}
I want my website to have the same effect this website has: Trask Industries
When the upper right image is hovered the text appears and yellow covers the image.
This is the effect I am failing to recreate in CSS and Html, using headers and hover opacity. In my attempts the headers become opaque rather than standing out like on that site. I also don't know how to make the headers appear and disappear on hover.
Here is the jsfiddle of my attempt.
.content1:hover, .content2:hover, .content3:hover, .content4:hover, .content5:hover, .content6:hover {
color: black;
opacity: 0.30;
transition: .2s;
webkit-transition: .2s;
-webkit-transition: all 500ms ease;
}
You must wrap the h1 and h2 in a div, and you would animate that div in css.
I also added a same class for the contents.
Here is an updated fiddle:
http://jsfiddle.net/bzm6T/2/
Basically, this is the updated code:
Code:
.contents:hover > div {
color: black;
opacity: 1;
}
.contents div {
opacity: 0;
display: block;
width: 100%; height: 100%;
background: rgba(255,255,255,0.3);
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-ms-transition: all 1s ease;
-o-transition: all 1s ease;
transition: all 1s ease;
}
<div class="container">
<a href="articleF.html" class="contents content1">
<div>
<h1>The Low Stakes of Modern life</h1>
<h2>Default 1Default 1Default 1Default 1Default 1Default 1</h2>
</div>
</a>
<a href="articleA1.html" class="contents content2">
<div>
<h1>AARON SWARTZ</h1>
<h2>Cats Can Puuuuur</h2>
</div>
</a>
<a href="articleA2.html" class="contents content3">
<div>
<h1>JOBILLY BOOP</h1>
<h2>Cats Can Puuuuur</h2>
</div>
</a>
<a href="articleD.html" class="contents content4">
<div>
<h1>Content4</h1>
<h2>Cats Can Puuuuur</h2>
</div>
</a>
<a href="articleK1.html" class="contents content5">
<div>
<h1>Content5</h1>
<h2>Cats Can Puuuuur</h2>
</div>
</a>
<a href="articleK1.html" class="contents Content6">
<div>
<h1>Content6</h1>
<h2>Cats Can Puuuuur</h2>
</div>
</a>
</div>
A slightly different approach, but basically the same with CSS transition: FIDDLE
.holder {
width: auto;
margin: 10px auto;
border: 1px solid black;
overflow: hidden;
}
.leftdiv {
float: left;
background-color: blue;
height: 100%;
color: white;
}
.picdiv {
float: right;
background-color: orange;
}
.picdiv img {
opacity: 1;
transition: opacity 1s ease-in-out;
}
.picdiv img:hover {
opacity: 0;
}