前端知识复习:JS选中变色
上篇文章 :前端知识复习:Html DIV 图文混排(文字放在图片下边)
Js选中图片效果
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title></title> <style type="text/css"> img { width:200px; height:200px; } .list li { float: left; display: inline; margin: 5px; } .p{ text-align:center; } #div_img1 { padding-bottom: 50px; } </style> </head> <body> <div> <center><h1>图文混排</h1></center> <div id="div_img1"> <ul class="list"> <li> <img src="portfolio/1.jpg" align="bottom"> <div class="p">秀丽的风景1</div> </li> <li> <img src="portfolio/2.jpg" align="bottom"> <div class="p">秀丽的风景2</div> </li> <li> <img src="portfolio/3.jpg" align="bottom"> <div class="p">秀丽的风景3</div> </li> <li> <img src="portfolio/4.jpg" align="bottom"> <div class="p">秀丽的风景4</div> </li> <li> <img src="portfolio/5.jpg" align="bottom"> <div class="p">秀丽的风景5</div> </li> <li> <img src="portfolio/6.jpg" align="bottom"> <div class="p">秀丽的风景6</div> </li> </ul> </div> <div id="div_img2"> <ul class="list"> <li> <img src="portfolio/7.jpg" align="bottom"> <div class="p">秀丽的风景7</div> </li> <li> <img src="portfolio/8.jpg" align="bottom"> <div class="p">秀丽的风景8</div> </li> <li> <img src="portfolio/9.jpg" align="bottom"> <div class="p">秀丽的风景9</div> </li> <li> <img src="portfolio/10.jpg" align="bottom"> <div class="p">秀丽的风景10</div> </li> <li> <img src="portfolio/11.jpg" align="bottom"> <div class="p">秀丽的风景11</div> </li> <li> <img src="portfolio/12.jpg" align="bottom"> <div class="p">秀丽的风景12</div> </li> </ul> </div> </div> </body> </html>