In your custom css, create a media query that will affect widths above the size where you want the vertical menu to display.
Inside of the media query, style the list items to display as inline-block.
In larger displays you’d get the horizontal navigation. On mobile devices, the menu would revert to normal list behavior.
Then add some styling that affects both horizontal and vertical for font-size, centering, etc.
@media screen and (min-width:600px) { /*Adjust as needed*/
ul#workshop-tour-menu li {
display:inline-block;
margin-right: 20px; /*adjusts space between items*/
}
}
ul#workshop-tour-menu li {
list-style-type:none; /*removes list bullet*/
font-size: 1.5em; /*adjust font size as needed*/
padding: 5px 0; /*adds space above and below list items*/
}
ul#workshop-tour-menu {
text-align:center;
padding:0;
}
I saw that earlier! It looked great. But now it looks like you’ve change some of the css. I no longer see the horizontal list and it’s no longer centered.
The reason his is simpler is that he used css to assign the anchor elements in your code to display:block;
This puts them on a line of their own rather than their default inline-block, which allows for them to be in a line along with other things like words and other anchor elements.
My way mimics the way the regular navigation is constructed: with list elements. But that makes it more complicated too. But it looks pretty in the code
yes, Rod’s solution is working perfect
But it would be great - probably for all readers - to see how you solved it in another way
So we all will become a little bit better
Daniel’s code makes it so that all anchor elements (<a href>) inside an element with the class “tournav” (.tournav a) are set to display:block;, which changes their layout behavior as explained above.
Further, it only does that when the media query conditions are met: at browser widths that are at or below 800px.
But it requires the original code you wrote with the string of anchor elements inside of the h2. You must have had it all inside an element with the class “tournav”. Maybe <h2 class="tournav"><a href...