Wrox Programmer Forums
|
CSS Cascading Style Sheets All issues relating to Cascading Style Sheets (CSS).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the CSS Cascading Style Sheets section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 13th, 2006, 10:17 PM
Registered User
 
Join Date: Mar 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default LI showing thru div

Hi

I have the same problem encountered with select showing thru div but for my case, its LI showing thru div. For example, I have <UL> with 5 <LI>s. When i put mouse over an <A> in the first <LI>, i will show <DIV>(as tooltip) but the <DIV> will be block by the other <LI> in the <UL>.

It works OK on firefox but not IE.

Any ideas?



 
Old March 13th, 2006, 10:28 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 425
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hi! :)
Are all elements positioned? In that case you may need z-index, depending on in which order they come in the source.

Could you link to a sample page, please? It's much easer to figure out what's going on then.

--
http://yupapa.com
 
Old March 15th, 2006, 03:24 AM
Registered User
 
Join Date: Mar 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you for ur reply ;)

I will try to give you a sample page soon. Right now, Im working on something else.

Thanks again.



 
Old March 16th, 2006, 10:44 PM
Registered User
 
Join Date: Mar 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi

I done up the sample page :)
How ever i dont have any personal homepage to put up the page.

Can someone please please recommend me a free site which i can load the sample page with css?


 
Old March 17th, 2006, 07:33 AM
Registered User
 
Join Date: Mar 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi everyone

I have posted my source code for the problem. Save the text to view.

Thanks!


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<style>
<!--
UL.box {
    BORDER-RIGHT: #ccc 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #ccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 0px; MARGIN: 0px; BORDER-LEFT: #ccc 1px solid; WIDTH: 10em; PADDING-TOP: 4px; BORDER-BOTTOM: #ccc 1px solid; FONT-FAMILY: Arial, sans-serif; LIST-STYLE-TYPE: none
}
UL.box LI {
    BORDER-RIGHT: #ccc 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #ccc 1px solid; PADDING-LEFT: 2px; MARGIN-BOTTOM: 4px; PADDING-BOTTOM: 2px; BORDER-LEFT: #ccc 1px solid; CURSOR: default; PADDING-TOP: 2px; BORDER-BOTTOM: #ccc 1px solid; BACKGROUND-COLOR: #eee
}
UL.time {
    BORDER-RIGHT: #ccc 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #ccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 0px; MARGIN: 0px; BORDER-LEFT: #ccc 1px solid; WIDTH: 10em; PADDING-TOP: 4px; BORDER-BOTTOM: #ccc 1px solid; FONT-FAMILY: Arial, sans-serif; LIST-STYLE-TYPE: none
}
UL.time LI {
    BORDER-RIGHT: #ccc 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #ccc 1px solid; PADDING-LEFT: 2px; MARGIN-BOTTOM: 4px; PADDING-BOTTOM: 2px; BORDER-LEFT: #ccc 1px solid; PADDING-TOP: 2px; BORDER-BOTTOM: #ccc 1px solid; BACKGROUND-COLOR: #eee
}
UL.left_col {
    FLOAT: left; MARGIN-LEFT: 0px; WIDTH: 120px
}
UL.center {
    FLOAT: left; MARGIN-LEFT: 0px; WIDTH: 200px
}
UL.table LI {
    POSITION: relative
}
DIV.calinfo {
    BORDER-RIGHT: black 1px solid; PADDING-RIGHT: 0.5em; BORDER-TOP: black 1px solid; MARGIN-TOP: 2px; PADDING-LEFT: 0.5em; FONT-WEIGHT: normal; FONT-SIZE: 10px; Z-INDEX: 2; PADDING-BOTTOM: 0.5em; BORDER-LEFT: black 1px solid; WIDTH: 200px; COLOR: #333333; LINE-HEIGHT: 13px; PADDING-TOP: 0.5em; BORDER-BOTTOM: black 1px solid; FONT-FAMILY: Arial, Helvetica, sans-serif; POSITION: absolute; BACKGROUND-COLOR: #ffffff; TEXT-ALIGN: left
}
DIV.inforow {
    PADDING-BOTTOM: 2px
}
DIV.boldtitle {
    FONT-WEIGHT: bold; FONT-SIZE: 10px; COLOR: #ac0000; LINE-HEIGHT: 10px; FONT-FAMILY: Arial, Helvetica, sans-serif
}
-->
</style>
<SCRIPT language=JavaScript>
function showTip(tip_id, id)
{
    var d = document.getElementById(id);
    d.style.backgroundColor = "#FFE7C4";
    var v = document.getElementById(tip_id);
    v.style.display = "";
}

