[ Pobierz całość w formacie PDF ]
.This practice is most common with the (paragraph) tag.Browsers have supported the tag without its end tag, so many web authorstake advantage of the shortcut.Not all tags allow this, however, and not allbrowsers are forgiving, so when in doubt include the end tag.This is especiallyimportant when using Cascading Style Sheets (discussed in Chapter 23, CascadingStyle Sheets) with your document.In the HTML charts that appear in this book, container tags are indicated with thesyntax.If the end tag is optional, it will be so noted in the tag sexplanation.Standalone TagsA few tags do not have end tags because they are used to place standaloneelements on the page.The image tag () is such a tag and it simply plops agraphic into the flow of the page.Other standalone tags include the linebreak(), horizontal rule (), and tags that provide information about a docu-ment and don t affect its displayed content, such as the and tags.AttributesAttributes are added within a tag to extend or modify the tag s actions.You canadd multiple attributes within a single tag.Tag attributes, if any, belong after thetag name, each separated by one or more spaces.Their order of appearance is notimportant.HTML Tags 71Web Design in a Nutshell, eMatter EditionCopyright © 2000 O Reilly & Associates, Inc.All rights reserved. HTML TagsMost attributes take values, which follow an equal sign (=) after the attribute sname.Values are limited to 1024 characters in length and may be case sensitive.Sometimes the value needs to appear in quotation marks (double or single).Here show to determine if you need quotation marks around a value:" If the value is a single word or number, and contains only letters (a-z), num-bers (0-9), or the special characters period (.) or hyphen (-), then it is OK toplace it directly after the equal sign without quotation marks." If the value contains several words separated by commas or spaces, or if itcontains any special characters besides a period or hyphen, then it needs tobe contained within quotation marks.For example, URLs require quotationmarks because they contain the characters  ://.Likewise, quotation marks arerequired around color specifications that take the syntax  #rrggbb.Be careful not to leave out the closing quotation mark, or all thecontent from the opening quotation mark until the browser encoun-ters a subsequent quotation mark will be interpreted as part of thevalue, and won t display in the browser.This is a simple mistake thatcan cause hours of debugging frustration.If you are still unsure, using quotation marks consistently for all values will workjust fine and is probably a good idea anyway.The following are examples of tags that contain attributes:Nesting HTML TagsHTML tags can be applied to content containing other HTML tags for multiple tageffects on a single element.This is called nesting, and to do it properly, both thebeginning and end tags of the enclosed tag must be completely contained withinthe beginning and end tags of the applied tag, as follows:The weather is gorgeous today.Result: The weather is gorgeous today.This links to a really coolpage.Result: This links to a really cool page.A common mistake is simply overlapping the tags.Although some browsersdisplay content marked up this way, other browsers will not allow the violation, soit is important to nest tags correctly.The following example shows incorrectnesting of tags (note that the tag is closed before the ):The weather is gorgeous today.72 Chapter 5  HTML OverviewWeb Design in a Nutshell, eMatter EditionCopyright © 2000 O Reilly & Associates, Inc.All rights reserved. Information Browsers IgnoreInformation Browsers IgnoreSome information in an HTML document, including certain tags, will be ignoredwhen the document is viewed in a browser.These include:Line breaksLine returns in the HTML document are ignored.Text and elements will wrapcontinuously until they encounter a or tag within the flow of thedocument text.Line breaks are displayed, however, when text is tagged aspreformatted text () [ Pobierz caÅ‚ość w formacie PDF ]

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • higrostat.htw.pl
  •