I want to create a second menu through ul li a , but it has completely different styles and design. What do i do? I tried to connect a separate php-page, and to it directly the second style sheet with the description of the same ul li a , as a result, the second style sheet breaks my first menu.

  • Well, create a menu and list them with the appropriate css styles. Change style names. - Jean-Claude
  • Give these menus different classes and access them through a class eg. sidebar-menu li {color: red;} .menu li {color: blue;} - Kirya
  • But how to deal with a.hover {when I prescribe styles for it spoils the first menu menu - Sanya

2 answers 2

Add an identifier or class to the root menu and set styles starting from this identifier / class. eg:

 <ul class="first"> <li><a href=""></a></li> <li><a href=""></a></li> </ul> <ul class="second"> <li><a href=""></a></li> <li><a href=""></a></li> </ul> .first li a { font-size: 10px; } .second li a { font-size: 20px; } 
  • I'm going to try now. thank you very much! - Sanya

Create another html markup, other classes / identifiers, list the styles. Example:

 .menu li { color: blue; } .menu2 li { color: green; list-style-type: square; } 
 <div class="menu"> Меню 1 <ul> <li>Пункт 1,1</li> <li>Пункт 1,1</li> </ul> </div> <div class="menu2"> Меню 2 <ul> <li>Пункт 1,1</li> <li>Пункт 1,1</li> </ul> </div>