function hideTip(tip_id, id)
{
    var d = document.getElementById(id);
    d.style.backgroundColor = "#eee";
    var v = document.getElementById(tip_id);
    v.style.display = "none";
}
</SCRIPT>
</head>
<body>
<UL class="time left_col" id=time_1>
  <LI> 1
  <LI> 2
  <LI>3
  <LI>4
  <LI>5</LI>
</UL>
<UL class="table box center" id=item_1>
  <LI id=37>
    <A
  href="#"
  onmouseover="showTip('tip_1_0', '37')" onmouseout="hideTip('tip_1_0', '37')"
  ><strong>Item 1 </strong></A>
    <DIV class=calinfo id=tip_1_0 style="DISPLAY: none; LEFT: 100px; TOP: 0px">
      <DIV class=inforow><B>Item Description:</B></DIV>
      <DIV>This is the description for item. As you can see, this tool tip is blocked by the other items in the list. The only get around i can think of is to put this div outside of the list. This problem only occurs in IE. This example shd be working fine in FireFox.</DIV>
    </DIV>
  <LI id=23>
    <A
  onmouseover="showTip('tip_1_1', '23')" onmouseout="hideTip('tip_1_1', '23')"
  href="#"><STRONG
  class=summary_xxs>Item 2 </STRONG></A>
    <DIV class=calinfo id=tip_1_1 style="DISPLAY: none; LEFT: 100px; TOP: 0px">
      <DIV class=inforow><B>Item Description:</B></DIV>
      <DIV>This is the description for item. As you can see, this tool tip is blocked by the other items in the list. The only get around i can think of is to put this div outside of the list. This problem only occurs in IE. This example shd be working fine in FireFox.</DIV>
    </DIV>
  <LI id=27>
    <A
  onmouseover="showTip('tip_1_2', '27')" onmouseout="hideTip('tip_1_2', '27')"
  href="#"><STRONG
  class=summary_xxs>Item 3</STRONG></A>
    <DIV class=calinfo id=tip_1_2 style="DISPLAY: none; LEFT: 100px; TOP: 0px">
      <DIV class=inforow><B>Item Description:</B></DIV>
      <DIV>This is the description for item. As you can see, this tool tip is blocked by the other items in the list. The only get around i can think of is to put this div outside of the list. This problem only occurs in IE. This example shd be working fine in FireFox.</DIV>
    </DIV>
  <LI id=11>
  <A
  href="#"
  onmouseover="showTip('tip_1_3', '11')" onmouseout="hideTip('tip_1_3', '11')" ><strong>Item 4 </strong></A>
    <DIV class=calinfo id=tip_1_3 style="DISPLAY: none; LEFT: 100px; TOP: 0px">
      <DIV class=inforow><B>Item Description:</B></DIV>
      <DIV>This is the description for item. As you can see, this tool tip is blocked by the other items in the list. The only get around i can think of is to put this div outside of the list. This problem only occurs in IE. This example shd be working fine in FireFox.</DIV>
    </DIV>
  <LI id=5>
  <A
  href="#"
  onmouseover="showTip('tip_1_4', '5')" onmouseout="hideTip('tip_1_4', '5')" ><strong>Item 5 </strong></A>
    <DIV class=calinfo id=tip_1_4 style="DISPLAY: none; LEFT: 100px; TOP: 0px">
      <DIV class=inforow><B>Item Description:</B></DIV>
      <DIV>This is the description for item. As you can see, this tool tip is blocked by the other items in the list. The only get around i can think of is to put this div outside of the list. This problem only occurs in IE. This example shd be working fine in FireFox.</DIV>
    </DIV>
  </LI>
</UL>
</body>
</html>


 
Old March 21st, 2006, 08:58 PM
Authorized User
 
Join Date: Mar 2006
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This is a bug in IE. I'm trying to find the answer but I just don't recall what it is. Stay tuned. (IE has many bugs with options)

 
Old March 22nd, 2006, 12:26 AM
Authorized User
 
Join Date: Mar 2006
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Now I remember. You had the right idea with position:relative but you have it in the wrong place. You (probably) don't need it here: UL.table LI { but you DO need it here:
<UL class="table box center" id=item_1 style="position:relative">
  <LI id=37 >

and this fixes the IE bug.


 
Old March 22nd, 2006, 05:29 AM
Registered User
 
Join Date: Mar 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you! Your method works.
Now i am able to see the div in front of the UL.

But i found another bug on this. I created a second UL menu and placed it below the first UL menu. When I mouseover the first UL's item 5, the tooltip appeared behind the second UL menu.

