Hiding elements with CSS only In the following markup without changing it or using JS, implement the behavior to show only the ul element of div which name is clicked in the first ul (before div). Name is content of li in top ul and it matches the content of the first li in ul you want to show. Elements that have {content} are just fillers and have no meaning for problem.

&lt;ul&gt;
  &lt;li class="head"&gt;&lt;a href="#favorites"&gt;Favourite dishes&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="#breakfasts"&gt;&lt;i&gt;Breakfasts&lt;/i&gt;&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="#dinners"&gt;&lt;i&gt;Dinners&lt;/i&gt;&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="#suppers"&gt;&lt;i&gt;Suppers&lt;/i&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
    &lt;ul id="breakfasts"&gt;
       &lt;li class="head"&gt;Breakfasts&lt;/li&gt;
       &lt;li&gt;{Breakfast 1}&lt;/li&gt;
       &lt;li&gt;{Breakfast 2}&lt;/li&gt;
       &lt;li&gt;{Breakfast 3}&lt;/li&gt;
    &lt;/ul&gt;
    &lt;ul id="dinners"&gt;
       &lt;li class="head"&gt;Dinners&lt;/li&gt;
       &lt;li&gt;{Dinner 1}&lt;/li&gt;
       &lt;li&gt;{Dinner 2}&lt;/li&gt;
       &lt;li&gt;{Dinner 3}&lt;/li&gt;
    &lt;/ul&gt;
    &lt;ul id="suppers"&gt;
       &lt;li class="head"&gt;Dinners&lt;/li&gt;
       &lt;li&gt;{Supper 1}&lt;/li&gt;
       &lt;li&gt;{Supper 2}&lt;/li&gt;
       &lt;li&gt;{Supper 3}&lt;/li&gt;
    &lt;/ul&gt;
    &lt;ul class="favorites"&gt;
       &lt;li class="head"&gt;Favourites&lt;/li&gt;
       &lt;li&gt;{Favourite 1}&lt;/li&gt;
       &lt;li&gt;{Favourite 2}&lt;/li&gt;
       &lt;li&gt;{Favourite 3}&lt;/li&gt;
    &lt;/ul&gt;
&lt;/div&gt;


This problem really has the solution and was very interesting for me, so I decided to post it here even if it's not very practical.
Hint: you have to use :target pseudo-class.
I think your hint gave too much away:

div&gt;ul:target{
   display: block;
}
div&gt;ul{
   display: none;
}