Jump to content
  • 0

помогите с кодом


fil667
 Share

Question

здравствуйте, помогите пожалуйста с кодом, мне нужно сделать сложное
горизонтальное меню нужно что-бы кнопки первого уровня не растягивались
и все остальное появлялось при наведении на кнопку первого уровня
код разметки. Заранее благодарен за ваше потраченное время

<menu id="menu">	       <li class="red">блабла		     <ul>			   <h3 class="cat">Категория</h3>			 			  <li>второй уровень</li>			 </ul>			</li>		     		   <li class="green">блабла</li>		   <li class="orang">блабла</li>		   <li class="blue">блабла</li>		   <li class="aqua">блабла</li>		   <li class="chid">блабла</li>		   <li class="groen">блабла</li>		   <li class="gray">блабла</li>		   <li class="yellow">блабла</li></menu>

вот css к нему

li{list-style:none outside none;}#menu{color:#000;list-style: none outside none;display:table;margin:0px -40px;padding:opx;font:15pt "sans-serif";text-shadow:0 0 1px red;width:100%;}#menu  li{float:none;position:relative;display:table-cell;background: none repeat scroll 0 0 #fffb92;padding:8px 0px;border-radius:0 20px;text-align:center;width:11.1%} #menu .red:hover{background: #ff5555; /* Old browsers */color:#fff;border-radius:20px 0px;transition: all 0.5s ease-in-out 0.2s;-moz-transition: all 0.3s ease-in-out 0.2s;-ms-transition: all 0.3s ease-in-out 0.2s;-o-transition: all 0.3s ease-in-out 0.2s;-webkit-transition: all 0.3s ease-in-out 0.2s;} #menu .green:hover{color:#fff;border-radius:20px 0px;transition: all 0.5s ease-in-out 0.2s;-moz-transition: all 0.3s ease-in-out 0.2s;-ms-transition: all 0.3s ease-in-out 0.2s;-o-transition: all 0.3s ease-in-out 0.2s;-webkit-transition: all 0.3s ease-in-out 0.2s;} #menu .orang:hover{background: #ffc255; /* Old browsers */color:#fff;border-radius:20px 0px;transition: all 0.5s ease-in-out 0.2s;-moz-transition: all 0.3s ease-in-out 0.2s;-ms-transition: all 0.3s ease-in-out 0.2s;-o-transition: all 0.3s ease-in-out 0.2s;-webkit-transition: all 0.3s ease-in-out 0.2s;} #menu .blue:hover{background: #5555ff; /* Old browsers */color:#fff;border-radius:20px 0px;transition: all 0.5s ease-in-out 0.2s;-moz-transition: all 0.3s ease-in-out 0.2s;-ms-transition: all 0.3s ease-in-out 0.2s;-o-transition: all 0.3s ease-in-out 0.2s;-webkit-transition: all 0.3s ease-in-out 0.2s;} #menu .aqua:hover{background: #00ffff; /* Old browsers */color:#fff;border-radius:20px 0px;transition: all 0.5s ease-in-out 0.2s;-moz-transition: all 0.3s ease-in-out 0.2s;-ms-transition: all 0.3s ease-in-out 0.2s;-o-transition: all 0.3s ease-in-out 0.2s;-webkit-transition: all 0.3s ease-in-out 0.2s;} #menu .chid:hover{background: #a044cc; /* Old browsers */color:#fff;border-radius:20px 0px;transition: all 0.5s ease-in-out 0.2s;-moz-transition: all 0.3s ease-in-out 0.2s;-ms-transition: all 0.3s ease-in-out 0.2s;-o-transition: all 0.3s ease-in-out 0.2s;-webkit-transition: all 0.3s ease-in-out 0.2s;} #menu .groen:hover{background: #802b2b; /* Old browsers */color:#fff;border-radius:20px 0px;transition: all 0.5s ease-in-out 0.2s;-moz-transition: all 0.3s ease-in-out 0.2s;-ms-transition: all 0.3s ease-in-out 0.2s;-o-transition: all 0.3s ease-in-out 0.2s;-webkit-transition: all 0.3s ease-in-out 0.2s;} #menu .gray:hover{background: #4c4c4c; /* Old browsers */color:#fff;border-radius:20px 0px;transition: all 0.5s ease-in-out 0.2s;-moz-transition: all 0.3s ease-in-out 0.2s;-ms-transition: all 0.3s ease-in-out 0.2s;-o-transition: all 0.3s ease-in-out 0.2s;-webkit-transition: all 0.3s ease-in-out 0.2s;}#menu .yellow:hover{background: #ffdd00; /* Old browsers */color:#fff;border-radius:20px 0px;transition: all 0.5s ease-in-out 0.2s;-moz-transition: all 0.3s ease-in-out 0.2s;-ms-transition: all 0.3s ease-in-out 0.2s;-o-transition: all 0.3s ease-in-out 0.2s;-webkit-transition: all 0.3s ease-in-out 0.2s;}#menu li ul{display:table-cell;list-style:outside none none;}#menu li ul .cat{display:table;margin-top:20px;}
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Similar Content

    • By Andrew_007
      Здравствуйте!
      Я совсем новичок в верстке, помогите разобраться в вопросе.
       
      Когда создаем горизонтальное меню с помощью float то float и margin нужно указывать для селектора <li> или можно для<a>?
      Проверял - работает и так и так. Как будет правильно или вообще без разницы?  1.Так правильно? .social_buttoms li {float: left;margin-right: 14px;}.social_buttoms a {display: block;width: 32px;height: 32px;background: url(../images/social_sprite.png) no-repeat;}  2.Или так?.social_buttoms a {float: left;margin-right: 14px;display: block;width: 32px;height: 32px;background: url(../images/social_sprite.png) no-repeat;}  Заранее спасибо за ответ.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy