Anúncio
Anúncio

Mais conteúdo relacionado

Anúncio
Anúncio

Html

  1. HTML
  2. Introduction • Stands for Hypertext Markup Language • Most widely used language to write Web Pages • Hypertext refers to the way in which Web pages (HTML documents) are linked together • Is a Markup Language which means you use HTML to simply "mark- up" a text document with tags that tell a Web browser how to structure it to display • Is being widely used to format web pages with the help of different tags available in HTML language
  3. Basic HTML document
  4. Basic Tags • Heading Tags • Paragraph Tags • Line Break Tag • Centering Tag • Horizontal Lines • Preserving Format • Non breaking space
  5. Heading Tags
  6. Paragraph Tag
  7. Line Break Tag
  8. Centering Tag
  9. Horizontal Lines
  10. Preserve Formatting
  11. Non Breaking Space
  12. HTML Elements
  13. HTML Tags Vs Elements • <p> is starting tag • </p> is closing tag • <p>This is paragraph</p> is paragraph element • There are some HTML elements which don't need to be closed, such as <img.../>, <hr /> and <br /> elements • These are known as void elements
  14. Nested HTML Elements
  15. HTML Attributes • Used to define the characteristics of an HTML element • Is placed inside the element's opening tag • All attributes are made up of two parts: a name and a value: • The name is the property you want to set • The value is what you want the value of the property to be set and always put within quotations • Example: Three possible values of align attribute: left, center and right. • Attribute names and attribute values are case-insensitive • However, the World Wide Web Consortium (W3C) recommends lowercase attributes/attribute values
  16. Core Attributes • The four core attributes that can be used on the majority of HTML elements are: • Id • Title • Class • Style
  17. The id Attribute • Used to uniquely identify any element within an HTML page • Two primary reasons to use an id attribute on an element: • If an element carries an id attribute as a unique identifier, it is possible to identify just that element and its content • If we have two elements of the same name within a Web page, we can use the id attribute to distinguish between elements that have the same name
  18. The title Attribute • Gives a suggested title for the element • Syntax for the title attribute is similar as id attribute
  19. The class attribute • Used to associate an element with a style sheet • Specifies the class of element • Will learn more about the use of the class attribute when we will learn Cascading Style Sheet (CSS)
  20. The style attribute • Allows us to specify Cascading Style Sheet (CSS) rules within the element
  21. Internationalization Attributes • There are three internationalization attributes, which are available for most all XHTML elements • dir • lang • xml:lang
  22. The dir Attribute • Allows you to indicate to the browser about the direction in which the text should flow • Can take one of two values, as we can see in the table that follows:
  23. The lang Attribute • Allows us to indicate the main language used in a document • Was kept in HTML only for backwards compatibility with earlier versions of HTML • Has been replaced by the xml:lang attribute in new XHTML documents • Values of the lang attribute are ISO-639 standard two-character language codes
  24. The xml:lang • Is the XHTML replacement for the lang attribute • The value of the xml:lang attribute should be an ISO-639 country code
  25. Generic Attributes
  26. HTML Formatting • Bold Text • Italic Text • Underlined Text • Strike Text • Monospaced Font • Superscript Text • Subscript Text • Inserted Text • Deleted Text • Larger Text • Smaller Text
  27. Bold Text
  28. Italic Text
  29. Underlined Text
  30. Strike Text
  31. Monospaced Font
  32. Superscript Text
  33. Subscript Text
  34. Inserted and Deleted Text
  35. Larger Text
  36. Smaller Text
  37. Grouping Content • The <div> and <span> elements allow us to group together several elements to create sections or subsections of a page • For example, we might want to put all of the footnotes on a page within a <div> element to indicate that all of the elements within that <div> element relate to the footnotes • We might then attach a style to this <div> element so that they appear using a special set of style rules
  38. Phrase Tags • Emphasized Text • Marked Text • Strong Text • Text Abbreviation • Acronym Element • Text Direction • Special Terms • Quoting Text • Short Quotations • Text Citations • Computer Code • Address Text
  39. Emphasized Text
  40. Marked Text
  41. Strong Text
  42. Text Abbreviation
  43. Acronym Element Title is missing from acronym
  44. Text Direction
  45. Special Terms
  46. Quoting Text
  47. Short Quotations
  48. Text Citations
  49. Computer Code
  50. Address Text
  51. Meta Tags • Specify additional important information about a document • Can be used to include name/value pairs describing properties of the HTML document, such as author, expiry date, a list of keywords, document author etc. • <meta> tag is used to provide such additional information • Is an empty element and so does not have a closing tag • Carries information within its attributes
  52. • Can include one or more meta tags in your document based on what information we want to keep in your document • Do not impact physical appearance of the document
  53. Comments • Are placed in between <!-- ... --> tags • Any content placed with-in <!-- ... --> tags will be treated as comment and will be completely ignored by the browser
  54. Multiline Comment
  55. Images • Insert Image • Set Image Location • Set Image Width/Height • Set Image Border • Set Image Alignment
  56. Insert Image • Can insert any image in web page by using <img> tag • Syntax:
  57. Set Image Location
  58. Set Image Width/Height
  59. Set Image Border
  60. Set Image Alignment
  61. Tables • Allow web authors to arrange data like text, images, links, other tables, etc. into rows and columns • Are created using the <table> tag in which the <tr> tag is used to create table rows and <td> tag is used to create data cells
  62. Table Heading
  63. Cell Padding and Cell Spacing
  64. Colspan and Rowspan Attributes
  65. Tables Backgrounds • Can set table background using one of the following two ways: • bgcolor attribute - Can set background color for whole table or just for one cell • background attribute - Can set background image for whole table or just for one cell. • Can also set border color also using bordercolor attribute
  66. Table Height and Width
  67. Table Caption
  68. Table Header, Body, and Footer • The three elements for separating the head, body, and foot of a table are: • <thead> - to create a separate table header. • <tbody> - to indicate the main body of the table. • <tfoot> - to create a separate table footer.
  69. Nested Tables • Can use one table inside another table. • Not only tables can use almost all the tags inside table data tag <td>
  70. HTML LIST • Three ways for specifying lists of information • All lists must contain one or more list elements • Lists may contain: • <ul> • Unordered list • List items using plain bullets • <ol> • Ordered list • Use different schemes of numbers to list items • <dl> • Definition list • Arranges items in the same way as they are arranged in a dictionary
  71. Unordered Lists
  72. The type Attribute
  73. Ordered Lists
  74. The type Attribute
  75. The start Attribute
  76. Definition Lists • Supported by both HTML and XHTML • Entries are listed like in a dictionary or encyclopedia • Ideal way to present a glossary, list of terms, or other name/value list • Definition List makes use of following three tags • <dl> - Defines the start of the list • <dt> - A term • <dd> - Term definition • </dl> - Defines the end of the list
  77. TEXT LINKS • Syntax:
  78. The target Attribute
  79. Use of Base Path
  80. Linking to a Page Section
  81. Setting Link Colors
  82. Download Links
  83. Image Links
  84. FRAMES • Are used to divide browser window into multiple sections where each section can load a separate HTML document • A collection of frames in the browser window is known as a frameset • The window is divided into frames in a similar way the tables are organized: into rows and columns
  85. Disadvantages of Frames • There are few drawbacks with using frames, so it's never recommended to use frames in your webpages: • Some smaller devices cannot cope with frames often because their screen is not big enough to be divided up • Sometimes your page will be displayed differently on different computers due to different screen resolution • The browser's back button might not work as the user hopes • There are still few browsers that do not support frame technology
  86. Creating Frames • To use frames on a page we use <frameset> tag instead of <body> tag • The <frameset> tag defines, how to divide the window into frames • The rows attribute of <frameset> tag defines horizontal frames and cols attribute defines vertical frames • Each frame is indicated by <frame> tag and it defines which HTML document shall open into the frame
  87. Output
  88. Output
  89. IFRAMES • Can define an inline frame with HTML tag <iframe> • The <iframe> tag is not somehow related to <frameset> tag, instead, it can appear anywhere in your document • The <iframe> tag defines a rectangular region within the document in which the browser can display a separate document, including scrollbars and borders. • The src attribute is used to specify the URL of the document that occupies the inline frame
  90. FORMS • Are required, when we want to collect some data from the visitor • For example, during user registration we would like to collect information such as name, email address, credit card, etc. • Will take input from the site visitor and then will post it to a back-end application such as CGI, ASP Script or PHP script etc • There are various form elements available like text fields, textarea fields, drop-down menus, radio buttons, checkboxes, etc
  91. Form Attributes
  92. Form Controls • There are different types of form controls that you can use to collect data using HTML form: • Text Input Controls • Checkboxes Controls • Radio Box Controls • Select Box Controls • File Select boxes • Hidden Controls • Submit and Reset Button
  93. Text Input Controls • There are three types of text input used on forms: • Single-line text input controls • Used for items that require only one line of user input, such as search boxes or names • Created using HTML <input> tag • Password input controls • Also a single-line text input but it masks the character as soon as a user enters it • Are also created using HTML <input> tag • Multi-line text input controls • Used when the user is required to give details that may be longer than a single sentence • Are created using HTML <textarea> tag
  94. Single-line text input controls
  95. Password Input controls
  96. Multiple-Line Text Input Controls
  97. Checkbox Control • Are used when more than one option is required to be selected • Are also created using HTML <input> tag but type attribute is set to checkbox
  98. Radio Button Control • Are used when out of many options, just one option is required to be selected • Are also created using HTML <input> tag but type attribute is set to radio
  99. Select Box Control • A select box, also called drop down box which provides option to list down various options in the form of drop down list • User can select one or more options
  100. • Following is the list of important attributes of <select> tag:
  101. • Following is the list of important attributes of <option> tag:
  102. File Upload Box • If we want to allow a user to upload a file to our web site, we will need to use a file upload box, also known as a file select box • Also created using the <input> element but type attribute is set to file
  103. Button Controls • Various ways in HTML to create clickable buttons • Create a clickable button using <input> tag by setting its type attribute to button • The type attribute can take the following values:
  104. Hidden Form Controls • Are used to hide data inside the page which later on can be pushed to the server • Hides inside the code and does not appear on the actual page
Anúncio