This note records the most basic tags and usage routines. It is recorded here to facilitate future consolidation, and also for other colleagues to refer to and simple examples. The Great Wall starts from a young age, and something as trivial as HTML 5 needs to be taken step by step. Come on, there is no other good way!
In addition, my programming environment is configured as follows: HTML 5 editing IDE uses Brackets, PHP uses Notepad ++. Deployment uses xammn.
Routine 1: hello world
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>第一个教程</title> </head> <body> <h1>hello world</h1> </body> </html>
Description:
is declared as an HTML5 document
element is the root element of the HTML page
< The head> element contains the metadata of the document
The element defines a paragraph
Routine 2: Title
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>第二个例子</title> </head> <body> <h1>我的标题1</h1> <h2>我的标题2</h2> <h3>我的标题3</h3> <h4>我的标题4</h4> <h5>我的标题5</h5> <h6>我的标题6</h6> </body> </html>
Routine 3: html paragraph
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>第二个例子</title> </head> <body> <h1>我的标题1</h1> <p>这是第一个段落</p> <p>这是第二个段落</p> </body> </html>
Routine 4: html link
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>第二个例子</title> </head> <body> <a href="http://www.runoob.com">网易</a> </body> </html>
Routine 5 html image
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>第二个例子</title> </head> <body> <img src="screenshots/quick-edit.png" width="200" height="200"> </body> </html>
Routine 6: Add a line to the web page
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>第二个例子</title> </head> <body> <img src="screenshots/quick-edit.png" width="200" height="200"> <hr> <p>段落1</p> <hr> <p>段落2</p> <hr> </body> </html>
Routine 7: Add comments to the program
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>第二个例子</title> </head> <body> <!-- 在网页上显示图片 --> <img src="screenshots/quick-edit.png" width="200" height="200"> <hr> <!-- 段落1的内容 --> <p>段落1</p> <hr> <p>段落2</p> <hr> </body> </html>
Routine 8 Font formatting output
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>第二个例子</title> </head> <body> <b>加粗文本</b><br><br> <i>斜体文本</i><br><br> <code>电脑自动输出</code><br><br> 这是 <sub> 下标</sub> 和 <sup> 上标</sup> </body> </html>
Routine 9 html css
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>我的例程</title> </head> <body> <a href="http://www.163,com/" >访问网易!</a> <h1 style="text-align:center">居中对齐</h1> </body> </html>
Routine 10 Table
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>我的例程</title> </head> <body> <table border="1"> <tr> <th>头部1</th> <th>头部2</th> </tr> <tr> <td>第1行第1列</td> <td>第1行第2列</td> </tr> <tr> <td>第2行第1列</td> <td>第2行第2列</td> </tr> </table> </body> </html>
Routine 11 Unordered List
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>我的例程</title> </head> <body> <ul> <li>第一</li> <li>第二</li> <li>第三</li> </ul> </body> </html>
Routine 12: Ordered List
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>我的例程</title> </head> <body> <ol> <li>呵呵</li> <li>呵呵</li> <li>呵呵</li> </ol> <ol start="50"> <li>呵呵</li> <li>呵呵</li> <li>呵呵</li> </ol> </body> </html>
Routine 13: Block Area
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>我的例程</title> </head> <body> <div style="color:#0000FF"> <h3>这是一个在 div 元素中的标题。</h3> <p>这是一个在 div 元素中的文本。</p> </div> </body> </html>
The above is the detailed content of Detailed introduction to basic html routines. For more information, please follow other related articles on the PHP Chinese website!