使网页背景颜色可选黄/粉
<html> <head> <meta charset="utf-8"> <meta name="generator" content="HTML Tidy for HTML5 (experimental) for Windows https://github.com/w3c/tidy-html5/tree/c63cc39" /> <title>网页换肤</title> <link id="ly" rel="stylesheet" type="text/css" href="css1.css"> <script> function skin1() { var oL=document.getElementById(‘ly‘); oL.href=‘css1.css‘; } function skin2() { var oL=document.getElementById(‘ly‘); oL.href=‘css2.css‘; } </script> </head> <body> <input type="button" value="黄" onclick="skin1()"/> <input type="button" value="粉" onclick="skin2()"/> </body> </html>
黄
body{ background:#FFD39B; } input{ width:25px; height:25px; background:yellow; }
粉
body{ background:pink; } input{ width:25px; height:25px; background:red; }
时间: 2024-10-14 11:09:26