160 likes | 268 Views
Kick Start: Html. The WebMasters Naveed Khalid. What is html?. Stands for Hyper Text Markup Language Markup language consist of markup tags Html tags describe the document content Html document contain HTML tags and plain text Also known as web pages. Html TAG.
E N D
Kick Start: Html The WebMasters Naveed Khalid
What is html? • Stands for Hyper Text Markup Language • Markup language consist of markup tags • Html tags describe the document content • Html document contain HTML tags and plain text • Also known as web pages #TWMNucleus
Html TAG • Tags are keywords surrounded by angle brackets - e.g.<body> • Tags come in Pairs – e.g. <a> </a> • The first tag in a pair is the start tag (or opening tag), the second tag is the end tag (or closing tag) #TWMNucleus
Html Element • Element starts with a start tag / opening tag and ends with a end tag / closing tag • HTML element is everything between the start tag and the end tag, including the tags: • <p>This is a paragraph</p> • HTML elements can have empty content • Empty elements are closed in the start tag – e.g. <br> #TWMNucleus
Writing First HTML page <!DOCTYPE html><html><body><h1>Hello World</h1><p>My first html page</p></body></html> #TWMNucleus
PAGE Structure #TWMNucleus
HTML Attributes • HTML elements can have attributes • It provides additional information about an element • Attributes are always specified in the start tag • Comes in name/value pairs - e.g. name="value“ • <a href=“http://webmasters.khi.nu.edu.pk”>TWM</a> #TWMNucleus
HTML Headings • Headings are defined with the <h1> to <h6> tags. • <h1> defines the most important heading. <h6> defines the least important heading. • <h1>This is heading 1</h1> • <h2>This is heading 2</h2> • <h3>This is heading 3</h3> #TWMNucleus
HTML Line & comments • The <hr> tag creates a horizontal line in an HTML page. • <p>This is a paragraph.</p><hr><p>This is a paragraph.</p> • Comments can be inserted into the HTML code to make it more readable and understandable. Comments are ignored by the browser and are not displayed. • <!-- This is a comment --> #TWMNucleus
HTML Paragraphs & Break • Paragraphs are defined with the <p> tag. • <p>This is a paragraph</p><p>This is another paragraph</p> • Use the <br> tag if you want a line break without starting a new paragraph. • <p>The<br>team of<br>zeros and ones</p> #TWMNucleus
HTML Formatting #TWMNucleus
html Images • Images are defined with the <img> tag. • The <img> tag is empty, which means that it contains attributes only, and has no closing tag. • To display an image on a page, you need to use the src attribute. • Src stands for "source". • The value of the src attribute is the URL of the image. • <imgsrc="url" alt="some_alternate_text"> #TWMNucleus
Html links • The HTML <a> tag defines a hyperlink. • A hyperlink (or link) is a word, group of words, or image that you can click on to jump to another document. • Syntax: <a href="url">Link text</a> • <a href=“http://webmasters.khi.nu.edu.pk”>TWM</a> • <a href=http://webmasters.khi.nu.edu.pk target="_blank">TWM</a> #TWMNucleus
Html List • An unordered list starts with the <ul> tag. Each list item starts with the <li> tag. • <ul><li>twm</li><li>TWM</li></ul> • An ordered list starts with the <ol> tag. Each list item starts with the <li> tag. • <ol><li>TWM</li><li>twm</li></ol> #TWMNucleus
Html Tables • Tables are defined with the <table> tag. • A table is divided into rows (with the <tr> tag), and each row is divided into data cells (with the <td> tag). • td stands for "table data," and holds the content of a data cell. • To display a table with borders, specify the border attribute. • Header information in a table are defined with the <th> tag. #TWMNucleus
Html Tables <table border="1"><tr><th>Header 1</th><th>Header 2</th></tr><tr><td>row 1, cell 1</td><td>row 1, cell 2</td></tr><tr><td>row 2, cell 1</td><td>row 2, cell 2</td></tr> </table> #TWMNucleus