code_junkie

Can multiple CSS hover popups occupy the same space within a single div?

Nov 13th, 2011
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.43 KB | None | 0 0
  1. <div id="greenback">
  2. <div class="serviceframe">
  3. <div class="serviceslist">
  4. <ul>
  5. <li><a href="">item 1<span>this is popup1.</span></a></li>
  6.  
  7. <p><li><a href="">item 2<span>This is popup 2's text but I want it to appear in exactly the same place as popup 1's text does.</span></a></li></p>
  8.  
  9. <p><li><a href="">item 3<span>same here - how can I get all popups positioned in exactly the same place?</span></a></li></p>
  10. </ul>
  11. </div><!-- closes serviceslist-->
  12. </div><!-- closes serviceframe -->
  13. </div><!-- closes greenback-->
  14.  
  15. ul {
  16. list-style: disc url(w-arrow.png) outside;
  17. }
  18.  
  19.  
  20.  
  21. #greenback {
  22. position: relative ;
  23. top: 0em ;
  24. width: 800px ;
  25. height: 250px ;
  26. background-color: #7EBB11 ;
  27. border: 3px solid #112D82 ;
  28. }
  29.  
  30. /*********SERVICE LIST MENU**********/
  31. .serviceframe {
  32. position: relative ;
  33. width: 100% ;
  34. height: 94% ;
  35. background-color: #666666 ;
  36. top: 3%; bottom: 3%;
  37. }
  38. /*--serviceframe is now sitting in greenback--*/
  39.  
  40. .serviceslist {
  41. position: relative ;
  42. width: 100% ;
  43. height: 90% ;
  44. top: 1% ;
  45. background-color: #7EBB11 ;
  46. font-family: Optima, Calibri, Candara, Century-Gothic,
  47. Arial, sans-serif;
  48. font-size: 100% ;
  49. color: black ;
  50. display: table-cell ;
  51. vertical-align: middle ;
  52. z-index: 100 ;
  53. }
  54.  
  55. .serviceslist a
  56. {position: relative;
  57. display: table-cell; text-align: left; height: 100%; font: 1em sans-serif;
  58. text-decoration: none; color: #112D82;
  59. background: #7EBB11 ;
  60. }
  61.  
  62. /*appearance of the <a> item (but before the <span> tag) on hover*/
  63. .serviceslist a:hover {
  64. color: white;
  65. }
  66.  
  67. /*appearance of the spanned content within <a></a> tags when not hovered*/
  68. .serviceslist a span {display: none;}
  69.  
  70. /*appearance of spanned content within <a> tags when hovered*/
  71. .serviceslist a:hover span {
  72. position: absolute;
  73. display: table-cell;
  74. margin-top: 0em; margin-left: -50%; z-index: 100;
  75. width: 40%; height: auto; color: #FFFFFF; background-color: #7EBB11;
  76. font: 14px Verdana, sans-serif; text-align: left;
  77. }
  78.  
  79. <ul>
  80. <li><a href="">item 1<span>this is popup1.</span></a></li>
  81. <li><a href="">item 2<span>This is popup 2's text but I want it to appear in exactly the same place as popup 1's text does.</span></a></li>
  82. <li><a href="">item 3<span>same here - how can I get all popups positioned in exactly the same place?</span></a></li>
  83. </ul>
  84.  
  85. ul { position: relative; }
  86. ul span { position: absolute; }
Add Comment
Please, Sign In to add comment