Online Book Reader

Home Category

HTML, XHTML and CSS All-In-One for Dummies - Andy Harris [14]

By Root 1302 0
’ll use something more descriptive, but this is a useful technique for a book like this.

It’s not quite accurate to say that the title text always shows up in the title bar because a Web page is designed to work on lots of different browsers. Sure, the title does show up on most major browsers that way, but what about cellphones and personal digital assistants? HTML never legislates what will happen; it only suggests. This may be hard to get used to, but it’s a reality. You trade absolute control for widespread capability, which is a good deal.

♦ : The page’s main content is contained within these tags. Most of the HTML code and the stuff the user sees are in the body area. If the header area is the engine compartment, the body is where the passengers go.

: H1 stands for heading level one. Any text contained within this markup is treated as a prominent headline. By default, most browsers add special formatting to anything defined as H1, but there’s no guarantee. An H1 heading doesn’t really specify any particular font or formatting, just the meaning of the text as a level one heading. When you find out how to use CSS in Book II, you’ll discover that you can make your headline look however you want. In this first minibook, keep all the default layouts for now and make sure you understand that HTML is about semantic meaning, not about layout or design. There are other levels of headings, of course, through
where

indicates a heading slightly less important than

,

is less important than

, and so on.

A few notes about the basic page

Be proud of this first page. It may be simple, but it’s the foundation of greater things to come. Before moving on, take a moment to ponder some important HTML/XHTML principles shown in this humble page you’ve created:

All tags are lowercase. Although HTML does allow uppercase tags, the XHTML variation you’ll be using throughout most of this book requires only lowercase tags.

Tag pairs are containers, with a beginning and an end. Tags contain other tags or text.

Some elements can be repeated. There’s only one , , and <body> tag per page, but a lot of the other elements (<h1> and <p>) can be repeated as many times as you like.<p>Carriage returns are ignored. In the Notepad document, there are a number of carriage returns. The formatting of the original document has no effect on the HTML output. The markup tags indicate how the output looks.<p>Beginners are sometimes tempted to make their first headline an <h1> tag and then use an <h2> for the second headline and an <h3> for the third. That’s not how it works. Web pages, like newspapers and books, use different headlines to point out the relative importance of various elements on the page, often varying the point size of the text. You can read more about that in Book II.<p><p><p>♦ <p></p>: In HTML, p stands for the paragraph tag. In your Web pages, you should enclose each standard paragraph in a <p></p> pair. You might notice that HTML doesn’t preserve the carriage returns or white space in your HTML document. That is, if you press Enter in your code to move text to a new line, that new line isn’t necessarily preserved in the final Web page.<p><p><p>The <p></p> structure is one easy way to manage spacing before and after each paragraph in your document.<p><p><p>Some older books recommend using <p> without a </p> to add space to your documents, similar to pressing the Enter key. This way of thinking could cause you problems later because it doesn’t truthfully reflect the way Web browsers work. Don’t think of <p> as the carriage return. Instead, think of <p> and </p> as defining a paragraph. The paragraph model is more powerful because soon enough, you’ll figure out how to take any properly defined paragraph and give it yellow letters on a green background with daisies (or whatever else you want). If things are marked properly, they’ll be much easier to manipulate later.<p><p><p>Setting Up Your System<p>You don’t need much to make Web pages. Your plain text editor and a Web browser are</div> </div> <div id="pager" style="text-align: center;margin: auto;"> <a data-ajax="false" class="ui-btn ui-btn-inline ui-corner-all" data-position-to="window" href="/article/html-xhtml-and-css-all-in-one-for-dummies-andy-harris-e60649.html">Return Main Page</a> <a data-ajax="false" class="ui-btn ui-btn-inline ui-corner-all" data-position-to="window" href="/read/html-xhtml-and-css-all-in-one-for-dummies-andy-harris-e60649/13.html">Previous Page</a> <a data-ajax="false" class="ui-btn ui-btn-inline ui-corner-all" data-position-to="window" href="/read/html-xhtml-and-css-all-in-one-for-dummies-andy-harris-e60649/15.html">Next Page</a> </div> <div data-role="footer" id="tail" style="margin-top: 30px;"> <h3>®Online Book Reader</h3> </div> </div> </body> <!-- <script src="https://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script> <script> function googleTranslateElementInit() { new google.translate.TranslateElement({ // includedLanguages: 'de,en,es,fr,it', 需要下拉翻译支持哪些语言,默认全部 layout: google.translate.TranslateElement.InlineLayout.HORIZONTAL }, 'google_translate_element'); } </script> --> </html>