Hover img to show an absolutely positioned div isn't working
Tags: html,css
Problem :
I'm trying to display absolutely positioned div #menu
, default state top: -9999px; left: -9999px
after a user hover over the image (so it should be like top: 100px; left: 20px
).
But it's not working for me this way.
Take a look at my JSFiddle, maybe there is some mistake:
Here is my Css :
#menu{
height: 350px;
width: 280px;
position: absolute;
left: -9999px;
top: -9999px;
background-color: lightblue;
}
How can i fix this ?
Solution :
Here is something that will help you get what you need:
DIV
<div class="menu">
hi
</div>
CSS
.menu {
margin: 10px;
width: 50px;
height: 50px;
background-color: #06F;
color: #fff;
position: absolute;
left: 10px;
top: 0;
}
.menu:hover {
position: absolute;
left: 0;
top: 0;
}
CSS Howto..
Here's an example with a +/- button, no images. All text and CSS. http://jsbin.com/ikeca ...
You only need to add two lines of CSS Example fiddle CSS .flexnav{ -webkit-padding-start: 0px; -webkit-margin-before: 0px; -webkit-margin-after: 0px; margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; width:90%; position: relative;...
Just prefix the CSS rules Player.tpl.html : <div class="player"> whatever </div> CSS .player .someclass { } .player .some-other-class { } ...
I have updated your code for you with the necessary corrections. Here is a JSFiddle file for your review: http://jsfiddle.net/yv7vs/ HTML: <html> <head> <title>CSS Layout</title> <link href="layout.css" rel="stylesheet" type="text/css" />...
Use CSS: vertical-align: top. See the vertical align spec. Demo: http://jsfiddle.net/qc1st2t9/1/...
The stylesheet will be loaded using wp_register_style probably in the functions.php
You have to work with the CSS attributes position, top, bottom, left, right and height. E.g. <div style="position:absolute; left:0; right:0; top:0; bottom:0"> <div style="position:absolute; left:0; right:0; top:0; height:42px; background:green">div1</div> <div...
Flot has issues with plotting graphs in containers that are set to display:none. So, you can either delay calling $.plot until the container is visible, or you can use negative...
Write like this: .dashbord .active:after{ content:''; position:absolute; right:-11px; top:3px; z-index:-1; width:22px; height:22px; background:green; -moz-transform:rotate(45deg); -webkit-transform:rotate(45deg); transform:rotate(45deg); box-shadow:-3px 0 0 0 rgba(153,40,19,1) inset; background: -moz-linear-gradient(left...
You can't in divs by default (with straight css anyway). You have to set the containing div as a table-cell and vertical align it middle like so: .ios-image-box { display:...
The others are right that your question is off-topic without a code snippet, but I'll throw some info up since you're new. Your header/menu element (.header_wrap xe-clearfix menu_type_1) is positioned...
In your css, you've used display: inline-block; and float: left; together. That is not necessary. They kind of have similar effect. Removing float: left solves the problem... .fourth_section .col {...
You can request the existing .css file using XMLHttpRequest() or fetch() instead of loading the file at html, append the new style rule to the .css file at XMLHttpRequest.responseText or...
Using a span was the correct choice but you should set it to inline or inline-block (or leave it alone altogether). As you found out, setting it to block made...
Wrap the text within a span tag and then apply the style vertical-align: middle to both the button and span HTML <button type="reset" id="reset-btn"><span id="reset-text">Reset</span></button> CSS button#reset-btn:after{ content:" <<"; font-size:2em;...
Instead of using top, try using bottom:100%. You can use margin-top to fine-tune this alignment, say by a few pixels.
If you want the links for background-image, then you can use this RegExp. background-image.*?url\((.*?)\) Example implementation: $html = <<<EOT <div id="plugin-title" class="with-banner"> <div class="vignette"></div> <style type="text/css"> #plugin-title { width:772px; height:250px;...
Check this. http://jsfiddle.net/e7e1bhdd/ Dont forget to use clear: both; after floating...
When using position: absolute, you need to make sure that it has a parent with a position attribute other than the default (which is static). If there is no such...
.spoiler, .spoiler2{ color: black; background-color:black; } .spoiler:hover{ color: white; } .spoiler2:hover { background-color:white; } <span class="spoiler" >test</span> <p>Then when hovered over</p> <span class="spoiler2"> other test </span> ...
HTML: <div id="something">... content ...</div> CSS: #something { position: absolute; height: 200px; width: 400px; margin: -100px 0 0 -200px; top: 50%; left: 50%; } ...
Add cellpadding="0" and cellspacing="0" to your table: <table id="jobtabelle" cellpadding="0" cellspacing="0"> or in CSS: Set cellpadding and cellspacing in CSS? Demo: #jobtabelle tr { height: 56px; line-height: 56px; border-top: 0;...
Change this part: html,body{ margin:0px; To: html,body{ margin:0px auto; Screenshot Quirks Mode Issue By default, the site goes in quirks mode. So, can you please add this to the first...
Change your #testform input.checked to #testform input.valid. I got this by submitting the form and check the class with developer tools or firebug. I saw the class name changed to...
Try this (http://jsfiddle.net/BYEw5/): <div class="container"> <div>A</div><div>B</div><div>C</div> </div> .container > div { display: inline-block; display: -moz-inline-box; *display: inline; /* For IE7 */ zoom: 1; /* Trigger hasLayout */ width: 33%; text-align:...
p:after { content: none; } None is the official value to set the content, if specified, to nothing. http://www.w3schools.com/cssref/pr_gen_content.asp...
I guess the question here is to show the division below the row containing the parent division. If height of the parent elements is same then what you can do...
Is this good for you ? http://jsfiddle.net/0cmwhafq/2/ I just set all positions to relative, and used float:left, for your menu and content container div#banner_container{ position: relative; width: 99%; height: 75px;...
UPDATED: (based on the further request of the OP in the comment section) try this: $(document).on('scroll',function(){ if($(document).scrollTop()>=$('#about').offset().top && $(document).scrollTop()<$('#work').offset().top){ //assuming the about section has an id called about (#about)...
If you look at some of the examples you can see they are linking css and js files <link href="http://code.ionicframework.com/1.0.0-beta.6/css/ionic.css" rel="stylesheet"> <script src="http://code.ionicframework.com/1.0.0-beta.6/js/ionic.bundle.js"> That would be the bext option. If...