How to display (
Tags: html,css,z-index
Problem :
I am using a ul & li a bit like a select dropdown to trigger a JS function (not shown).
It's working fine - except the menu items appear BEHIND divs that are shown below them.
I've mocked up the problem here: http://jsfiddle.net/bf8ugef7/1/
I'm fiddling with z-index and position:absolute but can't see how to make it work.
Can anyone help?
Here is the HTML and CSS:
body {
font-family: sans-serif;
color: gray;
font-weight: 100;
}
div, li {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
}
li {
color: #333333;
text-decoration: none;
/* background-image: url("images/mullion.gif"); */
}
div.images {
border: 1px solid #555555;
/* padding-left: 5px; */
width: 100%;
float: left;
clear: left;
margin-bottom: 20px;
/*
background-image: url("images/iMullion.gif");
background-repeat: no-repeat;
*/
}
div.lowerText {
width: 100%;
}
div.btn {/* +filter */
float: right;
width: 195px;
cursor: default;
text-align: right;
/* margin-left: 1px; */
display: inline-block;
}
div.btn1 {
float: left;
width: 153px;
cursor: default;
text-align: center;
margin-left: 1px;
display: inline-block;
position: absolute;
color: black;
background-color: #79c1ee;
left: 182px;
}
div.btn2 {
float: left;
width: 20px;
display: inline-block;
color: white;
font-weight: 100;
text-align: center;
background-color: white;
cursor: default;
position: absolute;
left: 162px;
z-index: 100;
}
div.btn2 ul {
list-style: none;
position: absolute;
display: block;
margin: 0px;
padding: 0px;
z-index: 100;
}
div.btn2 ul li {
display: none;
cursor: pointer;
color: white;
height: 25px;
background-color: #79c1ee;
margin-top: 1px;
z-index: 100;
}
div.btn2 ul li:first-child {
margin-top: 0px;
display: inline-block;
width: 20px;
z-index: 100;
}
div.btn2 ul:hover {
height: 200px;
}
div.btn2 ul:hover li {
display: block;
z-index: 100;
}
div.btn2 ul li:hover {
background-color: #13A3E2;
z-index: 100;
}
/*
div.btn2 ul li:hover {
display: block;
width: 20px;
height: 100px;
}
*/
div.btn3 {
margin-left: 1px;
float: left;
width: 20px;
display: inline-block;
vertical-align: top;
text-align: center;
font-weight: 400;
color: white;
background-color: #13A3E2;
position: absolute;
left: 336px;
cursor: pointer;
}
div.btn3:hover {
background-color: red;
}
div.btn4 {
/* border: 1px solid black; */
padding-left: 5px;
float: left;
width: 153px;
display: inline-block;
color: #444444;
cursor: default;
background-color: white;
}
div.attr {
padding-left: 5px;
color: #444444;
background-color: #79C1ED;
float: right;
clear: none;
display: inline-block;
text-align: left;
}
div.filters {
width: 100%;
line-height: 1.8;
overflow: hidden;
display: block;
font-size: 14px;
text-decoration: none;
float: left;
}
div.toptext {
line-height: 2.2;
display: block;
max-height: 35px;
color: #444444;
background-color: #555555;/* matches border color */
color: white;
width: 100%;
padding-left: 5px;
cursor: not-allowed;
/* border: 1px solid pink; */
}
div.leftnav {
width: 350px;
float: left;
clear: left;
}
div#container {
padding: 0px;
margin: 0px;
}
<div class="leftnav">
<div class="images">
<div class="toptext">Filters
<div class="btn">+ filter</div>
</div>
<div id="container">
<div class="filters rem" id="f12">
<div class="btn4" id="b4f12">Pupil name</div>
<div class="btn2" id="b2f12">
<ul>
<li id="ddf_12_0">=</li>
<li id="ddf_12_1">></li>
</ul>
</div>
<div class="btn1" id="b1f12">Joe Bloggs</div>
<div class="btn3" id="if12">x</div>
</div>
<div class="filters rem" id="f13">
<div class="btn4" id="b4f13">Pupil name</div>
<div class="btn2" id="b2f13">
<ul>
<li id="ddf_13_0">=</li>
<li id="ddf_13_1">></li>
</ul>
</div>
<div class="btn1" id="b1f13">Bill Clinton</div>
<div class="btn3" id="if13">x</div>
</div>
</div>
</div>
</div>
Thanks Emma
Solution :
@ Claudiu Yes it should be comment, but i dont have enough points to add comments
div.btn2 {
width: 20px;
display: inline-block;
color: white;
font-weight: 100;
text-align: center;
cursor: pointer;
left: 162px;
}
div.btn2 ul {
display: block;
margin: 0;
padding: 0;
}
div.btn2 ul li {
display: none;
cursor: pointer;
color: white;
height: 25px;
background-color: #79c1ee;
}
div.btn2 ul li:first-child {
display: inline-block;
width: 20px;
}
div.btn2:hover li {
display: block;
position: absolute;
width: 20px;
background: #000;
}
div.btn2:hover li:first-child {
position: relative;
}
div.btn2 ul li:hover {
background-color: #13A3E2;
}
i have updated the fiddle
CSS Howto..
Don't make it a password field, make it a normal text box. If you need to switch the field type dynamically, there is a HOWOTO over on codingforums.com, and also...
I think this is a bug, for 4 ext you just can add "x-"-prefix for your pressedCls. But for extjs 5 you must use !important directive in your css attribute....
If available, using flex is the easiest. Apply these styles to the container in which you want to center your div: display: flex; align-items: center; justify-content: center; ...
First of all, you really should be including the position on absolutely positioned elements or you will come across odd and confusing behavior; you probably want to add top: 0;...
You can't do this natively with CSS, you'll have to use JavaScript. Here is my code: HTML: <h1><a href="#" class="clickme">Test</a></h1> <div class="show-on-click"> <a href="www.google.com">link</a> <p>some other text</p> </div> CSS: .show-on-click...
Edit: Sorry I misread your question the first time. Here is the solution... The "trick" is to set the event object as the of property value of the object that...
Make your link wrapper (which is the ul) the same width as your page container (which is 892px) and set it to margin: auto to center it. You can remove...
You could try to place transparent divs over the main image using absolute position and fixed dimensions. Those divs will be assosiated to the possible options, and when a user...
You could just absolutely position the sidebar on narrow screens using a simple media query like @media (max-width: 690px) { #sidebar { position:absolute; } } http://jsfiddle.net/vuj6t/3/...
You can just use the following JS to make it rotate: $(function () { var time = 2000; // Time in milliseconds. allInputs = $('input[name="slide_switch"]'); i = 0; setInterval(function ()...
If I understood your question right you can use rgba to shade the color. background-color: rgba(0, 0, 0, 1.5); // darker background-color: rgba(0, 0, 0, 1.0); // normal background-color: rgba(0,...
it just works fine for me JS Fiddle: https://jsfiddle.net/qq0t46pt/1/ HTML: <div id="wraper"> <div id="left"> <p>Left</p> </div> <div id="right"> <p>Right and Hide</p> </div> </div> CSS: #wraper { display: table-wrap; } #left...
Well this code will help, actually i am using setInterval function which will trigger the function after 3 second , all the classes are placed in a array after 3...
You need to use border-bottom ... .element { border-bottom: 1px solid #555; } ... will be pretty close to the example in the linked image, where .element is the css...
Just apply borders and shadow to these borders (you can change the box-shadow value to fit your needs). Here's a fiddle .middle { width:400px; height:800px; border-left:1px solid #eeeeee; border-right:1px solid...
I solved it. I placed $("#imgblock").show(); just after success: function(data){ It worked for me
Take a look at this website. It uses a customized scrollbar for the -webkit- based browsers. When you inspect the css file, it's pretty clear what css is used. @media...
In order to centre the text vertically you cannot use vertical-align. Since the .menuleft (child) div is sitting inside the .navbar (parent) div, I set the parent to a position:...
Depending on which selector engine you use, you can: add a class to your exception h1 element you can use the :not selector to only apply cufon to the h1's...
To get the magnifying glass, you need to add resutls="0" to the search. If you set results to a larger value, like results="5", for instance, the magnifying glass will turn...
If I understand correctly, you can add classes for each position and change the class of the #arrow_box div according to the style when focus is on certain form fields....
Add an onmouseover function handler to the element that is taking the :hover. Inside that function, call console.info(element) on whichever element you'd like to know about. myHoverElement.onmouseover = function() {...
Looks to me like you've given both DIVs the same class, so they are both not really clearly defined for what you want to achieve. Try adding an additional style...
There is no built-in mechanism, but a little creativity means you can do this just about anywhere in your code, from view.yml to layout.php to each individual action. The view.yml...
You could add a special hook class to the "Premium" cells, following your example. And then target them in the main .row:hover state. Also, you don't need the td[rowspan] part....
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...
The img is supposed to have the vertical align property. <img src='http://icons.iconarchive.com/icons/danleech/simple/512/facebook-icon.png' height="50" width="50" style="vertical-align:middle;"> ...
You would use the jQuery toggleClass function, which would also require additional CSS class. $('.button').on('click', function (e) { $('div').toggleClass("show"); }); CSS: div { display: none; } div.show { display: block;...
Having struggled with the issue in a recent large-scale project myself, I applaud you to bringing this to attention on SO. I'm afraid that there's not a single 'correct' solution...
With jquery: $('.last:first').remove(); With CSS: table tbody tr:first-child td.last { display:none } Cheers!...