ul li styling issue

5 posts by 2 authors in: Forums > CMS Builder
Last Post: December 10, 2012   (RSS)

By KCMedia - December 10, 2012

Hi

i have this ul li list that is like below and it is drawing the list of the titles from a multisection to display as a drop down menu how can make it so that the last title in the list will have a different style in the drop down than the other ones in the list see the li class none but the others have to have the right styling.

<ul>
<li><a href="#">Nutrition Basics</a></li>
<li><a href="#">G7 Day Rapid shape-Up Plan</a></li>
<li><a href="#">6 Weeks to a New You</a></li>
<li><a href="#">Maintaining your Shape for Life</a></li>
<li><a href="#">Great Shape-Up Recipes</a></li>
<li><a href="#">Food &amp; Nutrition Tables</a></li>
<li class="none"><a href="#">More Great Stuff on Nutrition</a></li>
</ul>
Thanks



Craig

KC Media Solutions

www.kcmedia.biz

Re: [kcmedia] ul li styling issue

By Toledoh - December 10, 2012

Rather than doing it in the php, I would do it with css.
http://www.w3schools.com/cssref/sel_last-child.asp
Cheers,

Tim (toledoh.com.au)

Re: [kcmedia] ul li styling issue

By Toledoh - December 10, 2012

I would wrap the record in a div and give it a class; ie.

for each....

<div class="block">
Record Number....
_link...
</div>

end for each

Then in the css;

.block{ border-bottom:1px solid red;}
.block:last-child{ border-bottom:none;}
Cheers,

Tim (toledoh.com.au)

Re: [kcmedia] ul li styling issue

By KCMedia - December 10, 2012

Hi Tim

thanks mate i will give that a try later on.
Thanks



Craig

KC Media Solutions

www.kcmedia.biz