0

I'm trying to stretch the menu, almost like it's been done here: Stretch horizontal ul to fit width of div

Only I'm trying to make it so that the actual texts, are to the very left and right (now their containing li are stretched, but the text is centered.

Any ideas och links to examples? :) CSS/or table doesn't matter, as long as it works in all browsers :)

like this: http://www.alisso.se/wordpress/uploads/2012/05/spread-menu.png

Community
  • 1
  • 1
Alisso
  • 1,861
  • 1
  • 17
  • 32
  • Do you mean like this http://jsfiddle.net/trickeedickee/q3XPQ/ with the links left aligned? I'm a bit confused by your question. – frontendzzzguy May 05 '12 at 13:52
  • almost like that I would like the actual words, instead of their surrounding grey area, to be equally distributed as their containers are, only the first word should be to the very left, and the last on should be to the very right I'll show you an image! – Alisso May 10 '12 at 09:28
  • [link](http://www.alisso.se/wordpress/uploads/2012/05/spread-menu.png) – Alisso May 10 '12 at 09:49
  • 1
    So what you want is for the first and last li element to have left/right text aligns, so that the text is floating to its parent margin? Left|Center|Center|Center|Right? – Daniel May 10 '12 at 09:59

1 Answers1

2

I have set up a jsfiddle for you which will achieve the style you want http://jsfiddle.net/trickeedickee/Kkngn/ I used extra classes of first and last. I could have used :first-child and :last-child but didn't want to overcomplicate it for you.

Let me know if this works and if not I'll help out some more.

frontendzzzguy
  • 3,242
  • 21
  • 31
  • that is so cool, it really works. I fully understand :first.child & :last-child, though I know in some browsers last-child just doesn't work some times, so this is fantastic. I don't see why I didn't think of doing it this way! Thank you so much! :D – Alisso May 10 '12 at 22:51
  • I'm nearly sure it does. I'll check at work tomorrow. I'm happy to help and hopefully this solution can help others with the same or similar problems. – frontendzzzguy May 10 '12 at 22:55