I am trying to add a div inside a menu bar, it gets added but it gets displayed below the menu bar. I have added the div as given below in topmenu.phtml:

<?php $_menu = $this->getHtml('level-top') ?>
<?php if($_menu): ?>
<div class="nav-container">
    <ul id="nav">
        <?php echo $_menu ?>
    <div class="nav" style="background-color:red; width:100px; height:100%; float:right;">
<?php endif ?>

If this is not the right way to add a div, is their any other way?


  • inside menu bar?? Exactly where?? if have fresh magento copy then just put DOM code Feb 4, 2017 at 7:33
  • Question is, what do you want to do with the div? But in all cases: don't use inline CSS. Feb 4, 2017 at 8:28
  • I want to add my cart and checkout in that div.
    – Birju
    Feb 4, 2017 at 9:10
  • check app/design/frontend/rwd/default/template/page/html/topmenu/renderer.phtml Feb 4, 2017 at 9:21

1 Answer 1


Not a good idea try to do it in the template. You should extend the Mage_Page_Block_Html_Topmenu class.

Note that app/design/frontend/rwd/default/template/page/html/topmenu/r‌​enderer.phtmlis an RWD template, there isn't in all themes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.