0% found this document useful (0 votes)
278 views

HTML Cheat Sheet

This document provides a cheat sheet on standard HTML document structure and basic elements. It outlines the proper DOCTYPE declarations for HTML 4.01 and XHTML 1.0. The standard document structure includes html, head, title, and body tags. It also describes the anatomy of an HTML tag with attributes like id and class. Finally, it lists and describes many common basic elements for text formatting, lists, tables, and images.

Uploaded by

immanul
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
278 views

HTML Cheat Sheet

This document provides a cheat sheet on standard HTML document structure and basic elements. It outlines the proper DOCTYPE declarations for HTML 4.01 and XHTML 1.0. The standard document structure includes html, head, title, and body tags. It also describes the anatomy of an HTML tag with attributes like id and class. Finally, it lists and describes many common basic elements for text formatting, lists, tables, and images.

Uploaded by

immanul
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

HTML CHEAT SHEET

STANDARD HTML DOCUMENT STRUCTURE

<!DOCTYPE>
 HTML 4.01
o <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
o <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
o <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
 XHTML 1.0
o <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
o <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
o <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

<html [if it uses an XHTML doctype xmlns="http://www.w3.org/1999/xhtml"]>


 Parent element of an HTML document; defines an HTML document.
 Has 2(two) child elements: head and body

<head>
<title>title of the document</title>
<meta http-equiv=”content-type” content=”text/html; charset=UTF-8”>
</head>

<body>
<!--
Visible content of the document goes here
-->
</body>
</html>

ANATOMY OF AN HTML TAG

<TAG-NAME ATTRIBUTE=”VALUE”></TAG-NAME>
 TAG-NAME = name of the HTML element
 Attributes
o Common attributes are: title(tooltip), id(unique identifier), class(class
identifier for stylesheet use) and style(for inline stylesheet)

BASIC HTML ELEMENTS

Comment <!—comment goes here -->


Document Structure
 <h[1-6]> heading
 <div> empty container block-level element
 <span> empty container inline-level element
 <p> paragraph
 <br/> line break
 <hr/> horizontal rule

Text markup
 <strong> strong emphasis
 <em> emphasis
 <blockquote> long quotation
 <q> short quotation
 <abbr> abbreviation
 <acronym> acronym
 <address> address
 <pre> pre-formatted text
 <dfn> definition
 <code> code
 <cite> citation
 <del> deleted text
 <ins> inserted text
 <sub> subscript
 <sup> superscript
 <bdo> text direction

List elements

 <ol> ordered list


 <ul> unordered list
 <li> list item
 <dl> definition list
 <dt> definition term
 <dd> term description

Table elements

 <table> table
 <caption> caption
 <thead> table header
 <tbody> table body
 <tfoot> table footer
 <colgroup> column group
 <col /> column
 <tr> table row
 <th> header cell
 <td> table cell

Image element

<img src=”” title=”” alt=””>

Src = URL of image file


Title = tooltip of image
Alt = alternative text

You might also like