Jump to content
  • 0

Вопрос по CSS


dvf
 Share

Question

На данном сайте взял исходник на Dropdown Menus -> Centered - это zip-архив.

Его содержимое в части CSS:


/* ================================================================
This copyright notice must be untouched at all times.

The original version of this stylesheet and the associated (x)html
is available at http://www.cssmenus.co.uk
Copyright (c) 2009- Stu Nicholls. All rights reserved.
This stylesheet and the associated (x)html may be modified in any
way to fit your requirements.
=================================================================== */
ul#menu {padding:0; list-style:none; background:url(back.gif); text-align:center; margin:0 auto; font-size:11px; font-family:arial, sans-serif; height:41px; width:1000px; position:absolute; left:0; top:139px;}
ul#menu ul {padding:0; margin:0; list-style:none; position:absolute; left:-9999px;}
ul#menu table {border-collapse:collapse; font-size:1em; float:left; margin:-1px;}

ul#menu ul li {float:left; margin:0; text-align:left;}
ul#menu ul li a {display:block; line-height:20px; margin:0; padding:0 10px; background:transparent; width:150px;}

ul#menu li {display:inline; margin:0 -2px; text-align:left;}
ul#menu li a {display:inline-block; height:36px; margin:5px 0 0 0;padding:0 20px 0 0; background:url(button.gif) right top; line-height:30px; text-decoration:none; color:#000;}
ul#menu li a.sub {background:url(button-arrow.gif) right top;}

html>/**/body ul#menu li {display:inline-block; padding:0;}

* html ul#menu li a.sub {margin-right:3px;}
* html ul#menu li a {margin-bottom:-4px;}

ul#menu li a b {display:block; height:36px; float:left; padding:0 0 0 20px; background:url(button.gif) left top; cursor:pointer;}

ul#menu li a:hover {position:relative; background-position:right bottom; color:#fff;}
ul#menu li a:hover b {background-position:left bottom;}

ul#menu li:hover {position:relative;}
ul#menu li:hover > a {background-position:right bottom; color:#fff;}
ul#menu li:hover > a b {background-position:left bottom;}

ul#menu :hover ul {left:1px; width:105px; top:41px;}
* html ul#menu :hover ul {top:36px;}

ul#menu :hover ul li {display:block; float:left; margin:0; border-bottom:1px solid #fff;}
ul#menu :hover ul li a {display:block; float:left; margin:0; height:25px; line-height:25px; width:95px; background:#ddd; color:#000;}
ul#menu :hover ul li a.fly {background:#ddd url(arrow.gif) no-repeat right center;}
ul#menu :hover ul li a:hover {background:#c60; color:#fff;}
ul#menu :hover ul li:hover > a {background:#c60; color:#fff;}

ul#menu :hover ul li a.fly:hover {background:#c60 url(arrow-over.gif) no-repeat right center;}
ul#menu :hover ul li:hover > a.fly {background:#c60 url(arrow-over.gif) no-repeat right center;}

ul#menu :hover ul ul {left:-9999px;}

ul#menu :hover ul :hover ul {left:105px; top:0; width:150px;}

ul#menu :hover ul :hover ul li {display:block; float:left; margin:0; border-bottom:1px solid #fff;}
ul#menu :hover ul :hover ul li a {display:block; float:left; margin:0; height:25px; line-height:25px; background:#bbb; color:#000;}
ul#menu :hover ul :hover ul li a:hover {color:#fff; background:#840;}

и в части HTML:


<ul id="menu">
<li><a href="index.html"><b>Home</b></a></li>
<li><a href="single.html"><b>Single Level</b></a></li>
<li class="current"><a class="sub" href="dropdown.html"><b>Dropdown</b><!--[if gte IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]-->
<ul class="sub1">
<li><a class="fly" href="#url">Dropdown one<!--[if gte IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]-->
<ul class="fly1">
<li><a href="#url">Dropdown 1.1</a></li>
<li><a href="#url">Dropdown 1.2</a></li>
<li><a href="#url">Dropdown 1.3</a></li>
<li><a href="#url">Dropdown 1.4</a></li>
<li><a href="#url">Dropdown 1.5</a></li>
<li><a href="#url">Dropdown 1.6</a></li>
</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
</li>
<li class="currentsub"><a class="fly" href="#url">Dropdown two<!--[if gte IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]-->
<ul class="fly2">
<li><a href="#url">Dropdown 2.1</a></li>
<li><a href="#url">Dropdown 2.2</a></li>
<li class="currentfly"><a href="#url">Dropdown 2.3</a></li>
<li><a href="#url">Dropdown 2.4</a></li>
<li><a href="#url">Dropdown 2.5</a></li>
</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
</li>
<li><a href="#url">Dropdown three</a></li>
<li><a href="#url">Dropdown four</a></li>
<li><a class="fly" href="#url">Dropdown five<!--[if gte IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]-->
<ul class="fly3">
<li><a href="#url">Dropdown 5.1</a></li>
<li><a href="#url">Dropdown 2.2</a></li>
<li><a href="#url">Dropdown 3.3</a></li>
</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
</li>
</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
</li>
<li><a class="sub" href="dropline.html"><b>Dropline</b><!--[if gte IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]-->
<ul class="sub2">
<li><a href="#url">Dropline one</a></li>
<li><a href="#url">Dropline two</a></li>
<li><a href="#url">Dropline three</a></li>
<li><a href="#url">Dropline four</a></li>
<li><a href="#url">Dropline five</a></li>
<li><a href="#url">Dropline six</a></li>
</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
</li>
<li><a class="sub" href="flyout.html"><b>Flyout</b><!--[if gte IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]-->
<ul class="sub3">
<li><a href="#url">Flyout one</a></li>
<li><a href="#url">Flyout two</a></li>
<li><a href="#url">Flyout three</a></li>
<li><a href="#url">Flyout four</a></li>
</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
</li>
<li id="support"><a href="support.html"><b>Support</b></a></li>
<li id="contact"><a href="contact.html"><b>Contact</b></a></li>
</ul>

Вопрос: как сделать меню третьего уровня?

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Ужасная разметка!

Что конкретно не можете?

<ul class="menu_lvl1">
<li class="item_lvl1"></li>
<li class="item_lvl1">
<ul class="menu_lvl2">
<li class="item_lvl2"></li>
<li class="item_lvl2">
<ul class="menu_lvl3">
<li class="item_lvl3"></li>
<li class="item_lvl3"></li>
</ul>
</li>
</ul>
</li>
</ul>

Попробуйте так и не набивайте специфичность.

Edited by zSpx
Link to comment
Share on other sites

  • 0

Я же написал, что это не мое и я в новичках числюсь... Что-то в этом роде пробовал. Но не получается. Спасибо за ответ.

Что-то мне подсказывает, что тут надо в CSS создать правило для еще одного уровня вложения...

Edited by dvf
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