Hover on “everything but” aka “spotlight” effect: how to make smooth & easy hover transitions?
Tags: css,css3,hover
Problem :
Chris Coyier once posted an article on CSS-Tricks website on how to achieve this effect:
ul:hover li:not(:hover) { opacity: .5; }
But what I'm also trying to achieve is smooth and easy hover transitions. I'm just not sure how or where to insert the "smooth hover transition" part of the code.
a {
color: #cccccc;
-webkit-transition: color .5s linear;
-moz-transition: color .5s linear;
-ms-transition: color .5s linear;
-o-transition: color .5s linear;
transition: color .5s linear;
}
a:hover { color: #000000; }
Please help.
Solution :
You can select a
like this ul:hover li:not(:hover) a
ul {
list-style-type: none;
}
li a {
transition: all 0.4s linear;
text-decoration: none;
color: black;
font-size: 20px;
}
ul:hover li:not(:hover) a {
color: lightblue;
}
<ul>
<li><a href="">Lorem ipsum dolor.</a></li>
<li><a href="">Lorem ipsum dolor.</a></li>
<li><a href="">Lorem ipsum dolor.</a></li>
<li><a href="">Lorem ipsum dolor.</a></li>
<li><a href="">Lorem ipsum dolor.</a></li>
</ul>
CSS Howto..
Negative margin on the headings. See on jsFiddle: http://jsfiddle.net/f2cdJ/ CSS div { background: red; padding:10px; width:200px; } p { background: green; } h2 { margin: 0 -10px; background: blue; }...
If you want to hide the header of the outer table: #userList thead { display: none; } If you want to hide all of the headers of the inner table:...
See this answer. It's not jQuery but, in Firefox, Opera and Safari you can use window.getComputedStyle(element) to get the computed styles for an element and in IE you can use...
According to the jQuery documentation the hidden selector can return true for any of the following cases They have a CSS display value of none. They are form elements with...
To position both elements side to side try this: .map-container{ width: calc(100% - 100px); height:100%; position:absolute; left:100px; } .map-sidebar{ position:absolute; background-color: rgba(8,8,8, 1.1); width:100px; left:0; top:0; height:100%; -webkit-box-shadow: 3px 1px...
Good example of CSS hovers. Refer to the zoom & pan section: "Zoom and Pan" Check this and this link /*GROW*/ .grow img { height: 300px; width: 300px; -webkit-transition: all...
You should check, if the module is loaded correctly. The easiest way is by using the browser's console and run the following command: mw.loader.getState("ext.FinancialMathematics"); You will get a state, on...
<html> <head> <style type="text/css"> @-moz-document url-prefix() { h1 { color: red; } } </style> </head> <body> <h1>This should be red in FF</h1> </body> </html> All 3 browsers <style type='text/css'> /*This...
Nowadays CSS becoming more powerful than JavaScript.With help of Media Query u can specify conditions thus breaking up your Css Structure.Also there are lots of directive tags starting with '@',...
If you don't care about IE6 support you could do table tr td:first-child { display: none; } Though I'm unsure if that would hide the first one only, or the...
html <p class="mybutton">Google</p> css .mybutton { background: #2d3f51; color: #f5f5f5; display: flex; align-items: center; height: 30px; width: 100px; padding: 0 5px; } .mybutton:before { content: ''; background: url('http://cdn4.iconfinder.com/data/icons/socialmediaicons_v120/48/google.png'); background-size:...
I wouldn't use browser sniffing at all, but CSS 3 Media Queries to find out if "Interface B" fits and load it's content with AJAX only if it's displayed. Something...
If you want to set the background-position on both #body and .flash-bg, this will work: $('#body, .flash-bg').css("background-position",current+"px 0"); Also, in your setInterval, you can pass a reference to the function...
all your page's content should go inside the <body>. your <header> and <footer> are both outside the <body>. <!DOCTYPE html> <html> <head> <title> CDD Research: Donate Now </title> <meta name="viewport"...
The ::content pseudo-element is being replaced in future implementations of Web Components / Shadow DOM with the ::slotted. Likewise, the element targeted by this pseudo-element has changed from <content to...
For the expansion, you can add the CSS transition property like so: #element_id { transition: all 1s ease } The all refers to the properties that will be affected by...
Those are not fb elements, they are like and comment elements in the fb XML namespace. The W3C way to do all this is to declare the namespace in your...
You can set fixed width on #line1 and add white-space: nowrap and overflow-x: auto #container { display: inline-block; } #line1 { background: lightblue; width: 70px; white-space: nowrap; overflow-x: auto; }...
You'll want to set a line height or height : .active { line-height: 20px; height: 20px; font-size: 16px; color: #ff4e50; border-bottom: 5px solid #ff4e50; } I've updated the demo with...
You should have the a elements styled to inline-block and not the img. The img should be display: block. I think that should do it. #logo a { display: inline-block;...
You are looking for Single Page Applications (SPA). The page does not reload at any point in the process, nor does control transfer to another page, although the location hash...