10. we save an HTML file, either the .htm or the .html file extension.
11. SAMPLE PROGRAM <html> <body> <h1>My First Heading</h1> <p>My first paragraph.</p> </body> </html>
12. HTML headings: HTML headings are defined with the <h1> to <h6> tags. SYNTAX : <h1>This is a heading</h1> HTML Paragraphs: HTML paragraphs are defined with the <p> tag. SYNTAX : <p>This is a paragraph.</p> HTML Links: HTML links are defined with the <a> tag. SYNTAX : <a href="http://www.google.com">This is a link</a> HTML Images: HTML images are defined with the <img> tag. SYNTAX : <img src="w3schools.jpg" width="104" height="142" />
13. HTML Attributes: Attributes are always specified in the start tag Attributes come in name/value pairs like: name="value" HTML links are defined with the <a> tag. The link address is specified in the href attribute Attribute names and attribute values are case-insensitive. SYNTAX : <a href="http://www.w3schools.com">This is a link</a> HTML Lines: The <hr /> tag creates a horizontal line in an HTML page. SYNTAX : <p>This is a paragraph</p> <hr /> <p>This is a paragraph</p> HTML Comments: Comments are i gnored by the browser and are not displayed. SYNTAX : <!-- This is a comment --> HTML Line Breaks: Use the <br /> tag if you want a line break (a new line) without starting a new paragraph. SYNTAX : <p>This is<br />a para<br />graph with line breaks</p>
14. HTML Formatting Tags: Text formatting tags 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 “ Computer Output" Tags Tag Description <code> Defines computer code text <kbd> Defines keyboard text <samp> Defines sample computer code <tt> Defines teletype text <var> Defines a variable <pre> Defines preformatted text Citations, Quotations, and Definition Tags Tag Description <abbr> Defines an abbreviation <acronym> Defines an acronym <address> Defines contact information for the author/owner of a document <bdo> Defines the text direction <blockquote> Defines a long quotation <q> Defines a short quotation <cite> Defines a citation <dfn> Defines a definition term
15. The HTML Style Attribute: Tags Description <center> Defines centered content <font> and <basefont> Defines HTML fonts <s> and <strike> Defines strikethrough text <u> Defines underlined text Attributes Description align Defines the alignment of text bgcolor Defines the background color color Defines the text color SYNTAX : Style Example - Background Color <body style="background-color:yellow"> <h2 style="background-color:red">This is a heading</h2> <p style="background-color:green">This is a paragraph.</p> </body>
16. SYNTAX: Style Example - Font, Color and Size <body> <h1 style="font-family:verdana">A heading</h1> <p style="font-family:arial;color:red;font-size:20px;">A paragraph.</p> </body> SYNTAX: Style Example - Text Alignment <body> <h1 style="text-align:center">This is a heading</h1> <p>The heading above is aligned to the center of this page.</p> </body>
21. The <a> tag can be used in two ways: 1. To create a link to another document, by using the href attribute. 2. To create a bookmark inside a document, by using the name attribute. SYNTAX: <a href="url">Link text</a> <a href="http://www.w3schools.com/">Visit W3Schools</a> Link Tags: Tag Description <a> Defines an anchor
22. The target Attribute: The target attribute specifies where to open the linked document. SYNTAX: <a href="http://www.w3schools.com/" target="_blank">Visit W3Schools!</a> The name Attribute: The name attribute specifies the name of an anchor. The name attribute is used to create a bookmark inside an HTML document. Bookmarks are not displayed in any special way. They are invisible to the reader. * A named anchor inside an HTML document: <a name="tips">Useful Tips Section</a> * Create a link to the "Useful Tips Section" inside the same document: <a href="#tips">Visit the Useful Tips Section</a> * create a link to the "Useful Tips Section" from another page: <a href="http://www.w3schools.com/html_links.htm#tips"> Visit the Useful Tips Section</a>
23. HTML The <img> Tag and the Src Attribute : SYNTAX: <img src="url" alt="some_text"/> HTML The Alt Attribute : SYNTAX: <img src="boat.gif" alt="Big Boat" /> HTML Image Tags: Tag Description <img> Defines an image <map> Defines an image-map <area> Defines a clickable area inside an image-map HTML Tables: Tag Description <table> Defines a table <th> Defines a table header <tr> Defines a table row <td> Defines a table cell <caption> Defines a table caption <colgroup> Defines a group of columns in a table, for formatting <col> Defines attribute values for one or more columns in a table <thead> Groups the header content in a table <tbody> Groups the body content in a table <tfoot> Groups the footer content in a table
24. HTML Tables header and the Border Attribute: <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> HTML list: An ordered list: 1. The first list item 2. The second list item 3. The third list item An unordered list: * List item * List item * List item
25. HTML Forms: HTML Form Tags: Tag Description <form> Defines an HTML form for user input <input> Defines an input control <textarea> Defines a multi-line text input control <label> Defines a label for an input element <fieldset> Defines a border around elements in a form <legend> Defines a caption for a fieldset element <select> Defines a select list (drop-down list) <optgroup> Defines a group of related options in a select list <option> Defines an option in a select list <button> Defines a push button
26. Text Fields <input type="text" /> defines a one-line input field that a user can enter text into: Password Field <input type="password" /> defines a password field: Radio Buttons <input type="radio" /> defines a radio button. Radio buttons let a user select ONLY ONE one of a limited number of choices: Checkboxes <input type="checkbox" /> defines a checkbox. Checkboxes let a user select ONE or MORE options of a limited number of choices. Submit Button <input type="submit" /> defines a submit button.