| |
|
| |
HomeWeb DevelopmentShort ContentsFor Beginners...Introduction Changes from 3.2 Document Attributes ...that are available for all BODY objects Text Organisation tools Forms Images Sounds Style Sheets Special Effects - Javascript Search Engines Full ContentsFor Beginners...IntroductionOther HTML sitesPutting pages online Tips For beginners Download this Guide Changes from 3.2DocumentSpecifying LanguageStructure The <HEAD> section ...General attributes ...Title ...Setting the Base address ...META tags ...Character sets ...<LINK>s The <BODY> tag A note on colours Attributes...that are available for all BODY objectsTextHeadingsPreformatted text Change text direction Special Characters Character Formatting ...Blink ...Bold ...Italics ...Superscript ...Subscript Paragraph formatting ...Blockquote ...Line Breaks ...New Paragraph ...Stop Line Breaks ...Word Break ...Marking Modifications Miscellaneous ...Abbreviation ...Acronyms ...Addresses ...Use Bigger/Smaller fonts ...Citations ...Code ...Definitions ...Keyboard input ...Sample ...Teletype ...Variables Organisation toolsCommentsHorizontal lines DIV and SPAN Links ...<LINK>s ...within pages ...Image maps Tables ...example tag ...Rows ...Cells ...Captions ...Head, Body & Foot Lists ...Definition lists ...Directory Lists ...Ordered Lists ...Unordered Lists Embedding special files The Object Element FormsInputs and buttonsSelection menus Element Labels Fieldsets and legends ImageSoundsStyle Sheetsspecifying versionindividual elements in the HEAD section specifying media types external sheets cascading sheets media-dependant defaults HTTP headers Special Effects - JavascriptEvents...onAbort ...onBlur ...onChange ...onClick ...onError ...onFocus ...onLoad ...onMouseOver ...onMouseOut ...onReset ...onScroll ...onSelect ...onSubmit ...onUnload Basic Commands ...Changing the status bar ...Opening a new window ...changing page being viewed Search Engines |
Language ProvisionsMany HTML elements ("tags") now allow the inclusion of the lang="???" and dir="???" attributes to specify the language to be used.
Document StructureHTML documents are made up of text which includes "tags" enclosed in the< > symbols. Most HTML tags usually have a corresponding "closing tag" which marks the end of whatever effect the opening tag had. For example, <B> Example Text </B> would display everything between the opening <B> and closing </B> in bold print (as the B tag does).HTML tags should also be used in a "nested" pattern, which basically means that the matching closing tag for a tag within another opening / closing pair must also be within that pair. That is, <B> bold text <I> Bold Italics </I> </B> is allowed since the <I> </I> pair is within the <B> </B> pair, but <B> bold text <I> Bold Italics </B> Italics only </I> will not work because it does not conform to these rules. Note that most web browsers are very tolerant of such mistakes, but may not display the document as you intended. Be sure to test your pages on more than one browser, because while one may display things properly, another may get confused by any mistakes. This is the most basic structure of a HTML document :
<!doctype html public "-//ietf//dtd html//en//4.0"><!doctype html public "-//ietf//dtd html//en//4.0"> shows what HTML version is being used. Use one of the following forms :
<HTML lang="???" dir="???" > </HTML> pair should enclose the entire HTML document. See above for details of the language attributes.The <HEAD></HEAD> section generally contains information about the document such as the title and the META tags used by search engines. If you plan on using Javascript functions, this is the best place to put them to ensure that they are loaded before something in the body of the document executes them.The <BODY></BODY> part is the main section of a HTML document. It contains all your text, images, links, etc. If you want to use frames, the<FRAMESET></FRAMESET> tag must be placed before the BODY section.The <HEAD Section >HEAD attributesThe HEAD tag is of the form<HEAD lang="???" dir="????">These attributes are described at the top of this section. Choosing the titleThe document's title appears, in most browsers, along with the browser name, above the menubar of the browser window. To give your document a title, place the following within the HEAD section :<TITLE lang="???" dir="???"> (place your chosen title here) </TITLE>Bear in mind that your document's title is also used by search engines when displaying results, so make sure that you use something that is likely to attract people to choose your page from the hundreds of other results. For example "Geoff Knagge's HTML guide" is preferable to "My HTML page". Setting the Base AddressThis tells the web browser what address to put in front of all the relative links, and is also used by the ISINDEX feature. Usually, this will be exactly the same address as the document itself, but sometimes you may wish to over-ride it if you have files on. or have moved to, a different location. An example of the tag, for the online version of this guide, is :<BASE href="http://www.geocities.com/Athens/Aegean/4756/html.htm">META tags<META name="(variable name)" content="(description or value for name)" lang="???" dir ="???">These provide special information to web browsers and search engines,with the most useful values of NAME as follows:
<META HTTP-EQUIV="Expires" CONTENT="DDD, DD MM YYYY HR:MM:SS GMT">specifies when the page should be cleared from a cache, and an update sought. Set this to a date that has passed, and the will be loaded fresh every time. Specifying Character setTo conform with the HTML standard, you should also specifying what whatacter set your document uses, by placing the following within the HEAD section:<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">as used in this documentA list of available charsets is at ftp://ftp.isi.edu/in-notes/iana/assignments/character-sets <LINK>This tag is covered in the Organisational tools section of this guide. However, most web browsers ignore it, with the same effect being achieved by using<A> tags in the body of the document.The <BODY> TagBODY attributes
A Note on ColoursWhen specifying colours within the BODY section of a document, you can either use the #rrggbb format (explained later), or colour names. The latter is not advised, since various browsers interpret some names differently, Also be aware that some people use a 16-colour display, seeing variations on what you specify, and that many people suffer various forms of colour blindness. However, the following do seem to be standard colour names:
Your Default colours and backgroundIn strict HTML 4.0, all colours and background images are specified by use of style sheets.
(C)opyright, Geoff Knagge.
Continued use of this site indicates your agreement to the Conditions of use and Privacy Policy. |