Any solutions for this?

I have attached the code for second UL, to be placed just directly after the first UL. Take note that I removed the TOP and LEFT style attribute for div.

<p style="clear:left ">
<UL class="time left_col" id=time_2>
  <LI> 1
  <LI> 2
  <LI>3
  <LI>4
  <LI>5</LI>
</UL>
<UL class="table box center" id=item_2 style="position:relative ">
  <LI id=2_37>
    <A
  href="#"
  onmouseover="showTip('tip_2_0', '2_37')" onmouseout="hideTip('tip_2_0', '2_37')"
  ><strong>Item 2_1 </strong></A>
    <DIV class=calinfo id=tip_2_0 style="DISPLAY: none">
      <DIV class=inforow><B>Item Description:</B></DIV>
      <DIV>This is the description for item 37. As you can see, this tool tip is blocked by the other items in the list. The only get around i can think of is to put this div outside of the list. This problem only occurs in IE. This example shd be working fine in FireFox.</DIV>
    </DIV>
  <LI id=2_23>
    <A
  onmouseover="showTip('tip_2_1', '2_23')" onmouseout="hideTip('tip_2_1', '2_23')"
  href="#"><STRONG
  class=summary_xxs>Item 2_2</STRONG></A>
    <DIV class=calinfo id=tip_2_1 style="DISPLAY: none">
      <DIV class=inforow><B>Item Description:</B></DIV>
      <DIV>This is the description for item 23. As you can see, this tool tip is blocked by the other items in the list. The only get around i can think of is to put this div outside of the list. This problem only occurs in IE. This example shd be working fine in FireFox.</DIV>
    </DIV>
  <LI id=2_27>
    <A
  onmouseover="showTip('tip_2_2', '2_27')" onmouseout="hideTip('tip_2_2', '2_27')"
  href="#"><STRONG
  class=summary_xxs>Item 2_3</STRONG></A>
    <DIV class=calinfo id=tip_2_2 style="DISPLAY: none">
      <DIV class=inforow><B>Item Description:</B></DIV>
      <DIV>This is the description for item 27. As you can see, this tool tip is blocked by the other items in the list. The only get around i can think of is to put this div outside of the list. This problem only occurs in IE. This example shd be working fine in FireFox.</DIV>
    </DIV>
  <LI id=2_11>
  <A
  href="#"
  onmouseover="showTip('tip_2_3', '2_11')" onmouseout="hideTip('tip_2_3', '2_11')" ><strong>Item 2_4 </strong></A>
    <DIV class=calinfo id=tip_2_3 style="DISPLAY: none">
      <DIV class=inforow><B>Item Description:</B></DIV>
      <DIV>This is the description for item 11. As you can see, this tool tip is blocked by the other items in the list. The only get around i can think of is to put this div outside of the list. This problem only occurs in IE. This example shd be working fine in FireFox.</DIV>
    </DIV>
  <LI id=2_5>
  <A
  href="#"
  onmouseover="showTip('tip_2_4', '2_5')" onmouseout="hideTip('tip_2_4', '2_5')" ><strong>Item 2_5 </strong></A>
    <DIV class=calinfo id=tip_2_4 style="DISPLAY: none">
      <DIV class=inforow><B>Item Description:</B></DIV>
      <DIV>This is the description for item 5. As you can see, this tool tip is blocked by the other items in the list. The only get around i can think of is to put this div outside of the list. This problem only occurs in IE. This example shd be working fine in FireFox.</DIV>
    </DIV>
  </LI>
</UL>

 
Old March 22nd, 2006, 09:05 AM
Authorized User
 
Join Date: Mar 2006
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I don't see that problem.

 
Old March 23rd, 2006, 03:04 AM
Registered User
 
Join Date: Mar 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

drhowarddrfine, thanks so much for your help.

I dont know why i have that problem, but i want to change my structure to make one div(tooltip) to cater for all LIs. And i also realised that i have to fix LI's position = relative.

We see how it goes from there. Thank you once again.






Similar Threads
Thread Thread Starter Forum Replies Last Post
z-index problem with select showing through div crmpicco CSS Cascading Style Sheets 3 July 4th, 2008 07:00 AM
<li></li> issue Adam H-W CSS Cascading Style Sheets 1 November 5th, 2007 06:41 AM
div within a div and inherting the height brettdavis4 CSS Cascading Style Sheets 1 January 23rd, 2007 09:59 AM
Something about li and ul sfs00784 CSS Cascading Style Sheets 1 July 31st, 2005 02:03 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.