1

I would like to make a menu in such a way that each item in the menu would be a separate tile (look attachment) enter image description here

It's possible? I have already code:

<?php 

  $my_menu = array( 
  'menu' => 'menu-oferta',
  'container' => 'padding-offer',
  'items_wrap' => '%3$s'

  );




  wp_nav_menu( $my_menu );



?>

but I need a class that will be between separating LI, preferably a DIV. I would like to achieve this effect

  <div class="class">

 <li class=""> 

  <a href=""> LINK 1 </a>

 </li>

</div>
4
  • 1
    This is certainly possible, it's just a matter of styling, which is a CSS thing. I don't see the need for a div though? Just make the li elements and a elements display:block then either float them or use grid layout to make them square and appear in a grid
    – Tom J Nowell
    Commented Jul 23, 2018 at 19:18
  • it will not help me. I need a DIV because I need to set PADDING for these tiles. Because if I set Padding for LI it's just inside. And I don't want them to touch each other. Other ideas?
    – Simon
    Commented Jul 23, 2018 at 19:44
  • 1
    Grid would let you specify margin between them. Even floating would let you put margin on them to keep them from touching.
    – WebElaine
    Commented Jul 23, 2018 at 20:47
  • .li { margin: 5px; float:left; } a { display: block; width:100px; height:100px; } would do the trick? It's a crude version of a proper solution, but it works. The div is not necessary, and there are multiple ways to do it without one
    – Tom J Nowell
    Commented Jul 23, 2018 at 21:01

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.