CSS problem - an element only works if its has no parent (using jquery)
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: i have this code: CSS: .taglist { float:left; margin-left:30px; } .taglist ul { overflow:auto; list-style-type:none; border:1px solid #999; background:#ccc; padding:20px; min-height:150px; max-height:150px; width:100px; } .taglist li { display:block; border:1px solid #999; background:#fff; width:80px; padding:5px 10px; margin-bottom:5px; } .tag_selected { background:#ffc; } HTML: <div class="taglist"> <ul id="list1"> <li id="1">1</li> </ul> </div> Now I'm using jQuery for this one.. so when an item on the list is selected, it should change