Design and CSS styles
Version 6.x > Design and CSS styles > CSS List Menu View modes: 
User avatar
Member
Member
aditya_kadam7-yahoo.co - 4/9/2012 1:04:07 AM
   
CSS List Menu
Hi..,
I have used a CSS List Menu as a main menu. The problem i'm facing is that i'm unable to apply CSS class to each anchor tag in <li>. Please give me the solution

Sample Code :
<div>
<ul>
<li>
<a href="/technical/home.aspx" class="">Home</a>
</li>
</ul>
</div>

Here i need to add different css classes to each <a> tag

Regards,
Aditya Kadam

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 4/9/2012 2:20:28 AM
   
RE:CSS List Menu
Hi,

CSS list menu web part has a property Render CSS classes . If you check it css class CMSListMenuLI will be available for li elements.

Best regards,
Ivana Tomanickova

User avatar
Member
Member
aditya_kadam7-yahoo.co - 4/9/2012 3:17:23 AM
   
RE:CSS List Menu
Hi Ivana,
I just want to set the class of <a> tag., but not the <li> tag
Sample Code
<ul>
<li>
<a href=#" class="home">Home</a>
</li>
</ul>
<ul>
<li>
<a href=#" class="flowers">Flowers</a>
</li>
</ul>
<ul>
<li>
<a href=#" class="gifts">Gifts</a>
</li>
</ul>

Plz reply asap

Regards,
Aditya

User avatar
Member
Member
aditya_kadam7-yahoo.co - 4/9/2012 3:19:18 AM
   
RE:CSS List Menu
Hi Ivana,

I just want to set the class of <a> tag., but not the <li> tag
Sample Code
<ul>
<li>
<a href=#" class="home">Home</a>
</li>
<li>
<a href=#" class="flowers">Flowers</a>
</li>
<li>
<a href=#" class="gifts">Gifts</a>
</li>
</ul>

Plz reply asap

Regards,
Aditya

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 4/9/2012 4:26:57 AM
   
RE:CSS List Menu
Hi,

you would need to implement a custom web part for this. But you can assign a different css class to each document displayed by web part - Menu item CSS class setting in the Properties of document - >Menu section. Then in your css stylesheet you could use class inheritance, for example:
.green a{}

.blue a{}

Best regards,
Ivana Tomanickova

User avatar
Member
Member
aditya_kadam7-yahoo.co - 4/11/2012 1:02:10 AM
   
RE:CSS List Menu
Hi Ivana,

I have set Class as DocumentName to overcome this issue.

Regards,
Aditya