Chạy thử Cách sử dụng lớp giả CSS :last-child
Chạy thử Cách sử dụng lớp giả CSS :last-child
Chạy thử Cách sử dụng lớp giả CSS :last-child
Tự code rồi chạy thử...
Chạy Thử
<!DOCTYPE html>
<html>
<head>
<title>Chạy thử Cách sử dụng lớp giả CSS :last-child</title>
<style>
* { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }
#divlgf{width:100%;float:left;height:auto;border:1px solid #ddd}
#divlgf ul{margin:0px;padding:0px;}
#divlgf ul li{margin:0px;padding:0px;list-style:none;padding:7px 5px;width:100%;float:left;height:auto;background:red;color:#000;border-bottom:5px solid green}
#divlgf ul li:last-child{border-bottom:0px solid green}
</style>
</head>
<body>
<h1>Chạy thử Cách sử dụng lớp giả CSS :last-child</h1>
<p>Lớp giả CSS :last-child dùng để định dạng class cuối cùng trong các class giống nhau của phần tử cha hoặc định dạng phần tử con cuối cùng trong các phần tử con giống nhau trong phần tử cha:</p>
<div id="divlgf">
<ul>
<li>CSS :last-child</li>
<li>CSS :last-child</li>
<li>CSS :last-child</li>
<li>CSS :last-child</li>
<li>CSS :last-child</li>
<li>CSS :last-child</li>
</ul>
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Chạy thử Cách sử dụng lớp giả CSS :last-child</title>
<style>
* { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }
#divlgf{width:100%;float:left;height:auto;border:1px solid #ddd}
#divlgf ul{margin:0px;padding:0px;}
#divlgf ul li{margin:0px;padding:0px;list-style:none;padding:7px 5px;width:100%;float:left;height:auto;background:red;color:#000;border-bottom:5px solid green}
#divlgf ul li:last-child{border-bottom:0px solid green}
</style>
</head>
<body>
<h1>Chạy thử Cách sử dụng lớp giả CSS :last-child</h1>
<p>Lớp giả CSS :last-child dùng để định dạng class cuối cùng trong các class giống nhau của phần tử cha hoặc định dạng phần tử con cuối cùng trong các phần tử con giống nhau trong phần tử cha:</p>
<div id="divlgf">
<ul>
<li>CSS :last-child</li>
<li>CSS :last-child</li>
<li>CSS :last-child</li>
<li>CSS :last-child</li>
<li>CSS :last-child</li>
<li>CSS :last-child</li>
</ul>
</div>
</body>
</html>
Chạy thử Cách sử dụng lớp giả CSS :last-child nằm trong bài viết Cách sử dụng lớp giả CSS :last-child