HTML Basics
HTML Introduction Stands for HyperText Markup Language. HTML files are plain text files with mark ups. Some characteristics of HTML: –No variables. –No commands. –Robust. –A way to format documents.
Tags Tags are used to mark up a HTML document. HTML tags have the following syntax: – Many tags have a ‘begin’ tag and an ‘end’ tag –Marks up the text between the tags. The syntax is: – … –e.g. … …
Tag Attributes Some tags have attributes to describe or modify what it is doing. The syntax is: – … Some examples: – …
Structure of HTML Documents HTML documents are enclosed by html tags – … The rest of the document has two sections – the head and body. …
Head Section The head section contains information about the document. –e.g. the title of the document. For example: My Home Page “My Home Page” will appear in title bar of the browser.
Body Section The body section contains text that will be displayed in the browser window. Some useful/common tags used in the body: – - line break. White spaces are ignored. – - paragraph break. – … - Centers the enclosed text.
Body Section (cont.) … - Sets the font property of the enclosed text. The tag attributes are: –color: color=“blue”, color=“0000ff” –size: size=12, size=“+4” –face: face=“Courier”, face=“Times New Roman”
More Tags Links, Tables Lists
Links Links allow one html document to reference another. The syntax is: – … Example: – Texas Texas appears in the browser, and clicking on it takes you to
Tables Tables are created using the following tags –Only the first 3 tags are required. The 4 tags are: – … - encloses the entire table. – … - encloses a single row of a table. – … - encloses a single cell of a table. – … - encloses the column heading of a table.
Example Item Cost Shirt Pants Shoes 25.00
Example (cont.) ItemCost Shirt12.00 Pants32.00 Shoes25.00
Lists: Ordered There are 3 kinds of lists: – ordered, unordered, and definition. An ordered list is a list where the elements are numbered. The syntax is: …
Lists: Unordered An unordered list is a list where the elements are bulleted. The syntax is: …
Lists: Definition A list of definitions. The syntax is: … … … … - encloses the term. … - encloses the definition.
Macros Some texts are reserved or ignored. –e.g. <, white space, etc.. Special macros are needed for these. Some common macros: –< → < –> → > –& → & –" →“ –  →non-breaking white space