1

I'm using LESS. I designed my <li>s, with every proceedings, taking a different id with a PHP loop. And in CSS I've written a code like:

  li.page-2{
    margin-left: 15px;
  }

  li.page-3{
    margin-left: 25px;
  }

  li.page-4{
    margin-left: 22px;
  }

  li.page-5{
    margin-left: 18px;
  }

  ...

I've two questions regarding this, so, first of all, I want to share my intention: Circular Menu Design

I want to design a dynamic circular menu like this.

Q#1: How can I minimize the CSS coding dynamically, as I'm actually first, increasing the value, and after some places, decreasing the value of margin-left.
Q#2: Is there any other way I can do such circular dynamic menu?

Ravimallya
  • 6,550
  • 2
  • 41
  • 75
Mayeenul Islam
  • 4,532
  • 5
  • 49
  • 102
  • Will there always be the same number of options? This would affect whether you needed to also dynamically set what percentage of the circle the
  • elements took up.
  • – Sinister Beard Jan 28 '14 at 08:12
  • possible duplicate of [Creating a Radial Menu in CSS](http://stackoverflow.com/questions/13132864/creating-a-radial-menu-in-css) – epoch Jan 28 '14 at 08:15
  • @epoch How is that a duplicate? – Mr. Alien Jan 28 '14 at 08:19
  • The best way is to style the menu from javascript, so you can dynamically set the styles based on the number of child elements in that list. – Shiva Avula Jan 28 '14 at 08:22
  • 1
    @ScriptShiva I disagree. OP may end up with unused CSS selectors, but it would be a lot quicker and easier than dynamically creating the menu on each page load. – mikedidthis Jan 28 '14 at 09:04