e h2 h3 etc is rendered in a progressively smaller font 16 html head

E h2 h3 etc is rendered in a progressively smaller

This preview shows page 17 - 27 out of 59 pages.

Each successive heading element (i.e., h2, h3, etc.) is rendered in a progressively smaller font 16 <html> <head> <title>Document Headings</title> </head> <body> Samples of the six heading types: <h1>Header 1 (H1)</h1> <h2 align="CENTER">Header 2 (H2)</h2> <h3><u>Header 3 (H3)</u></h3> <h4 align="RIGHT">Header 4 (H4)</h4> <h5>Header 5 (H5)</h5> <h6>Header 6 (H6)</h6> </body> </html>
Image of page 17
Paragraphs Opening a new paragraph in HTML does not make a new paragraph displayed in the browser Basic Paragraphs <p> … </p> Attributes: align LEFT (default), RIGHT, CENTER White space ignored (use &nbsp; for whitespace) Consecutive <p> s do not yield multiple blank lines 17
Image of page 18
Paragraph Example 18 <html> <head> <title>Paragraph Example</title> </head> <body> <p> Paragraph 1 </p> <p> Paragraph 2 </p> <p> Paragraph 3 </p> </body> </html>
Image of page 19
Hyperlinks <a href ...> ... </a> Links can contain images and other text-level elements Link to Absolute URL Use a complete URL beginning with http:// <a href="">Lecture 3</a> Link to Relative URL Use a filename or relative path to filename Interpreted with respect to location of current file <a href="lecture3.html">Lecture 3</a> 19
Image of page 20
Hyperlinks Link to Section (Anchor) Use a section name (see below) preceded by # HTML is discussed in <a href="#Section3">Section 3</a> Link to Section in URL Use absolute or relative URL, then #, then section name HTML is discussed in <a href="chapter1.html#Section2">Sec. 2 of Chap. 1</a> Naming a Section Use <a name="..."> and do not include the pound # sign <h2><a name="Section2">HTML</a></h2> 20
Image of page 21
Images <img src="polyu.jpg" width="300" height="300" /> The img element’s src attribute specifies an image’s location Every img element must have an alt attribute, which contains text that is displayed if the client cannot render the image The alt attribute makes web pages more accessible to users with disabilities, especially vision impairments Width and Height are optional attributes If omitted, the browser uses the image’s actual width and height Images are measured in pixels 21
Image of page 22
Tag/Element/Attribute An HTML element is everything from the starting tag to the ending tag Attributes provide additional information about an element are always specified in the starting tag come in name/value pairs like: name="value" 22 Starting tag Element content Ending tag <p> This is a paragraph </p> <a href="default.htm" > This is a link </a> <br />
Image of page 23
Format Tags 23 Tag Description <b> Defines bold text <big> Defines big text < em> Defines emphasized text <i> Defines italic text <small> Defines small text <strong> Defines strong text <sub> Defines subscripted text <sup> Defines superscripted text <ins> Defines inserted text <del> Defines deleted text
Image of page 24
Table 24 <html> <head> <title>Table Example</title> </head> <body> <table border="1"> <tr> <td>Row1 Col1 Data</td> <td>Row1 Col2 Data</td> </tr> <tr> <td>Row2 Col1 Data</td> <td>Row2 Col2 Data</td> </tr> <tr> <td>Row3 Col1 Data</td> <td>Row3 Col2 Data</td> </tr> </table> </body> </html>
Image of page 25
Table Tags A table can be split into three distinct sections Header ( thead element) Table titles Column headers Body ( tbody element) Primary table data Footer ( tfoot element) Footnotes Above body section in the code, but displays at the bottom in the page
Image of page 26
Image of page 27

You've reached the end of your free preview.

Want to read all 59 pages?

  • Spring '19
  • World Wide Web, Hypertext Transfer Protocol

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture