HTML CSS examples for CSS Selector:active
CSS :active selector to choose the state of child elements
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> ul {<!-- ww w. j ava2s .c om--> list-style:none; } li { border:2px solid Chartreuse; margin:11px; padding:11px; float:left; background-repeat:no-repeat; background-position:11px 11px; } li:active { background-color:yellow; opacity:0.4; } </style> </head> <body> <ul> <li style="background-image:url(https://www.java2s.com/style/demo/InternetExplorer.png);width:100px;height:100px;"></li> <li style="background-image:url(https://www.java2s.com/style/demo/InternetExplorer.png);width:100px;height:100px;"></li> <li style="background-image:url(https://www.java2s.com/style/demo/InternetExplorer.png);width:100px;height:100px;"></li> <li style="background-image:url(https://www.java2s.com/style/demo/InternetExplorer.png);width:100px;height:100px;"></li> <li style="background-image:url(https://www.java2s.com/style/demo/InternetExplorer.png);width:100px;height:100px;"></li> </ul> </body> </html>