Sei sulla pagina 1di 2

General document structure

Name Element Explanation


XHTML content <html></html> Starts and ends the document
Header <head></head> Information about the page (hidden)
Body <body></body> Visible page elements

Tags which go in the header (between <head></head>)


Name Element Explanation
Title <title></title> Visible in the title bar; name of bookmark
Meta information <meta name="value" content="value" Types of information like keywords, author,
/> etc.
Comments <!­­ comments go here ­­> Won't be visible to the user (can be in body
as well)
External style <link rel="stylesheet" href="url"  Points to another file
sheet />
Style sheet <style type="text/css"></style> Embedded in the document

Everything else goes between <body></body> tags

Style elements
Name Element Explanation
Div <div class=”class_name”></div> Block element (takes as much space as it can)
Span <span class=”class_name”></span> Inline element (takes as little space as it can)

Text layout
Name Element Explanation
Headings <h#></h#> Numbers 1-6 (<h1> largest, <h6> smallest) for various title areas
Paragraph <p></p> Block of text surrounded by white space
Line break <br /> Line break without white space
Horizontal rule <hr /> Horizontal line to separate elements

Text formatting
Name Element Explanation
Strong <strong></strong> Generally displayed as bold
Emphasis <em></em> Generally displayed as italic
Bigger text <big></big> One size bigger
Smaller text <small></small> One size smaller
Links
Name Element Explanation
Link to another page <a href="url"></a> Relative (just the local path) or
absolute (starts http://domain)
URL of the page. Text between the
tags is what the user sees as the
name of the link.
Set an anchor <a name="location"></a> A place on a page to jump to
location
Link to anchor <a href="#location"></a> OR <a  Within the same page OR on a
location href="page.html#location"></a> different page

Images
Name Element Explanation
Image <img src="url" alt="description" /> Simplest image tag. Alt text required
for accessibility
Image with width <img src="url" alt="description "  Include width and height so the
and height width="#" height="#" /> page will display faster

Lists
Name Element Explanation
Unordered list <ul></ul> Bulleted list
Ordered list <ol></ol> Numbered list
List item <li>Item text</li> Elements of the list

Tables
Name Element Explanation
Table content <table></table> Surrounds the whole
Table row <tr></tr> A table is made up of rows
Table cell <td></td> A row is made up of cells
Cell spanning 2+ column <td colspan="#"></td> To merge cells into one horizontally
Cell spanning 2+ rows <td rowspan="#"></td> To merge cells into one vertically

Potrebbero piacerti anche