Quelet Posted January 30, 2012 Share Posted January 30, 2012 Hello! I'm started few weeks ago in the prestashop's world. I'm stopped since last saturday trying to change the colours of the categories block. I want a different color for each category but I'only can change the backgound color of all the block. Please, can anyone give me a hand? What I've to do? Thanks Quelet Link to comment Share on other sites More sharing options...
Quelet Posted January 31, 2012 Author Share Posted January 31, 2012 I've this code: <div id="categories_block_left" class="block"> <h4>Categories</h4> <div class="block_content"> <ul class="tree dynamized" style="display: block;"> <li> <a title="" href="http://xxxxx/category.php?id_category=5">Paper</a> </li> <li> <a title="" href="http://xxxxx/category.php?id_category=6">Estampació</a> </li> <li> <li> <a title="" href="http://xxxxx/category.php?id_category=8">Enquadernació</a> </li> <li> <a title="" href="http://xxxxx/category.php?id_category=9">Abecedaris</a> </li> But I only have on rule for all the elements of the list: #categories_block_left .tree a { color: #374853; padding-left: 0; } It's possible to make a rule for the first element, anoher for the second, ...? Many thanks Quelet Link to comment Share on other sites More sharing options...
CartExpert.net Posted February 1, 2012 Share Posted February 1, 2012 Hello, you can select the children nodes using :nth-child( NUMBER_OF_CHILD ) You can find more on this following the link: http://www.w3schools.com/cssref/sel_nth-child.asp Link to comment Share on other sites More sharing options...
Quelet Posted February 1, 2012 Author Share Posted February 1, 2012 It works!! Thanks a lot! Link to comment Share on other sites More sharing options...
CartExpert.net Posted February 6, 2012 Share Posted February 6, 2012 Hello, we're happy we could help. Please set topic as Solved. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now