3月15日在PHP中文网学习
代码:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title>真正要走的人</title> <meta name="description" content=""> <meta name="keywords" content=""> <link href="" rel="stylesheet"> <style type="text/css"> div { width: 400px; height:250px; padding: 15px; border-radius: 15px; box-shadow: 5px 5px 5px #888; /*background-color: #efefef;*/ background-image: url(images/9.jpg); background-size: 430px 280px; background-repeat: no-repeat; } .text { color:#000000; text-indent: 2em; line-height: 1.5em; } </style> </head> <body> <div> <h3 style="color:#000000;text-align: center;font-size:20px" onmouseover="change(this)" onmouseout="old(this)">真正要走的人</h3> <p class="text">后来我才知道,那些真正要走的人,吝啬得连说再见都觉得是浪费时间。而那些嚷着说喂我要走了还一步三回头的人,不过是想你说一句,留下来好吗。突然明白真正的道别是没有道别,真正的告别从来都是不辞而别。</p> </div> <script type="text/javascript"> function change(element) { element.style.fontSize = '26px' element.style.color = 'green' } function old(element) { element.style.fontSize = '20px' element.style.color = '#000000' } </script> </body> </html>
手写代码: