【技能提升】10个编写HTML5的实用小技巧
<!DOCTYPE html PUBLIC ”-//W3C//DTD XHTML 1.0 Transitional//EN”“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<!DOCTYPE html>
<mg src=”path/to/image” alt=”About image” /><p>Image of Mars. </p>
<figure><img src=”path/to/image” alt=”About image” /><figcaption><p>This is an image of something interesting. </p></figcaption></figure>
<link rel=”stylesheet” href=”path/to/stylesheet.css” type=”text/css” /><script type=”text/javascript” src=”path/to/script.js”></script>
<link rel=”stylesheet” href=”path/to/stylesheet.css” /><script src=”path/to/script.js”></script>
<p class=myClass id=someId> Start the reactor.
<!DOCTYPE html><html lang=”en”><head><meta charset=”utf-8″><title>untitled</title></head><body><h2> To-Do List </h2><ul contenteditable=”true”><li> Break mechanical cab driver. </li><li> Drive to abandoned factory<li> Watch video of self </li></ul></body></html>
<ul contenteditable=true>
<!DOCTYPE html><html lang=”en”><head><meta charset=”utf-8″><title>untitled</title></head><body><form action=”" method=”get”><label for=”email”>Email:</label><input id=”email” name=”email” type=”email” /><button type=”submit”> Submit Form </button></form></body></html>
<input name=”email” type=”email” placeholder=”[email protected]” />
<div id=”header”>…</div><div id=”footer”>…</div>
<header>…</header><footer>…</footer>
不过注意不要将这两个元素与网站的头部和脚部混淆起来。它们只是代表它们的容器。
来源 | web前端开发
审核 | 吕梁 曾琦 李明辉(总编辑)
监制 | 方正
山东传媒职业学院信息工程系
新媒体中心