Answer the question
In order to leave comments, you need to log in
How to make a selection of the necessary elements from the list
A colleague made a rating of collaboration products . I would like to add functionality to select products according to functionality:
<ul id="ranking">
<li class="ipr d"><a href=" www.attask.com ">@task</a></li>
< li class="i d"><a href=" www.alfresco.com ">Alfresco</a></li>
<li class="ipr d"><a href=" www.assembla.com ">Assembla </a></li>
<li class="r d"><a href=" basecamphq.com ">Basecamp</a></li>
<li class="isp d"><a href="
At the same time, draw the corresponding icons in accordance with the classes i, p, r, .... Does not work. If we write the following CSS, only one icon from the set is drawn - the next background overwrites the previous one. How to do? There was an idea to put a common background with all the icons, and draw white blotches on top, but it's still not clear how. The difference from the recently popular layouts with overlaying backgrounds is that several backgrounds are combined with a comma in one background-image; no one promised that this is equivalent to overlaying multiple classes. :-(
#ranking li {
padding: 0 0 0 144px;
height: 24px;
margin: 0;
background-color: transparent;
background-repeat: no-repeat;
}
#ranking .i {
background-image: url(http://lh5.googleusercontent.com/_aUeHSbJneFc/TaWtMRe2sTI/AAAAAAAADN8/lUN_k4d9agU/s800/issue.png);
background-position: 0 0;
}
</style>
display: none;
, it looks like the last value will also override the previous one. I would like products to be shown according to the functionality that the user wanted, regardless of the order of the classes in the specifier. Answer the question
In order to leave comments, you need to log in
It is possible from without javascript. True, I can imagine how to do it in PHP.
PS Why didn't you like javascript?
Not the most elegant and not very convenient extensible solution: put a bunch of divs with the corresponding classes in each li, write something like this in CSS:
#ranking li div { float: left; display: none;}
#ranking li div.r {background-image: ...}
#ranking li.r div.r { display: block; }
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question