AWESOME
Wrapping Up
From creating the icons to building the menu, we saw how to create, using CSS and a minimal HTML code, a fully functional responsive menu. Before we end, here is a sum-up of the whole code we used. I am gonna highlight only the important parts.
The HTML code:
<nav>
<input type="checkbox" role="button" aria-label="Display the menu" aria-expanded="false" aria-controls="menu">
<ul id="menu">
<li><a href="..">Menu Item 1</a></li>
<li><a href="..">Menu Item 2</a></li>
<!-- ... -->
</ul>
</nav>
The CSS code:
/* the CSS code to style the menu for big screens */
nav { ... }
nav ul { ... }
nav ul li a { ... }
nav ul li a:hover { ... }
/**/
nav input {
/* the CSS style for the hamburger icon */
display: none; /* hide the input on big screen */
-webkit-appearance:none;
-moz-appearance:none;
appearance:none;
cursor:pointer;
}
nav input:checked {
/* the CSS style for the close icon */
}
@media (max-width:600px) { /* update the max-width as you want */
/* the CSS code to style the menu for mobile screen */
nav { ... }
nav ul {
display: none; /* hide the menu on mobile */
}
nav ul li a { ... }
nav ul li a:hover { ... }
/**/
nav input {
display: block; /* show the icons on mobile */
}
/* show the menu on checked */
nav input:checked + ul {
display: block;
}
}
The above code is a kind of “pseudo-code” to highlight the main ideas we used in this article. In a real example, you may need to use a slightly different code like in the last example where I used transform / opacity instead of display to toggle the visibility.
If you want to ensure your site is running optimally, now’s the time to consider speed-optimized web hosting. At Verpex we offer web hosting plans suitable for businesses of any scale.
Frequently Asked Questions
How do I choose a design for my website?
One of the most important things when creating a website for your art is the design. Even though your pieces of art might be amazing, people will leave if your site is hard to navigate. This is why it’s important that the site is easy on the eyes and easy to navigate.
Can WordPress be used for eCommerce?
WordPress offers many different ways to build an eCommerce online store for all types of products and markets. Almost 40 percent of all online shops are powered by WooCommerce, a WordPress eCommerce plugin.
How much traffic can shared hosting handle?
Shared hosting serves multiple sites on a single server. The costs of this type of web hosting are low since the users utilize the resources on a single server.
Can you migrate my existing website over?
Yes, and without issue. Regardless of how many websites you’re managing, we’ll bring all of them under the Verpex wing free of charge. Just send us the details of your websites when you’ve signed up to get started.