1 Replies - 352 Views - Last Post: 01 June 2012 - 04:52 PM

#1 wama_mms  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 54
  • Joined: 06-May 12

problem in margins

Posted 01 June 2012 - 06:24 AM

hello I have a CSS code as following
span.dropt {border-bottom: thin dotted; text-align:center;}
span.dropt:hover {text-decoration: none; background: #ffffff;}

span.dropt span {position: absolute; left: -9999px;
  margin: 0px 0 0 0px; padding: 3px 3px 3px 3px;
  border-style:solid; border-color:black; border-width:1px; z-index: 6; width:80px;}
  
span.dropt:hover span {left: 2%; background: #ffffff;} 
span.dropt span {position: absolute; left: -9999px;
  margin: 4px 0 0 0px; padding: 3px 3px 3px 3px; 
  border-style:solid; border-color:black; border-width:1px;}
span.dropt:hover span {margin: 20px auto auto 240px; background: #3CF;} 


and html code
<span class="dropt" title="">formal description<span><b>Protein</b><br/><a href="#">more..</a> </span></span>test !!!

<span class="dropt"><cons sem="protein">Mybbp1a</cons><span><b>Protein</b><br/><a href="#">more..</a></span></span>


when I click at the second word the margin still static and appears at the first word as the following pictures:
the first pic. when I mouse over the first word
Posted Image
and this pic. when I mouse over the other word
Posted Image
I want when I mouse over any word the subset list appear under it
thanks

Is This A Good Question/Topic? 0
  • +

Replies To: problem in margins

#2 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 2898
  • View blog
  • Posts: 7,552
  • Joined: 08-June 10

Re: problem in margins

Posted 01 June 2012 - 04:52 PM

the problem is position: absolute combined with your margin. and since their containing block is on equal position with its left side, there is no reason for the "popup" to take a position relative to the triggering span.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1