我如何...如何在HTML代码中创建按钮? [英] How do I...how to create button in html code ?
本文介绍了我如何...如何在HTML代码中创建按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在html代码中创建按钮?
解决方案
为什么要停在按钮处?您需要整个套件,请查看: HTML5初学者指南&安培; CSS3 - 带有HTML5的强大表格 [ ^ ]
<!DOCTYPE html>
< html>
< body>
< button type =button>点击我!< / button>
< / body>
< / html>
我们可以通过两种基本方式创建HTML按钮,一种是使用标签,另一种是使用标签,
使用标签:
< input type =buttonvalue =点击我! onclick =JavaScript:alert('谢谢......我现在感觉好多了!')/>
使用标签:
< button type =buttononclick =JavaScript:alert('曾几何时,有一位公主和一只青蛙。他们两人结婚并过着幸福的生活。结束。')>
HTML按钮带图片:
< button type =按钮onclick =JavaScript:警告('曾几何时,有一位公主和一只青蛙。他们都结婚了,从此过上幸福的生活。结束。')>
< ; img src =/ pix / web_graphics / free_website_graphics / icons / books / book13.gifalt =阅读书籍/>
< br /> Read Book!& lt; /按钮>
how to create button in html code ?
解决方案
Why stop at button? You need the whole suite, check this out: Beginner's Guide to HTML5 & CSS3 - Formidable Forms with HTML5[^]
<!DOCTYPE html>
<html>
<body>
<button type="button" >Click Me!</button>
</body>
</html>
We can create the HTML button by the two basic ways, one is using tag, and the another one is using tag,
Using the Tag:
<input type="button" value="Click me!" onclick="JavaScript:alert('Thanks... I feel much better now!')" />
Using the Tag:
<button type="button" onclick="JavaScript:alert('Once upon a time, there lived a princess and a frog. They both got married and lived happily ever after. The end.')">
HTML Button with Image:
<button type="button" onclick="JavaScript:alert('Once upon a time, there lived a princess and a frog. They both got married and lived happily ever after. The end.')">
<img src="/pix/web_graphics/free_website_graphics/icons/books/book13.gif" alt="Read book" />
<br />Read Book!</button>
这篇关于我如何...如何在HTML代码中创建按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文