php或者JS或者CSS怎么删除ul中最后一个li的border-bottom

php是后台语言,一般不用作前台样式的chuli,javascript或者CSS删除ul中最后一个li的border-bottom样式的方法如下:

javascript:obj.style.borderBottom = "none";

jquery:$("ul#test li:last-child").css("border-bottom","none");

css:ul#test li:last-child{border-bottom: none;}

jquery和css的方法比较简洁,下面实例演示javascript设置方法:

1、HTML结构

GlenTaneJohnRalph2、javascript代码window.onload = function(){

var li = document.getElementById("test").getElementsByTagName("li");

li[li.length-1].style.borderBottom = "none";

}3、效果演示

php或者JS或者CSS怎么删除ul中最后一个li的border-bottom

JQ用 $("ul li:last-child") last-child就是最后的意思

css用 li:last-child 不支持IE6

php的话就是利用分割找到最后的li