Danh mục

Creating Cool Web Sites with HTML, XHTML, and CSS- P2

Số trang: 50      Loại file: pdf      Dung lượng: 2.06 MB      Lượt xem: 19      Lượt tải: 0    
Thu Hiền

Xem trước 5 trang đầu tiên của tài liệu này:

Thông tin tài liệu:

Creating Cool Web Sites with HTML, XHTML, and CSS- P2: This book walks readers through the process of creating a basic Web site from scratch using HMTL, the basis for billions of Web pages, and then jazzing it up with advanced techniques from the author’s award-winning sites. This updated edition features new material that shows readers how to attract visitors to a site and keep them there, including new JavaScript examples and coverage of cascading style sheets and XHTML, technologies that make building successful Web sites even easier...
Nội dung trích xuất từ tài liệu:
Creating Cool Web Sites with HTML, XHTML, and CSS- P2 24 Creating Cool Web Sites with HTML, XHTML, and CSS tip Develop the habit of closing any tag that you open. What do you think would happen if you included quotation marks around a tag—suppose, for example, that you used “” at the beginning of your document rather than . If you guessed that only the quotes would be displayed, you’re right. Let me say it one more time: Web browsers are very simple-minded in their interpretation of HTML. Any tags that vary from the specific characters in the HTML-language specification result in something other than what you were expecting, or your formatting requests are ignored completely. Breaking at Paragraphs and Lines The most helpful markup tags—and probably the tags that you’ll use most often—specify that you want a paragraph break or a line break. Several variants of these tags exist, but you can create readable and useful Web documents by using only the tags and . To specify that you want a paragraph break, use the tag. (Many HTML tags are mnemonic: p for paragraph.) The following example adds some tag pairs to the not- yet.html file shown in Figure 2-1 and also wraps the file in the and tags. Notice that the tag is a container: The open tag appears before the passage to be affected, and the close tag appears at the end of the passage: Dave’s Desk Somewhere in Cyberspace Dear Reader, Thank you for connecting to my Web server, but I regret to tell you that things aren’t up and running yet! They will be _soon_, but they aren’t today. Sincerely, Dave Taylor Figure 2-2 shows what this HTML text looks like in a browser.Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Chapter 2: Building Your First Web Page: HTML Basics 25 Figure 2-2: Paragraph breaks in not-yet.html. The version of the file in Figure 2-2 is a huge improvement over Figure 2-1, but some prob lems still exist, not the least of which is that the first few lines don’t look right. In their zeal to organize the text neatly, Web browsers, by default, fill as many words into each line as they can manage. Filling the lines works well for the main paragraph of the file, but the first few lines display more appropriately if you indicate that the browser should break the line between items. Paragraph tags have a somewhat checkered history in HTML. Although they were always intended to be used as containers (that is, a paired tag), for many years note people recommended that they be used as stand-alone tags instead, with a wherever a break was desired. As HTML has become more sophisticated, using the tags as a proper container has become more important, and it’s a very good habit—worth learning and sticking with—as you’ll see when we talk about XHTML later in this chapter. To break lines in HTML, use the break tag, . Like any tag, the break tag can appear anywhere in the text, including at the end of the line you want to break. HTML tags are also case insensitive, meaning that , , and all mean exactly the same thing. Having said that, however, good form is to use all lowercase in your HTML tags as consis tently as possible because that’s required for the XHTML standard. (More about that at the end of this chapter.) Now is the time to develop good habits—while you’re just figuring this stuff out—so you don’t have to break bad habits later! Because I’m following XHTML standards in this book, all stand-alone tags have a slightly odd appearance, with a /> sequence at the end rather than the more com note mon > by itself. You can use for a break, but (with a space before the slash) is our goal here. As I said in the note above, learning good habits now will ensure that your pages work properly in the future as HTML and the Web evolve.Please purchase PDF Split-Merge on www.verypdf.c ...

Tài liệu được xem nhiều: