Sublime Text
<!DOCTYPE html> <html> <head> <title>Xem ví dụ</title> <style> .css h1:only-of-type{ border:2px solid red; } </style> </head> <body> <div class="html"> <p>Lập Trình Web 01</p> <div>Lập Trình Web 02</div> <h1>Lập Trình Web 03</h1> <span>Lập Trình Web 04</span> </div> <div class="css"> <p>Lập Trình Web 05</p> <div>Lập Trình Web 06</div> <h1>Lập Trình Web 07</h1> <span>Lập Trình Web 08</span> </div> <div class="css"> <p>Lập Trình Web 09</p> <div>Lập Trình Web 10</div> <h1>Lập Trình Web 11</h1> <h1>Lập Trình Web 12</h1> </div> </body> </html>
<!DOCTYPE html> <html> <head> <title>Xem ví dụ</title> <style> .css h1:only-of-type{ border:2px solid red; } </style> </head> <body> <div class="html"> <p>Lập Trình Web 01</p> <div>Lập Trình Web 02</div> <h1>Lập Trình Web 03</h1> <span>Lập Trình Web 04</span> </div> <div class="css"> <p>Lập Trình Web 05</p> <div>Lập Trình Web 06</div> <h1>Lập Trình Web 07</h1> <span>Lập Trình Web 08</span> </div> <div class="css"> <p>Lập Trình Web 09</p> <div>Lập Trình Web 10</div> <h1>Lập Trình Web 11</h1> <h1>Lập Trình Web 12</h1> </div> </body> </html>