Ocena wątku:
  • 0 głosów - średnia: 0
  • 1
  • 2
  • 3
  • 4
  • 5
3rd level css menu problem
#5
(30-04-2012, 03:17)kornell napisał(a):
(30-04-2012, 00:20)Kartofelek napisał(a): add this to your css:
Kod:
.topmenu .level2 {position:relative;}
OR
Kod:
.topmenu li {position:relative;}

Element with position:absolute is positioned to the first parent element with position:relative

check this out

http://css-tricks.com/absolute-positioning-inside-relative-positioning/



Thank you both for your help the link to the positioning article has help me understand more.

However I have tried all combination of relative and absolute I can think of and none of them work.

The menu is in a clearfix class does this makes any difference ? here is the html code
Kod:
<?php if (!defined('CMS')) exit; ?>
<?php echo $this->doctypeDeclaration(); ?>

<html<?php echo $this->htmlAttributes(); ?>>
<head>
<?php
    $site->addCss(BASE_URL.THEME_DIR.THEME.'/960.css');
    $site->addCss(BASE_URL.THEME_DIR.THEME.'/site.css');
    $site->addCss(BASE_URL.THEME_DIR.THEME.'/ip_content.css');
    $site->addCss(BASE_URL.LIBRARY_DIR.'js/colorbox/themes/2/colorbox.css');
    echo $site->generateHead();
?>
    <!--[if lt IE 9]>
        <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
</head>
<body<?php if ($site->managementState()) { echo ' class="manage"'; } ?>>

    <div class="container_12 wrapper">
        <header class="grid_12">
                <img class="sitename" src="<?php echo BASE_URL.THEME_DIR.THEME; ?>/img/logo.png">
            <div class="languages">
                <?php echo $site->generateBlock('ipLanguages'); ?>
            </div>
            <?php echo $site->generateBlock('ipSearch'); ?>
            <img class="banner" src="<?php echo BASE_URL.THEME_DIR.THEME; ?>/img/header.jpg" alt="">
            <div class="topmenu clearfix">
                <?php
                    require_once (BASE_DIR.LIBRARY_DIR.'php/menu/common.php');
                    $menuTop = new Library\Php\Menu\Common();
                    echo $menuTop->generateSubmenu('top', null, 3); //$zoneName, $parentElementId, $depthLimit
                ?>
            </div>
        </header>
        <div class="main grid_9 right">
            <div class="breadcrumb">
               <?php echo $site->generateBlock('ipBreadcrumb'); ?>
            </div>
            <?php echo $site->generateBlock('main'); ?>
        </div>
        <div class="side grid_3 left">
            <nav class="collapse"><?php /* add class="collapse" to <nav> to hide second level by default */ ?>
                <?php
                    require_once (BASE_DIR.LIBRARY_DIR.'php/menu/common.php');
                    $menuTop = new Library\Php\Menu\Common();
                    echo $menuTop->generate('top');
                    echo $menuTop->generate('top', 2, 3);  //$zoneName, $parentElementId, $depthLimit
                ?>
            </nav>
            <aside>
                <?php echo $site->generateBlock('side'); ?>
            </aside>
        </div>
        <div class="clear"></div>
        <footer class="clearfix">
            <div class="grid_12 clearfix">
                <p class="left">Theme "LT pagan"</p>
                <p class="right">Drag &amp; drop with <a href="http://www.impresspages.org">ImpressPages CMS</a></p>
            </div>
        </footer>
    </div>
    <?php
        $site->addJavascript(BASE_URL.LIBRARY_DIR.'js/jquery/jquery.js');
        $site->addJavascript(BASE_URL.LIBRARY_DIR.'js/colorbox/jquery.colorbox.js');
        $site->addJavascript(BASE_URL.THEME_DIR.THEME.'/site.js');
        echo $site->generateJavascript();
    ?>
</body>
</html>

Both the css and the html are from a theme from a cms (impresspages.org). The original theme had a 2 level drop down. I modified the css for a 3 level drop down.

I had a look at this three level menu in a clearfix class:
http://css.find-info.ru/css/011/ch07lev1sec4.html

and there seems to be no relative or absolute positioning in the lower levels.

Now I am even more confused!!!

Alan
Odpowiedz


Wiadomości w tym wątku
3rd level css menu problem - przez alaneku - 29-04-2012, 15:11
RE: 3rd level css menu problem - przez Kartofelek - 29-04-2012, 19:57
RE: 3rd level css menu problem - przez alaneku - 29-04-2012, 20:39
RE: 3rd level css menu problem - przez Kartofelek - 30-04-2012, 00:20
RE: 3rd level css menu problem - przez Kartofelek - 04-05-2012, 00:01
RE: 3rd level css menu problem - przez alaneku - 04-05-2012, 17:42

Podobne wątki…
Wątek: Autor Odpowiedzi: Wyświetleń: Ostatni post
  problem z tłem pod menu loose 1 3,157 06-07-2017, 20:00
Ostatni post: loose
  problem z menu p410 10 10,343 18-06-2017, 18:34
Ostatni post: lemans88
  CSS dla menu i problem z selektorami neferith 4 5,261 30-06-2016, 00:58
Ostatni post: Brain23
  MENU - poważny problem wysokości! asus 0 2,532 05-12-2014, 23:34
Ostatni post: asus
  Trzypoziomowe menu - problem rejcz 3 5,663 25-01-2014, 17:16
Ostatni post: Kartofelek

Skocz do:


Użytkownicy przeglądający ten wątek: 1 gości
Sponsorzy i przyjaciele
SeoHost.pl