Jump to content
  • 0

Проблема с вертикальным меню


aov000
 Share

Question

Вопрос к знающим людям!

Есть вертикальное меню, а где ошибка не могу понять.

Пункт подменю(номер3) должен быть скрыт и при нажатии(номер 2) должен появляться.

<ul class="leftmenu">
<li><a href="#">номер 1</a></li>
<li><a href="#">номер 2</a>
<ul class="podmenu">
<li><a href="#">номер 3</a></li>
</ul></li>
<li><a href="#">номер 1</a></li>
</ul>

ul.leftmenu {
padding:0;
margin:0px 0 0 0px;
list-style: none;
width: 220px;
}
ul.leftmenu li {
float: left;
}
ul.leftmenu li a, ul.leftmenu li a:visited {
display: block;
padding:4px;
margin-bottom: 1px;
font-family:Tahoma, Geneva, sans-serif; text-decoration:none;
color:#94775c;
background-color:#fff;
width: 230px;
}
ul.leftmenu li a:active { text-decoration:none; text-align:center;
color:#C00;
background-color:#e8e1cb;
}

Где ошибка?

Буду признателен за помощь.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

<ul>
<li><a href="#">номер 1</a></li>
<li><a href="#">номер 2</a>
<ul>
<li><a href="#">номер 3</a></li>
</ul></li>
<li><a href="#">номер 1</a></li>
</ul>?

ul {
width: 100px;
background: #ccc;
}
li ul {
display: none;
}
li:hover ul {
display: block;
background: #fff;
}

http://jsfiddle.net/jPUj8/

Link to comment
Share on other sites

  • 0

<ul>
<li><a href="#">номер 1</a></li>
<li><a href="#">номер 2</a>
<ul>
<li><a href="#">номер 3</a></li>
</ul></li>
<li><a href="#">номер 1</a></li>
</ul>?

ul {
width: 100px;
background: #ccc;
}
li ul {
display: none;
}
li:hover ul {
display: block;
background: #fff;
}

http://jsfiddle.net/jPUj8/

MacPherson -Спасибо огромное! Очень даже просто и доходчиво!

Link to comment
Share on other sites

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

×
×
  • 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