Z-index and list items (newbie) - html

I am working on a sheet music catalog. Available sheets are listed on an ordered list and when hovering on "view", a pop-up preview image shows. I noticed that as you scroll down previewing each sheet, certain elements from the < li > items below the current one can be seen through the image. I am sure this has to do with the stacking context/order or even with a missing 'position' somewhere, but I can't figure it out.
I have the scenario here: http://jsfiddle.net/4BwBX/
HTML:
<div id="SheetMusicStore">
<ol class="enlarge">
<li>
<span class="view">[ view ]</span>
<span class="preview"><img src="http://www.antonioromo.com/newsite/images/01gnw-tn.png" alt="Just Another Dusk" /><br />Just Another Dusk (Good Night Wishes)</span>
<span class="name">Just Another Dusk (Good Night Wishes)</span>
<span class="price">$3.99 BUY</span>
</li>
<li>
<span class="view">[ view ]</span>
<span class="preview"><img src="http://www.antonioromo.com/newsite/images/02gnw-tn.png" alt="My Nightlight" /><br />My Nightlight (Good Night Wishes)</span>
<span class="name">My Nightlight (Good Night Wishes)</span>
<span class="price">$3.99 BUY</span>
</li>
<li>
<span class="view">[ view ]</span>
<span class="preview"><img src="http://www.antonioromo.com/newsite/images/03gnw-tn.png" alt="Whisper of Love" /><br />Whisper of Love (Good Night Wishes)</span>
<span class="name">Whisper of Love (Good Night Wishes)</span>
<span class="price">$3.99 BUY</span>
</li>
</ol>
</div>
CSS:
/** Sheet Music Store **/
#SheetMusicStore {
width: 500px;
margin: 40px auto;
}
ol.enlarge{
margin-left:0;
font-family: 'Trebuchet MS', Helvetica, Tahoma, Arial, Sans-serif;
font-size: 1em;
color: #999;
padding: 10px 20px;
box-shadow: inset 0 2px 2px #582E58;
border-radius: 6px;
background: url(http://www.antonioromo.com/newsite/images/sheet-bg.png) repeat 0 0 scroll;
color: #AAA;
}
ol.enlarge li{
position: relative;
z-index: 0; /*resets the stack order of the list items - later we'll increase this*/
text-shadow: 0 1px 1px rgba(0, 0, 0, .6);
background: transparent url(http://www.antonioromo.com/newsite/images/sheet-item-bg.png) repeat-x bottom left scroll;
padding: 5px 0 7px 0;
list-style-position: inside;
font-size: 12px;
}
ol.enlarge img{
background-color: #eae9d4;
padding: 6px;
box-shadow: 0 0 6px rgba(132, 132, 132, .75);
border-radius: 4px;
}
ol.enlarge span.preview{
position: absolute;
left: -9999px;
background-color: #eae9d4;
padding: 10px;
font-family: 'Trebuchet MS', Helvetica, 'Droid Sans', sans-serif;
font-size: .9em;
text-align: center;
color: #495a62;
box-shadow: 0 0 20px rgba(0,0,0, .75);
border-radius: 8px;
}
ol.enlarge li:hover{
color: #EEE;
}
ol.enlarge li:hover .view{
color:#FFFFCC !important;
}
ol.enlarge .view:hover{
cursor: pointer;
}
ol.enlarge span.preview img{
padding: 2px;
background: #ccc;
}
span.view:hover ~ span.preview{
top: -300px; /*the distance from the bottom of the thumbnail to the top of the popup image*/
left: 300px; /*distance from the left of the thumbnail to the left of the popup image*/
z-index: 50;
}
ol.enlarge .price {
width: 62px;
height: 16px;
position: absolute;
top: 7px;
right: 0;
border-radius: 8px;
background: transparent url(http://www.antonioromo.com/newsite/images/buy-bg.png) repeat 0 0 scroll;
margin: 0 0 0 10px;
font-size: 10px;
text-align: center;
line-height: 16px;
text-shadow: none;
color: #BBB;
text-decoration: none;
}
ol.enlarge .price:hover {
color: #EEE;
cursor: pointer;
}
I need the preview image to be on top of anything else. Thank you in advance for your help!

I fixed this by removing the z-index:0; declaration from ol.enlarge li:
ol.enlarge li{
position: relative;
/*z-index: 0; */ /*resets the stack order of the list items - later we'll increase this*/
text-shadow: 0 1px 1px rgba(0, 0, 0, .6);
background: transparent url(http://www.antonioromo.com/newsite/images/sheet-item-bg.png) repeat-x bottom left scroll;
padding: 5px 0 7px 0;
list-style-position: inside;
font-size: 12px;
}
JSfiddle
Z-index is still a bit of a dark art to me, but I believe that by declaring z-index: 0 you were taking the li out of the natural stacking order (which is actually what you wanted in this case, since they merely serve as an "anchor" for your .preview images). This was causing each li to "stack" on top of each other – albeit in a different order than the normal top down flow – and that was why you the content of the li above the hovered li was visible.

Related

Extra Padding on my site using ProfitBuilder WP

I am currently copying this site: http://www.onlinemeetingnow.com/register/?id=q6wpivs95c& here: http://beaminggeek.com/profitbuilder/test-2/
and using a WP tool called ProfitBuilder: http://wpprofitbuilder.com/
I have three issues here in particular.
1. I put margin-top: 20px; on my tag (to push it on the center) on the image below however when I do it adds up a margin on the both top and below:
Here's my code on that:
<h2 style="text-align: center; font-size: 40px; font-weight: bold;"><span style="color: #ffffff; ">The 4-Step Strategy We Used to Build a</span><br /> <span style="color: #ffffff;"> 7-Figure Coaching Business...</span><br /> <span style="color: #ffffff; font-size: 25px; "> (while ignoring ALL the conventional wisdom!)</span></h2><p style="text-align: center;"><a style="font-family: 'Open Sans Condensed'; text-shadow: 1px 1px 1px rgba(0,0,0,0.3); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd800',endColorstr='#f7d100'); background: -moz-linear-gradient(center top,#ffd800 5%,#f7d100 100%); background-color: #ffd800; display: block; margin: 0 auto; position: relative; min-height: 33px; width: 280px; text-decoration: none; font-weight: bold; font-size: 30px; color: #fdffff; cursor: pointer; border-radius: 3px; -webkit-border-radius: 3px; -moz-border-radius: 3px; border: none; padding: 17px 10px; text-align: center; z-index: 2; margin-top: 12px;" href="#">Claim My Spot Now >></a></p>
I also have some issues with this two section here as there are spaces all around:
Any idea what to move to make it look perfect using inline-CSS? YOu can use Chrome inspector tool to check this.
NOTE: The Profit Builder Tool is a tool that doesnt go with custom css panel with it meaning everything is just plain inline CSS.
You have a padding-bottom set for your Claim Your Spot Now button. So when you put a margin-top value on top of your h2 it pushes your p down as well and the padding-bottom of the p pushes down the following section
I think this should work
body {
margin: -1px 0 0 0
}
h2 {
margin: 25px 0 0 0;
}
.pbuilder_column {
margin: 0 0 -24px 0
}

Control side that shortens when changing div height on hover

I'm using this hover effect for buttons, but in a few cases when the height changes, the top remains the same and the bottom moves up, instead of vice versa like it should. How can I make sure it always goes in the correct direction?
jsfiddle
.button {
box-sizing: border-box;
display: inline-block;
width: 215px;
height: 55px;
color: white;
font-family: $arial;
font-size: 12px;
font-weight: bold;
text-transform: uppercase;
text-align: center;
text-decoration: none;
text-shadow: 1px 1px 1px rgba(43, 36, 36, 0.35);
letter-spacing: .1em;
border-radius: 3px;
position: relative;
background: #009ee0;
border: 1px solid #148fc6;
border-bottom: 4px solid #148fc6;
}
.button:hover {
border-bottom: 1px;
height: 53px;
}
.button span {
position: absolute;
width: 90%;
left: 0;
right: 0;
margin: auto;
top: 50%;
transform: translateY(-43%);
line-height: 1.2;
}
div {
padding: 20px 5px;
}
<div>
<a href="#" class="button">
<span>Wrong way</span>
</a>
</div>
<div>
<a href="#" class="button">
<span>I work fine</span>
</a>
<a href="#" class="button">
<span>I work fine</span>
</a>
</div>
You're reducing the height from 55px to 53px. That 2px has to go somewhere. The top button is just collapsing it. (The bottom two are doing the same, it just doesn't look like it because they are being affected by vertical text alignment). change your hover rule to this to accommodate for the height loss.
.button:hover {
border-bottom: 1px;
margin-top: 2px;
height: 53px;
}
https://jsfiddle.net/exd6hhvz/
I was able to make it work consistently by adding margin-top: 2px; to .button:hover
Here's an example: https://jsfiddle.net/vf03czp5/

Button with a bigger text centering issue

I´m trying to do some buttons with image and text, and I already did this work.
But now I´m studying a diferente hypothesis, If I have a text bigger I´m trying to center the text in the button but I´m not having sucess put this right. I´m not having succeess putting my very big is not good align-center just below the 1st text.
Have you ever had a case like this? How we can solve this?
I have this Html for two buttons:
<button class='btn'>
<img class="big_btn" src="icon1.png" width="40" height="40"/>
Big button so big <span> very big is not good</span>
</button>
<button class='btn'>
<img src="icon1.png" width="40" height="40">
2button big
</button>
And I have this css file:
.btn {
position: relative;
width: 180px;
height: 60px;
margin-top:7%;
padding: 0 10px 0 10px;
line-height: 37px;
text-align: left;
text-indent: 10px;
font-family: 'bariol_regularregular';
font-size: 15px;
color: #333;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
background: #f1f1f1; /* button background */
border: 0;
border-bottom: 2px solid #999; /* newsletter button shadow */
border-radius: 14px;
cursor: pointer;
-webkit-box-shadow: inset 0 -2px #999;
box-shadow: inset 0 -2px #999;
}
.btn:active {
top: 1px;
outline: none;
-webkit-box-shadow: none;
box-shadow: none;
}
.btn img { float: left;}
.btn .big { margin-top:10px;}
.btn:hover { background-color: #f7f7f7;}
Here's the Fiddle: http://jsfiddle.net/3F9pu/
My image updated:
Your problem is your line-height attribute. If you set that to be 37px, each new line of text will be separated by 37px. Remove `line-height:37px and the text will wrap around the image.
line-height: 37px
I also removed your text-indent and replaced it with a margin on your floated image to make the text all align properly.
.btn img{
float:left;
margin-right: 10px;
}
text-indent: 10px
JSFiddle
Use a CSS background image.
Have a fiddle - Fiddle Link!
HTML
<button class='btn'>Big button so big very big is not good</button>
<button class='btn'>2button big</button>
CSS
.btn {
background: url("http://lorempixel.com/output/cats-q-c-40-40-3.jpg") #CCC 10px no-repeat;
border: none;
padding: 10px 10px 10px 60px;
width: 200px;
text-align: left;
vertical-align: top;
min-height: 60px;
cursor: pointer;
}
.btn:hover {
background-color: #F00;
}

CSS Tooltip has different position in different browsers. How can I account for this?

I have adjusted my bottom attribute to display how I want it in Firefox, but the spacing is all warped in Chrome and Safari. Is there a way to sett a different "top" attribute for each browser?
HTML
<a class="tooltip" href="#"> <!-- this tag activates my tool tip -->
<div class="handsevent" > <!-- this div contains everything that activates the tool tip when hovered over-->
<div class="handswrapper">
<div class="handshour" >
<h3>8:00am-noon</h3>
</div>
<div class="handsspeaker">
<h3>Speaker 3</h3>
</div>
</div>
<div class="handstitle">
<p>Description</p>
</div>
</div>
<span class="classic"> <!-- this span contains everything that pops up in the tool tip -->
<h3>Title Bar</h3>
<br />lots of descriptive text
</span>
</a>
CSS
/* HOVER WINDOW */
.tooltip {
color: #000000; outline: none; font-style:bold;
cursor: help; text-decoration: none;
position: relative;
}
.tooltip span {
margin-left: -999em;
position: absolute;
}
.tooltip:hover span {
border-radius: 30px 30px; -moz-border-radius: 30px; -webkit-border-radius: 30px;
box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.1); -webkit-box-shadow: 5px 5px rgba(0, 0, 0, 0.1); -moz-box-shadow: 5px 5px rgba(0, 0, 0, 0.1);
font-family: Arial, Tahoma, Helvetica, sans-serif;
position: auto; left: 1em; top: 2em; z-index: 99; <!-- the 'top' attribute on this line is where I have been adjusting the display position it affects the position differently in different browsers -->
margin-left: 0; width: 700px; margin-top:-10px;
}
.tooltip:hover img {
border: 0; margin: -30px 0 0 90px;
float: right; position:fixed;
z-index: 99;
}
.tooltip:hover em {
font-family: Arial, Tahoma, Helvetica, sans-serif; font-size:14px; font-weight: bold; color:005DA4;
display: block; padding: -0.2em 0 0.6em 0;
}
.classic { padding: 0.8em 1em; }
* html a:hover { background: transparent; }
.classic {background: #ffffff; border: 1px solid #ffffff; }
I have tried pixels, em, and percentage. None of these have been consistent. Are there browser specific settings I could use?
here is a demo link for reference.
Using a CSS Reset will help to eliminate differences between browsers.
I switch the top attribute in ".tooltip:hover span" to "auto" and that seems to be working.

Slider covering mega drop down menu

If you could kindly hover your mouse over the MORE button in the menu here:
http://jsfiddle.net/H8FVE/3/
You will notice that the big wide picture underneath (#featured) is covering the drop down div. Why and how can I fix it?
Here is part of my HTML code:
<div id="second-menu" class="clearfix">
<ul id="secondary-menu" class="nav sf-js-enabled">
<li class="manimation">Animation</li>
</ul>
<ul id="mega">
<li class="dif mmore" style="background:none;">More...
<div>
<ticman>
<ul>
<li class="mgames">Games</li>
<li class="mliterature">Literature</li>
<li class="marts">Arts</li>
<li class="mcontact" style="background:none;">Contact</li>
</ul>
</ticman>
<h2>Classes</h2>
<p>TimesSchedualMap</p>
<p>NamesStudyDirections</p>
<p>HealthDanceBiology</p>
<h2>Teachers</h2>
<p>BillyMadeleineLaurenSteve</p>
<p>PaddingtonStefanMichaelMadeline</p>
<p>ShannonMaryRaffaelloLorence R</p>
<h2>Location</h2>
<p>CarlsbadOceansideEl Cajon</p>
<p>VistaLa CostaEncinitas</p>
<p>San DiegoLos AnglesCardiff</p>
</div>
</li>
</ul>
</div> <!-- end #second-menu -->
<div class="et_cycle" id="featured">
Previous
Next
<div id="slides" style="position: relative; background-image: none;">
<div class="slide" style="position: absolute; top: 0px; left: 0px; z-index: 3; opacity: 1; display: block;">
<img width="958px" height="340px" alt="10 moments in cinematic history changing faith" src="http://ftframes.com/delheat/wordpress/wp-content/uploads/et_temp/ip-man-donnie-yen-756651_958x340.jpg"> <div class="featured-top-shadow"></div>
<div class="featured-bottom-shadow"></div>
<div class="featured-description">
<div class="feat_desc">
<p class="meta-info">Posted by <a rel="author" title="Posts by admin" href="http://ftframes.com/delheat/wordpress/?author=1">admin</a> on Aug 9, 2012</p>
<h2 class="featured-title">Some random text here</h2>
<p>Well, I like this trailer a bit better than Chasing Mavericks’. Well for one, Gerry gets to keep his Scottish brogue, wahoo! Plus, I kind of like seeing him with kids. I mean the last time he played dad to a little boy was in the wonderful indie Dear Frankie, and he’s definitely a natural with them. Then there’s the supporting cast: Catherine Zeta-Jones, Jessica Biel, Uma Thurman, Dennis Quaid and...</p>
</div>
<a class="readmore" href="http://ftframes.com/delheat/wordpress/?p=43">Read More</a>
</div> <!-- end .description -->
</div> <!-- end .slide -->
<div class="slide" style="position: absolute; top: 0px; left: 0px; display: none; z-index: 2; opacity: 0;">
<img width="958px" height="340px" alt="More experimental testings" src="http://ftframes.com/delheat/wordpress/wp-content/uploads/2012/07/vlcsnap-2012-05-13-22h37m19s79-300x129.png"> <div class="featured-top-shadow"></div>
<div class="featured-bottom-shadow"></div>
<div class="featured-description">
<div class="feat_desc">
<p class="meta-info">Posted by <a rel="author" title="Posts by admin" href="http://ftframes.com/delheat/wordpress/?author=1">admin</a> on Jul 30, 2012</p>
<h2 class="featured-title">More experimental testings</h2>
<p>Lets see how this one turns out… Lets see how this one turLets see how this one turLets see how this one turLets see how this one turLets see how this one turLets see how this one turLets see how this one turLets see how this one tur
Lets see how this one turLets see how this one turLets see how this one turLets see how this one turLets see how this one turLets see how this one turLets see how...</p>
</div>
<a class="readmore" href="http://ftframes.com/delheat/wordpress/?p=10">Read More</a>
</div> <!-- end .description -->
</div> <!-- end .slide -->
<div class="slide" style="position: absolute; top: 0px; left: 0px; display: none; z-index: 1; opacity: 0;">
<img width="958px" height="340px" alt="Testing this theme with image" src="http://ftframes.com/delheat/wordpress/wp-content/uploads/et_temp/251932_10151043115229294_310983318_n-39277_635x340.jpg"> <div class="featured-top-shadow"></div>
<div class="featured-bottom-shadow"></div>
<div class="featured-description">
<div class="feat_desc">
<p class="meta-info">Posted by <a rel="author" title="Posts by admin" href="http://ftframes.com/delheat/wordpress/?author=1">admin</a> on Jul 30, 2012</p>
<h2 class="featured-title">Testing this theme with image</h2>
<p>And this is how it looks, very interesting indeed.And this is how it looks, very interesting indeed.And this is how it looks, very interesting indeed.And this is how it looks, very interesting indeed.And this is how it looks, very interesting indeed.And this is how it looks, very interesting indeed.And this is how it looks, very interesting indeed.And this is how it looks, very interesting...</p>
</div>
<a class="readmore" href="http://ftframes.com/delheat/wordpress/?p=6">Read More</a>
</div> <!-- end .description -->
</div> <!-- end .slide -->
</div> <!-- end #slides -->
</div> <!-- end #featured -->
And here is part of my CSS:
ul#secondary-menu li { background: url(images/secondary-menu-bg.png) repeat-y top right; }
ul#secondary-menu a { font-size: 16px; color: #48423f; text-decoration: none; text-transform: uppercase; font-weight: bold; padding: 22px 16px; }
ul#secondary-menu a:hover { color: #ffffff; text-shadow: 1px 1px 0 #404747; }
#second-menu ul.nav li:hover a {color: #ffffff; text-shadow: 1px 1px 0 #404747; }
ul#secondary-menu > li.current_page_item > a { color: #919e9e !important; }
ul#secondary-menu li ul, #category_mobile_menu { width: 360px !important; padding: 7px 0 10px; background: #fff url(images/content-bg.png); top: 55px !important; -moz-box-shadow:3px 3px 7px 1px rgba(0, 0, 0, 0.1); -webkit-box-shadow: 3px 3px 7px 1px rgba(0, 0, 0, 0.1); box-shadow: 3px 3px 7px 1px rgba(0, 0, 0, 0.1); -moz-border-radius: 10px; -webkit-border-radius: 10px; border-radius: 10px; border-top-left-radius: 0px;-moz-border-radius-topleft: 0px; border-top-right-radius: 0px; -webkit-border-top-left-radius: 0px; -moz-border-radius-topright: 0px; -webkit-border-top-right-radius: 0px; z-index: 9999px; display: none; }
ul#secondary-menu ul li, #category_mobile_menu li a { margin: 0 !important; padding: 8px 0 8px 30px !important; width: 150px; float: left; }
ul#secondary-menu ul li a, #category_mobile_menu a { padding: 0 !important; }
ul#secondary-menu li:hover ul ul, ul#secondary-menu li.sfHover ul ul { top: -8px !important; left: 180px !important; -moz-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }
ul#secondary-menu ul li.even-item { background: none; }
.mfilm:hover{
background:#ea2e49 !important;
}
.mtv:hover{
background:#2589cf !important;
}
.mwebvideos:hover{
background:#5c58ac !important;
}
.manimation:hover{
background:#43cf61 !important;
}
.manime:hover{
background:#c142a5 !important;
}
.mmanga:hover{
background:#e77848 !important;
}
.mcomics:hover{
background:#e8eb05 !important;
}
.mwriters:hover{
background:#ff3c75 !important;
}
.mmore:hover{
background:#4b5571 !important;
}
.mliterature:hover{
background:#2c8f83 !important;
}
.mgames:hover{
background:#e34328 !important;
}
.marts:hover{
background:#cc226a !important;
}
.mcontact:hover{
background:#9395aa !important;
}
/* ---------- Mega Drop Down --------- */
ul#mega li { padding-right: 0px; background: url(images/secondary-menu-bg.png) repeat-y top right; }
#mega {
list-style:none;
font-weight:bold;
height:2em;
}
#mega li {
padding: 23px 0px;
background:#999;
border:0px solid #000;
float:left;
text-align:center;
position:relative;
}
#mega li:hover {
background:#eee;
border-bottom:0; /* border-bottom:0; and padding-bottom:1px; keeps <li> and <div> connected */
z-index:1; /* shadow above adjacent li */
}
#mega a { font-size: 16px; color: #48423f; text-decoration: none; text-transform: uppercase; font-weight: bold; padding: 22px 16px;}
ul#mega a:hover { color: #FFFFFF; text-shadow: 1px 1px 0 #404747; }
/* ----------- Hide/Show Div ---------- */
#mega div {
-moz-border-bottom-colors: none;
-moz-border-image: none;
-moz-border-left-colors: none;
-moz-border-right-colors: none;
-moz-border-top-colors: none;
background: none repeat scroll 0 0 #FFFFFF;
border-color: -moz-use-text-color #48423F #48423F;
border-right: 1px solid #48423F;
border-style: none solid solid;
border-width: 0 1px 1px;
font-weight: normal;
left: -999em;
margin-top: 1px;
position: absolute;
text-align: left;
width: 496px;
}
/* --------- Within Div Styles --------- */
#mega li:hover div {
left: -1px;
top: auto;
}
#mega li.dif:hover div {
left: -407px;
top: 72px;
}
#mega li.mmore:hover > a {
color: #FFFFFF; text-shadow: 1px 1px 0 #404747; /* Ensures hover on MORE remains */
}
#mega div h2 {
background: none repeat scroll 0 0 #999999;
clear: both;
float: left;
font-size: 1em;
margin: 10px 0 5px;
padding: 0 10px;
position: relative;
width: 300px;
}
#mega div ticman {
clear: both;
float: left;
position: relative;
margin-left:1px;
margin-right:1px;
width: 495px;
height: 74px;
background-image: url(images/morebgwide.png);
background-size:495px 74px;
background-repeat:no-repeat;
}
#mega div p {
float: left;
padding-left: 10px;
position: relative;
width: 106px;
}
#mega div p a {
clear: left;
float: left;
line-height: 1.4;
text-decoration: underline;
width: 100%;
}
#mega div a:hover, #mega div a:focus, #mega div a:active {
text-decoration: none;
}
/*------------------------------------------------*/
/*--------------[FEATURED SLIDER]-----------------*/
/*------------------------------------------------*/
#featured { position: relative; padding-bottom: 20px; margin-left: -1px; margin-right: -1px; }
a#left-arrow, a#right-arrow { position: absolute; top: 136px; width: 32px; height: 68px; text-indent:-9999px; }
a#left-arrow { background:url(images/left-arrow.png) no-repeat; left: -32px; }
a#right-arrow { background:url(images/right-arrow.png) no-repeat; right: -32px; }
.featured-top-shadow { background:url(images/featured-top-shadow.png) repeat-x; position: absolute; top:0px; left: 0px; width: 958px; height: 7px; }
.featured-bottom-shadow { background:url(images/featured-bottom-shadow.png) repeat-x; position: absolute; bottom:0; left: 0; width: 958px; height: 8px; }
.featured-description { position: absolute; width: 333px; height: 196px; top: 40px; right:54px; background:url(images/featured-description.png); padding: 27px 32px 40px; -moz-border-radius: 10px; -webkit-border-radius: 10px; border-radius: 10px; }
.featured-description p.meta-info { font-family: Georgia, serif; font-style: italic; font-size: 12px; color: #747474; }
.featured-description p.meta-info a { text-decoration: none; color: #fff; }
h2.featured-title { font-family: 'Kreon', Arial, sans-serif; font-weight: lighter;font-size: 30px; text-shadow: 1px 1px 1px rgba(0,0,0,0.4); margin-top: -4px; }
h2.featured-title a { text-decoration: none; color: #ffffff; }
.featured-description p { color: #c9c8c8; text-shadow: 1px 1px 1px rgba(0,0,0,0.4); line-height: 19px; }
a.readmore { display: block; background: url(images/readmore.png); height: 27px; padding: 0 17px; color: #dfca81; font-size: 12px; line-height: 27px; position: absolute; bottom: 0px; right: 0px; text-shadow: none; }
#featured a.readmore { -moz-border-radius-bottomright: 10px;-webkit-border-bottom-right-radius: 10px; border-bottom-right-radius: 10px; }
#featured a.readmore:hover { color: #fff; }
Although, I would advice overlooking the fiddle for a visual presentation of the issue: http://jsfiddle.net/H8FVE/3/
I have been trying to wrap my head around this all day to a point where I almost set my hair on fire. Do you know how to solve this?
Use the z-index css attribute to visually layer objects like this in HTML regardless of your DOM tree. I would advise you to test your eventual implementation cross browser though, especially IE7. Damn you IE7 for the extra work you cause us all.
See http://jsfiddle.net/H8FVE/6/:
Just add
#second-menu{
z-index:4;position:relative;
}
That's because slide has z-index:3, so if you want to see second-menu, its z-index must be higher.
And you have to add position:relative too because z-index has no effect on elements with position:static.
Edit:
I have seen you have
#mega div{
left:-999em;
}
#mega li.dif:hover div {
left: -407px;
top: 72px;
}
I think it would be better like this:
#mega > li.dif > div{
display:none:
left: -407px;
top: 72px;
}
#mega > li.dif:hover > div {
display: block;
}
That's because if you set left:-999em; to #mega div, you suppose that it won't be shown because -999em is a lot. But if you want to hide it, isn't it better not to display it?
And I have added child selectors (>) because in the future maybe you will modify it and add more divs inside #mega > li.dif > div; and child selectors should be faster than descendant selectors.
Try this:
#mega li:hover {
background:#eee;
border-bottom:0; /* border-bottom:0; and padding-bottom:1px; keeps <li> and <div> connected */
z-index:10; /* shadow above adjacent li */
}
I changed the z-index to 10, instead of 1.
http://jsfiddle.net/H8FVE/5/
Give #second-menu a z-index of 3
Give "#mega div" a z-index of 2
Give #featured a z-index of 1