HTML5 CSS (How to on hover image ignore transparent)
Tags: javascript,css,html5,canvas
Problem :
I have two images; one is on top of another:
HTML:
<img src='http://etc-mysitemyway.s3.amazonaws.com/icons/legacy-previews/icons-256/3d-transparent-glass-icons-media/001429-3d-transparent-glass-icon-media-a-media21-arrow-back.png' style='position: absolute; top: -50px; left: -70px'>
<img src='http://etc-mysitemyway.s3.amazonaws.com/icons/legacy-previews/icons-256/3d-transparent-glass-icons-transport-travel/036411-3d-transparent-glass-icon-transport-travel-anchor6-sc48.png' style='position: absolute; top: 20px; left: 20px'>
CSS:
img:hover {
background: blue;
}
I need mark triangle but marked anchor because mouse on anchor transparent place (how to ignore it..?)
Solution :
Firstly, move your styles out of inline- then you can set the z-index
of the triangle to be greater than that of the anchor, so it 'appears' on top, whilst using the :hover
selector specifically linked to the triangle (remove #triangle
if you want it to relate to both):
Demo Fiddle
#triangle {
position: absolute;
top: -50px;
left: -70px;
z-index:1;
}
#triangle:hover{
background:blue;
}
#anchor {
position: absolute;
top: 20px;
left: 20px;
z-index:0;
}
CSS Howto..
The standard practice is to set body class in respective path hooks: Router.map(function() { this.route('someRoute', { path: '/someAddress', onBeforeAction: function() { $('body').addClass('someRouteBodyClass'); this.next(); }, onStop: function() { $('body').removeClass('someRouteBodyClass'); }, ......
Your problem is overflow: hidden on two divs. Delete this from your CSS: .navbar { overflow: hidden; } .navbar-2nd { overflow: hidden; } CODEPEN...
maybe float can help you. div { float: right; margin: 0 0 15px 20px; border: 1px solid black; text-align: center; } img{ width: 180px; } <div> <img src="https://www.visiontravel.ca/wp-content/uploads/2015/07/sailing-ship-300x300.jpg"><br>CSS is fun!...
Just use animate() instead of css(): if (slideNumber == '0') { $('.nav').animate({ 'top': '30%' }); } else { $('.nav').animate({ 'top': '0' }); } DemoFiddle...
Replace # below with $2 if you want to get the URL with single quotes. var text = '#anything {behavior:url("csshover.htc");}'; //iam using " with url text += "#anything {background:transparent url('img.png')...
As @Spudley mentioned in the comment, you shouldn't use scale since that stretches the element by definition. Instead you can add more left/right paddings to make the element wider. A...
Here is your solution. Adjust to whatever you need it to be. http://jsfiddle.net/cornelas/eNp8F/16/ .box{ margin-left:auto; margin-right:auto; width:1000px; position:relative; margin-top:220px; z-index:999; height: 400px; } #content { /* Background color, gradients &...
Use the Sliding Door Principle. http://www.alistapart.com/articles/slidingdoors/. In sliding doors you have two extreme as images(rounded) between these images is a background. The images move (slide further) based on the length...
There was a study out where this was tested. I no longer have the link but, suffice to say, it slows things down for all the reasons you probably know...
Ahhh nevermind, the problem apparently lay in something completely irrelevant. There was a line in Web.config that essentially said to give a 404 error for all content in the Views...
With the given markup, javascript would not be even necessary for links inside #myDropdown: you could just use :focus pseudoclass like so #myDropdown a:focus + div { display: block; }...
I suggest using jQuery. Solution would look something like: // Catch scroll event $( window ).scroll(function() { // If user didn't scroll 1200px set default z-index if ($(this).scrollTop()<1200) { $("#logo"...
You're going to need my-link /deep/ .mylink Edit: Also, surround the <a> with a <template> element. Make sure your element is imported!...
Chrome Beta for Android supports getting FPS by setting flag in chrome://flags
Instead of appending the draggable to droppable, just replace it's entire content with the draggable like this: $(this).html(ui.draggable.clone(true).css({ position: 'relative', top: 'auto', left: 'auto' })); Instead of: $(ui.draggable).clone(true).detach().css({ position: 'relative',...
This is done through becoming more specific with your CSS. For the img CSS: #accordion ul li img { opacity:0; } To hover using CSS: #accordion div:hover { color:#FFF; }...
Add a bottom border to .mainnav .mainnav { border-bottom:1px solid #fff; } http://jsfiddle.net/ruUgk/1/...
The selectors in the external CSS file for JavaFX follow the same structural rules as for CSS in HTML. Basically: #name selects any node with the id name .name selects...
In order to use STATIC_URL in the template you need to be sure you are using a RequestContext along with adding 'django.core.context_processors.static' to TEMPLATE_CONTEXT_PROCESSORS. This is done for you if...
body { animation: fadein 0.5s forwards; /* use forwards to maintain the last keyframe state */ } header { opacity:0; /* You need this initial opacity */ animation: fadein 2s...
There is, theoretically, a way to create the type of distortion you need using SVG 1.1. It relies on the <feDisplacementMap> filter element. I include sample code below if you...
EDITED: put the links in an unordered list (ul) and assign display: inline-block to the li elements. Wrap the ul in a div to which you assign text-align: center;: <div...
concat.js is being included in the concat task's source files public/js/*.js. You could have a task that removes concat.js (if the file exists) before concatenating again, pass an array to...
Have a look at jQuery UI's Resizable.
You could create a master stylesheet that you include in every page, and within that css file you can use @import to include the others. This doesn't solve the problem...
try this <html lang="en"> <head> <style> html,body { height:100%; } #center { margin-right:auto; margin-left:auto; } #img { position:fixed; top:-50%; left:-50%; height:200%; width:200%; } #img img { position:absolute; top:0; left:0; right:0;...
Suggestions: Maybe you can play with the line-height CSS property, either on the <div> or its children. Try setting it to the same value as the font-size of your element,...
But there is the PHP that is confusing me. PHP is simply printing the $activelocation variable/string out to your output (HTML). The problem is that $activelocation could be anything....
You can put your SVG code in CSS like this: .icon { display:inline-block; width: 100px; height: 100px; background-image: url('data:image/svg+xml;utf8,<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100%" height="100%" viewBox="0 0 512 512"><path d="M192 232c0...
Try headerCellClass instead of cellClass. Like this $scope.gridOptions = { enableSorting: true, columnDefs: [ { field: 'name', headerCellClass: 'blue' }, { field: 'company', headerCellClass: function(grid, row, col, rowRenderIndex, colRenderIndex) {...