To make it convenient to navigate the site, you need navigation, which I did using HTML and CSS scripts. As a result of my work, you can see 2 types of menus (vertical and horizontal). And now, I’ll try to talk about the tasks that, in my opinion, a menu for a site should perform:

  • Ease of use;
  • Navigation must be created for all sections of the site;
  • Each page of the site should have a link to the main page;
  • Go to any page of the site in a maximum of 3 clicks.

Here I will try to present as much material as possible on creating a menu, get ready, many may have difficulties, at least I did. And so let's begin!

First of all, I'll tell you how to do it. First we write the script in the style sheet:

#navigation ( width: 560px; height: 50px; margin: 0; padding: 0; background-image: url(img/gor_menu.jpg); background-repeat: no-repeat; background-position:center; ) #navigation ul ( list-style: none; margin: 0; padding: 0; ) #navigation ul li ( display: inline; margin: 0px; ) #navigation ul li a ( height:28px; display: block; float: left; color: #333333; text-decoration: none; font-size: 12px; background-image: url(img/menu_separatorline.jpg); position: right center; padding-right: 15px; padding-bottom: 0; padding-left: 15px; /button_hover.jpg); background-repeat: repeat-x; background-position: left top; ) #navigation ul li#active a ( background-image: url(img/button_hover.jpg); background-repeat: repeat-x ; background-position: left top;

Don't be alarmed, there's nothing wrong with this code. To make it clearer for you, I’ll immediately write the HTML code for this menu:

As you can see, we are dealing with a list, which without a style sheet is nothing worthwhile. The div operator calls variables from the external CSS style sheet, then our list is transformed and turns into something pretty in my opinion horizontal menu.

Now we need to explain a little what this refers to, then I think you’ll figure it out on your own:

— contains the entire menu structure. The top image, which I prepared in advance in Photoshop, will be inserted into it;

— the body of the menu, contains an unordered list. An image will be inserted into it, which will be repeated vertically and create a background. Maybe I chose too bright colors, but in my opinion they do not hurt the eyes;

— contains the frame of the menu itself;

  • Creating a site menu
  • — this is one of the positions where you will need to insert the necessary link into a href="#";


    Close