How to set up smartphones and PCs. Informational portal
  • home
  • Windows Phone
  • How to create horizontal menu in html. Great overview of beautiful layered menus with codepen

How to create horizontal menu in html. Great overview of beautiful layered menus with codepen

Hello dear readers of my blog! Today's article will be very useful for novice layout designers. Since today we will be creating a simple horizontal menu with you. Before we proceed directly to the layout, I want to say a few words about why I decided to choose this particular topic for the article.

In fact, everything is quite simple, when I was thinking about the topic of the next lesson for the site, I began to remember and analyze my experience of studying layout, what I had to face at the initial stage of becoming myself as a layout designer, which was most incomprehensible to me when studying this area etc. I asked myself all these questions in order to better understand what might be of interest to a person who starts his journey as a layout designer. And for me personally, as soon as I started to study layout, the most questions arose about the layout of various menus, especially when it comes to multi-level menus. And so today we will talk about the menu, and more specifically about the horizontal menu. So here we go!

Let's start the layout of our horizontal menu!

As you probably guess, the first thing we need to do is create an html page with standard markup and connect the stylesheet to it. I will not dwell on this step in detail, since I still hope that you are not beginner enough to tell you in detail what body and head are and how styles are connected. I will just say that in addition to the styles for our menu, I will write the simplest reset to the css file in order to reset the styles and achieve the same indentation in all browsers. This is how my simplest reset looks like:

I will not say anything in detail about resetting styles either, since in fact this is a topic for another article, the only thing you need to know about the above code is that thanks to this code, all page elements that we will write will have their margins and margins reset to zero. padding, this must be done in order for our page to look the same in all browsers.

So what do we have at this stage? We have a html page with standard markup:

Horizontal menu

And we have a stylesheet connected to this page (mine is style.css), with the following content:

The next step is to create the html markup for our menu.

How to create the markup for the menu

In our markup we will use a new tag

Top related articles