1 / 34

Comment tags (contd.)

Comment tags (contd.). A comment tag is of the form <!-- Some-comment-text-appears-here --> A comment can appear anywhere in a html specification They are frequently used to tell people who wrote the specification, when, why, etc. <html> <head> <title> Politics in Ireland </title>

aysha
Download Presentation

Comment tags (contd.)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Comment tags (contd.) • A comment tag is of the form <!-- Some-comment-text-appears-here --> • A comment can appear anywhere in a html specification • They are frequently used to tell people who wrote the specification, when, why, etc.

  2. <html> <head> <title> Politics in Ireland </title> <base href=“http://www.iol.ie/pres/”> <!-- Written by: James Bowen Date: 19/10/2000 Why: CS4400 class --> </head> <body> <h1> Presidents </h1> <p> The presidents of Ireland were </p> <ol> <li> <A href="hyde.htm"> Douglas Hyde </A> <li><A href="dev.htm"> Eamon de Valera </A> </ol> </body> </html>

  3. Using <img> tags

  4. <img> tags • <img> tags are used to incorporate pictures into web documents • A picture cannot be inserted directly into the html spec of a web document, since a html spec is a textual spec • <img> tags are used to point to pictures that we want to appear in a web document

  5. <img> tags (contd.) • The <img> tag is a structured tag -- it has attributes • The src attribute is used to point to the picture to be included <img src = “some-URL” >

  6. A simple web document containing a picture

  7. Use lower-case tags and attributes • The picture on this slide is very old • It shows upper-case tags and attributes, which were allowed back then • Upper-case tags and attributes are not allowed any more • Do not use upper-case tags or attributes

  8. Of course, we can have text with the pictures

  9. Use lower-case tags and attributes • The picture on this slide is very old • It shows upper-case tags and attributes, which were allowed back then • Upper-case tags and attributes are not allowed any more • Do not use upper-case tags or attributes

  10. A document

  11. Use lower-case tags and attributes • The picture on this slide is very old • It shows upper-case tags and attributes, which were allowed back then • Upper-case tags and attributes are not allowed any more • Do not use upper-case tags or attributes

  12. Never use HTML presentational attributes

  13. The ALIGN attribute • In early versions of html, img tags used to have an ALIGN attribute for specifying how to align pictures relative to neighbouring text • This was, therefore, a rendering attribute • DO NOT USE this attribute • NEVER use rendering attributes • We will see how to achieve rendering effects more cleanly when we meet Style Sheets

  14. Colour of the background • It would be preferable if you could ignore such rendering features as the colour of the background • Unfortunately, when you start using pictures, you cannot, since pictures have colour and you have to consider how clearly an image will show up against the background

  15. Background colour (contd.) • For example, consider how the last document we specified would appear in both Netscape Navigator and Microsoft Explorer

  16. Background colour (contd.) • In Netscape, the images show up clearly against the default background colour, which is white • In Explorer, the largely-grey images do not contrast so well with the grey-ish background

  17. Background colour (contd.) • We can specify the background colour we want • Early versions of html provided a BGCOLOR attribute in the <body> tag • However this is a rendering attribute and SHOULD NOT BE USED • We will see how to do it more cleanly when we meet style sheets

  18. Background PATTERNS • We can also ask the browser to use a repeated version of some image as a background • This should be done with care, because • it can lead to unreadable documents • it adds to the length of time it takes to download a document over the Internet

  19. Background PATTERNS • Early versions of html provided an attribute in the <body> tag for this purpose • Again, as with all rendering attributes, DO NOT USE IT • We will see how to do achieve the same effect more cleanly when we meet style sheets

  20. Another kind of list: Definition lists

  21. Definition lists: • Frequently, we want to have lists of items like this: CPU Central Processor Unit VDU Visual Display Unit IRQ Interrupt ReQuest

  22. In other words, we want to have a list in which each member has two parts: • a TERM, whose meaning is to be defined • a DEFINITION of the term

  23. html provides a tag for this kind of concept: the Definition List tag or <dl> tag • A list of definitions is delimited by a <dl> tag and a </dl> tag <dl> …. …. </dl>

  24. Each item between the <dl> and </dl> tags has two parts, a term and its definition • A term is delimited by <dt> and </dt> tags, while a definition is delimited by <dd> and </dd> tags: <dl> <DT > CPU </dt> <dd> Central Processing Unit </dd> <dt> VDU </dt> <dd> Visual Display Unit </dd> <dt> IRQ </dt> <dd> Interrupt ReQuest </dd> </dl>

  25. Example document: <html> <head> <title> Definition List </title> </head> <body> <h1> Some Computing Acronyms </h1> <dl> <DT > CPU </dt> <dd> Central Processing Unit </dd> <dt> VDU </dt> <dd> Visual Display Unit </dd> <dt> IRQ </dt> <dd> Interrupt ReQuest </dd> </dl> </body> </html>

  26. Another example document: <html> <head> <title> Languages of the World </title> </head> <body> <h1> Languages of the World </h1> <dl> <dt> Tok Pisin </dt> <dd> A Melanesian Creole spoken in the South-western Pacific </dd> <dt> Hakka </dt> <dd> One of the languages spoken in Fujien province in China</dd> <dt> Mon </dt> <dd> A language spoken in Cambodia</dd> <dt> Xhosa </dt> <dd> One of the major languages of South Africa</dd> </dl> </body> </html>

More Related