如何在网页当中做一个创意的按钮
1、最普通的按钮。我们做复杂的按钮之前先做一个普通的按钮。<html><body><button type="button">按钮</button></body></html>
2、做一个可以改变大小的按钮,鼠标出现在按钮之上的时候,这稍僚敉视个按钮就变大。<html><head><script>function bigImg(x){旌忭檀挢x.style.height="180px";x.style.width="180px";}function normalImg(x){x.style.height="128px";x.style.width="128px";}</script></head><body><button onmousemove="bigImg(this)" onmouseout="normalImg(this)" border="0" src="button" alt="Smiley" ><p><b>按钮</b></p></body></html>
3、这里利用background-image 代码做了一个绿色的渐变动态按钮<section label="Copyright © 2017 playhudong All Rights Reserved." style="text-align:center;"> <section style="width:3em;height:3em;color:#fff;font-size:1em;line-height:3em;display:inline-block;text-align:center;background-image:url(*.gif);background-repeat:no-repeat;background-size:100%;background-position:0;margin:0 auto;"> <p style="margin:0"> 1 </p> </section></section><p> <br/></p>
4、HTML <canvas> 标签,这个<canvas>也是极有用的,我们可以用这样的一个标签与JAVA 结合,从而做一个有颜色的图形出来。<canvas id="myCanvas"></canvas><script type="text/javascript"> var canvas=document.getElementById('myCanvas');var ctx=canvas.getContext('2d'); ctx.fillStyle='#FF0000'; ctx.fillRect(0,0,80,100);</script>
5、<caption> 标签的用法。这个标签就是让网页拥有有一个标题。下面我们就为表格做了一个标题。<table border="1"><caption>Monthly savings</caption><tr> <th>Month</th> <th>Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> </table>
6、<center> 标签就是一个居中的按钮,我们用来让元素居中。<center> love</center>另外一个用法style="text-align:center;"