views:

65

answers:

2

Usually this sort of thing I can do, but today it is bugging me.

See this page at JSbin.

Essentially what I'm doing is

  • have a list of unordered items
  • they all have a link
  • jQuery loops through and makes an extra link inside the list item, which is expanded to the whole list item using CSS
  • this gives users a larger place to click

For some reason, the child link seems to be coming out of the parent, despite the parent having position: relative.

What have I done wrong? Many thanks.

+2  A: 

Your problem is that the parent <li> is an inline-box.

To fix it, replace display: inline-box with float: left.

SLaks
Oh, can't use `inline-block` and `position: relative` ? Shame...
alex
I ended up removing the Mozilla vendor prefix'd property, and not having to resort to floats.. see my answer. Thanks for your help.
alex
+1 there you go SLaks... however I believe your answer is more of a workaround then a proper solution. The way I ended up handling it seems better.
alex
+2  A: 

I removed the display: -moz-inline-box; and it worked perfectly!

alex
yup, new thing to learn :-) +1
infant programmer