Design and CSS styles
Version 6.x > Design and CSS styles > Css with cms menu View modes: 
User avatar
Member
Member
hungquang_itsyad-yahoo.com - 11/30/2012 4:08:15 AM
   
Css with cms menu
Hi all, I have menu in html code:
<ul>
<li><a href=""><em></em>About</a></li>
<li><a href=""><em></em>Services</a></li>
<li><a href=""><em></em>Products</a></li>
<li><a href=""><em></em>Contact</a></li>
<li><a href=""><em></em>FaQ</a></li>
</ul>

I using cms:menu or cms:listmenu to load MenuItem, but it have not <em><em> tag

But in my css file, i have code:

li.current a em,li a:hover em{width:6px; height:13px; position:absolute; z-index:2; left:0; top:1px; background:#c07701}

If i using cms:menu of cms:listmenu, my website in kentico and html design is different.
How can I fix problem with <em></em>?

Thank!

User avatar
Kentico Support
Kentico Support
kentico_janh - 11/30/2012 5:36:32 AM
   
RE:Css with cms menu
Hello,

Those navigation web parts are hardcoded and you can't easily add there any extra HTML element. If you need this exact HTML code to be rendered, please use the Repeater web part (or any other web part which can work with documents and uses transformations for rendering its HTML code) and specify the HTML structure in the transformation. If you need to render more than one level of document hierarchy in your menu (multi-level menu), please follow instructions in this article.

Best regards,
Jan Hermann

User avatar
Member
Member
hungquang_itsyad-yahoo.com - 12/21/2012 4:38:02 AM
   
RE:Css with cms menu
Hi all,

I find http://www.richdad.com using Kentico 6.
Menu in this site have code with <span> tag.

How do they do that?
<div class="navbar">
<div class="width">

<div id="p_lt_zoneNavBar_rdcomhorizontalimagemenu_repItems_ctl00_pnlMenuItem" class="NavButton ">
<a id="p_lt_zoneNavBar_rdcomhorizontalimagemenu_repItems_ctl00_lnkMenuItem" href="/About.aspx">About<span>Rich Dad, Robert, Kim</span></a>
</div>

<div id="p_lt_zoneNavBar_rdcomhorizontalimagemenu_repItems_ctl01_pnlMenuItem" class="NavButton ">
<a id="p_lt_zoneNavBar_rdcomhorizontalimagemenu_repItems_ctl01_lnkMenuItem" href="/Rich-Dad-Games.aspx">Games<span>CASHFLOW® Online, 101</span></a>
</div>

<div id="p_lt_zoneNavBar_rdcomhorizontalimagemenu_repItems_ctl02_pnlMenuItem" class="NavButton ">
<a id="p_lt_zoneNavBar_rdcomhorizontalimagemenu_repItems_ctl02_lnkMenuItem" href="/radio.aspx">Radio<span>Listen to Rich Dad Radio</span></a>
</div>

<div id="p_lt_zoneNavBar_rdcomhorizontalimagemenu_repItems_ctl03_pnlMenuItem" class="NavButton NavButton Current">
<a id="p_lt_zoneNavBar_rdcomhorizontalimagemenu_repItems_ctl03_lnkMenuItem" href="/Programs.aspx">Programs<span>Get a coach. Take a class.</span></a>
</div>

<div id="p_lt_zoneNavBar_rdcomhorizontalimagemenu_repItems_ctl04_pnlMenuItem" class="NavButton ">
<a id="p_lt_zoneNavBar_rdcomhorizontalimagemenu_repItems_ctl04_lnkMenuItem" href="/Resources.aspx">Resources<span>Updates, Events, Blog</span></a>
</div>

<div id="p_lt_zoneNavBar_rdcomhorizontalimagemenu_repItems_ctl05_pnlMenuItem" class="NavButton ">
<a id="p_lt_zoneNavBar_rdcomhorizontalimagemenu_repItems_ctl05_lnkMenuItem" class="Cart" href="/Store.aspx">Store<span>Books, CDs, DVDs</span></a>
</div>

<div id="p_lt_zoneNavBar_rdcomhorizontalimagemenu_repItems_ctl06_pnlMenuItem" class="NavButton ">
<a id="p_lt_zoneNavBar_rdcomhorizontalimagemenu_repItems_ctl06_lnkMenuItem" href="/CommunityRegister.aspx">Community<span>Register</span></a>
</div>

<div class="clear">
</div>
</div>
</div>

User avatar
Kentico Support
Kentico Support
kentico_janh - 12/22/2012 3:46:56 AM
   
RE:Css with cms menu
Hello,

That is because he followed instructions in the article below and he made its own menu structure:

Creating a Mega Menu (step by step)

Best regards,
Jan Hermann

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 1/24/2013 5:58:46 PM
   
RE:Css with cms menu
I've created a custom cmslistmenu web part that parses out all the rendered text and place a span tag inside the a tag. If you're interested I'll post the code

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 1/29/2013 3:37:50 AM
   
RE:Css with cms menu
Here it is in the Marketplace as a webpart you can import into your site

User avatar
Kentico Support
Kentico Support
kentico_janh - 1/29/2013 5:16:39 AM
   
RE:Css with cms menu
Hello,

Great, I'll definitely try it! Thanks for it!

Best regards,
Jan Hermann