HTML / XHTML tài liệu cấu trúc
A basic HTML/XHTML document Một HTML cơ bản / XHTML tài liệu
<html> <html>
<head> <head>
<title>A basic HTML/XHTML document</title> <title> Một HTML cơ bản / XHTML tài liệu </ title>
</head> </ head>
<body> <body>
This is a basic HTML/XHTML document. Đây là một HTML cơ bản / XHTML tài liệu.
</body> </ body>
</html> </ html>
Back to top Trở về đầu trang
Text Văn bản
Headings Đề mục
<h1> - <h6> </h1> - </h6> (the smaller the number, the bigger the text) <h1> - <h6> </ h1> - </ h6> (nhỏ hơn số lượng, lớn hơn các văn bản)
<h6>Heading six</h6> <h6> Heading sáu </ h6>
<h5>Heading five</h5> <h5> Heading năm </ h5>
<h4>Heading four</h4> <h4> Heading bốn </ h4>
<h3>Heading three</h3> <h3> Heading ba </ h3>
<h2>Heading two</h2> <h2> Heading hai </ h2>
<h1>Heading one</h1> <h1> Heading một </ h1>
Bold, italic, and underlined text Đậm, nghiêng và gạch dưới
<b>this text will be bold</b> <b> văn bản này sẽ được in đậm </ b>
<i>this text will be italic</i> <i> văn bản này sẽ được nghiêng </ i>
<u>this text will be underlined</u> <u> văn bản này sẽ được gạch chân </ u>
Back to top Trở về đầu trang
Text formatting Văn bản định dạng
Paragraphs Đoạn văn
<p>This text will be a paragraph</p> <p> Văn bản này sẽ được một đoạn </ p>
Line breaks Ngắt dòng
The <br> tag skips one line. Các <br> thẻ bỏ qua một dòng.
Lists Danh sách
Ordered lists: Ra lệnh cho các danh sách:
<ol> <ol>
<li>First item in ordered list</li> <li> hàng đầu trong danh sách đã ra lệnh </ li>
<li>Second item in ordered list</li> <li> thứ hai mặt trong danh sách đã ra lệnh </ li>
</ol> </ ol>
Unordered lists: Danh sách có thứ tự:
<ul> <ul>
<li>First item in unordered list</li> <li> hàng đầu trong danh sách có thứ tự </ li>
<li>Second item in unordered list</li> <li> hàng thứ hai trong danh sách có thứ tự </ li>
</ul> </ ul>
Horizontal lines Ngang đường
The <hr> tag creates a horizontal line. Thẻ <hr> tạo ra một đường ngang.
Preformatted text Preformatted văn bản
<pre>This text <pre> văn bản này
will be preformatted</pre> sẽ được Preformatted </ pre>
Back to top Trở về đầu trang
Links Liên kết
Linking to another page in same window: Liên kết đến trang khác trong cùng một cửa sổ:
<a href="page.html">Click here</a> <a href="page.html"> Click vào đây </ a>
Linking to another page in new window: Liên kết đến trang khác trong cửa sổ mới:
<a href="page.html" target="_blank">Click here</a> <a href="page.html" target="_blank"> Click vào đây </ a>
Linking to another part of a page Liên kết tới một phần khác của trang
<a href="#anchorName" target="_blank">Click here</a> <a href="#anchorName" target="_blank"> Click vào đây </ a>
Back to top Trở về đầu trang
Images Hình ảnh
<img src="image.jpg" alt="This is an image" /> <img src="image.jpg" alt="This là một image" />
Using an image as a link: Sử dụng một hình ảnh như là một liên kết:
<a href="page.html"><img src="image.jpg" alt="This is an image link" /></a> <a href="page.html"> <img src="image.jpg" alt="This là một hình ảnh link" /> </ a>
Back to top Trở về đầu trang
Image maps Hình bản đồ
<map name="aMap"> <map name="aMap">
<area shape="rect | circle | poly" coords="10,10,10,10" href="page.html" /> <area shape="rect | vòng tròn | poly" coords="10,10,10,10" href="page.html" />
<area shape="rect | circle | poly" coords="20,20,20,20" href="page2.html" /> <area shape="rect | vòng tròn | poly" coords="20,20,20,20" href="page2.html" />
<area shape="rect | circle | poly" coords="30,30,30,30" href="page3.html" /> <area shape="rect | vòng tròn | poly" coords="30,30,30,30" href="page3.html" />
</map /> </ map />
Back to top Trở về đầu trang
Tables Bàn
<table border="1"> <table border="1">
<tr> <tr>
<th>Table heading</th> <th> Bảng nhóm </ th>
<th>Table heading 2</th> <th> Bảng nhóm 2 </ th>
</tr> </ tr>
<tr> <tr>
<td>Table cell</td> <td> bàn bào </ td>
<td>Table cell</td> <td> bàn bào </ td>
</tr> </ tr>
</table> </ table>
Back to top Trở về đầu trang
Frames Khung
<frameset rows="50%, 50%"> <frame src="frameone.php" src="frameone" /> <frame src="frametwo.php" src="frametwo" /> </frameset> <frameset rows="50%, 50%"> <frame src="frameone.php" src="frameone" /> <frame src="frametwo.php" src="frametwo" /> </ frameset>
Dealing with browsers that do no support frames Đối phó với các trình duyệt mà không hỗ trợ khung hình
<noframes> Your browser does not support frames. <noframes> trình duyệt của bạn không hỗ trợ khung. Are you still using Windows 95 as well? </noframes> Bạn vẫn sử dụng Windows 95 không? </ Noframes>
Inline frames Inline frames
<iframe src="page1.html" name="iframeone" width="110" height="110"></iframe> <iframe src="page1.html" name="iframeone" width="110" height="110"> </ iframe>
Back to top Trở về đầu trang
Forms Hình thức
A basic form Một dạng cơ bản
<form name="formone" action="page1.php" method="post"> <form name="formone" action="page1.php" method="post">
<input type="text" /> <input type="text" />
<input type="submit" value="Submit" /> <input type="submit" value="Submit" />
</form> </ form>
Form elements Mẫu yếu tố
<input type="text" name="textbox" /> (textbox) <input type="text" name="textbox" /> (hộp)
<input type="button" value="This is a button" /> (button) <input type="button" value="This là một button" /> (nút)
<textarea rows="20" cols="20">This is a textarea</textarea> (textarea) <textarea rows="20" cols="20"> Đây là một vùng văn </ textarea> (textarea)
<input type="radio" name="radionButtons" value="One" />Radio button one <input type="radio" name="radionButtons" value="One" /> một nút Radio
<input type="radio" name="radionButtons" value="Two" />Radio button two (radio buttons) <input type="radio" name="radionButtons" value="Two" /> Radio hai nút (radio buttons)
<input type="checkbox" name="checkboxes" value="One" />Checkbox one <input type="checkbox" name="checkboxes" value="One" /> Checkbox một
<input type="checkbox" name="checkboxes" value="Two" />Checkbox two (checkboxes) <input type="checkbox" name="checkboxes" value="Two" /> Checkbox hai (hộp kiểm)
<select name="dropDowList"> <select name="dropDowList">
<option>One</option> <option> Một </ option>
<option>Two</option> <option> Hai </ option>
<option>Three</option> <option> Ba </ option>
<option>Four</option> <option> Bốn </ option>
</select> (drop down list) </ select> (danh sách thả xuống)
Submitting a form Đệ trình mẫu
<input type="submit" value="Submit" /> <input type="submit" value="Submit" />
Resetting a form Lập lại một hình thức
<input type="reset" value="Reset" /> <input type="reset" value="Reset" />
Back to top Trở về đầu trang
Style sheets Style sheets
Internal style sheet Phong cách nội bộ tờ
<style type="text/css"> styles go here </style> <style type="text/css"> phong cách đi đây </ style>
NOTE: An internal style sheet goes in the HEAD element of an HTML document. Chú ý: Một phong cách trang nội bộ đi trong phần HEAD của một tài liệu HTML.
External style sheet Bên ngoài phong cách tờ
<link rel="stylesheet" type="text/css" href="style1.css" /> <link rel="stylesheet" type="text/css" href="style1.css" />
NOTE: The <link> tag goes inside the HEAD element of an HTML document. Chú ý: Thẻ <link> đi bên trong các phần tử Head của một tài liệu HTML.
Inline style sheet Inline style sheet
<p style="color:green;">This text will be green.</p> <p style="color:green;"> Văn bản này sẽ có màu xanh lá cây. </ p>
Back to top Trở về đầu trang
Meta tags Meta tags
<meta name="keywords" content="keyword1, keyword2, keyword3, keyword4" /> (offering keywords to search engines) <meta name="keywords" content="keyword1, keyword2, keyword3, keyword4" /> (cung cấp các từ khoá vào công cụ tìm kiếm)
<meta name="description" content="Description of the page" /> (offering page description to search engines) <meta name="description" content="Description của page" /> (cung cấp trang mô tả cho công cụ tìm kiếm)
<meta name="generator" content="Software_used_to_create_page" /> (telling search engines what software was used to create a page) <meta name="generator" content="Software_used_to_create_page" /> (nói cho công cụ tìm kiếm những phần mềm đã được sử dụng để tạo ra một trang)
<meta name="author" content="Someone A. Person" /> (telling search engines who created a page) <meta name="author" content="Someone A. Person" /> (nói cho công cụ tìm kiếm người đã tạo ra một trang)
<meta name="expires" content="February 1st, 2876" /> (telling search engines when a page expires) <meta name="expires" content="February 1st, 2876" /> (nói cho công cụ tìm kiếm khi một trang hết hạn)
<meta http-equiv="refresh" content="5" /> (will reload the page every five seconds) <meta http-equiv="refresh" content="5" /> (sẽ tải lại trang mỗi năm giây)
<meta http-equiv="window-target" content="_top" /> (preventing a page from being viewed inside some other websites frames page) <meta http-equiv="window-target" content="_top" /> (ngăn chặn một trang được xem từ bên trong khung trang một số trang web khác)
Back to top Trở về đầu trang
Document type Tài liệu loại
HTML Transitional HTML Transitional
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <DOCTYPE HTML! PUBLIC "- / / W3C / / DTD HTML 4.01 Transitional / / EN" "http://www.w3.org/TR/html4/loose.dtd">
HTML Frameset HTML Frameset
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> <DOCTYPE HTML! PUBLIC "- / / W3C / / DTD HTML 4.01 Frameset / / EN" "http://www.w3.org/TR/html4/frameset.dtd">
HTML Strict HTML Strict
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <DOCTYPE HTML! PUBLIC "- / / W3C / / DTD HTML 4.01 / / EN" "http://www.w3.org/TR/html4/strict.dtd">
XHTML Transitional XHTML Transitional
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <DOCTYPE html PUBLIC "! - / / W3C / / DTD XHTML 1.0 Transitional / / EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
XHTML Frameset XHTML Frameset
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> <DOCTYPE html PUBLIC "! - / / W3C / / DTD XHTML 1.0 Frameset / / EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
XHTML Strict XHTML Strict
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <DOCTYPE html PUBLIC "! - / / W3C / / DTD XHTML 1.0 Strict / / EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Back to top Trở về đầu trang
Scripts Scripts
<script type="script language"> <script type="script language">
script goes here kịch bản tại đây
</script> </ script>
Handling browsers that do not support scripts Xử lý các trình duyệt không hỗ trợ các script
<noscript> <noscript>
Your browser does not support scripts!! Trình duyệt của bạn không hỗ trợ các script!! How's that going for you? Làm thế nào của đó sẽ cho bạn?
</noscript> </ noscript>
Back to top Trở về đầu trang
Comments Ý kiến
<!-- this is a comment --> <- Đây là một nhận xét! ->
Back to top Trở về đầu trang
Entities Entities
Entity Name Tên tổ chức Entity Number Số thực thể Type of Character Loại tự Output Đầu ra
  space không gian
< < < < less than sign chưa đăng nhập < <
> > > > greater than sign lớn hơn ký > >
& & & & ampersand ampersand & &
" " " " quotation mark báo giá đánh dấu " "
' ' " " apostrophe apostrophe ' '
© © © © copyright symbol bản quyền biểu tượng © ©
® ® ® ® registered trademark symbol đăng ký nhãn hiệu hàng hoá biểu tượng ® ®
× × × × multiplication symbol phép nhân biểu tượng x x
÷ ÷ ÷ ÷ division symbol chia biểu tượng ÷ ÷
Back to top Trở về đầu trang