Click here to return to the Wulin.com HTML tutorial column.
Above: Chapter1 List
Original source
Standardized Design Solutions -Markup
and Style Handbook Part 1: Get Down With Markup Start with Markup Chapter2 Title Overview:Not only do all web pages need to have titles, but they can add a lot of color to web design and ease of use if marked correctly.
In terms of appearance, the title of a web page is usually a larger font size, and may use a different color or font from the main text. The function of the title is to briefly describe the topic discussed in the subsequent chapters. W3C describes it like this - displays the summary of each paragraph in the web page.
How to create a page title to make the information we want to present the most effective use? In this chapter, we will study several commonly used methods of dealing with titles, try to find out one of the most helpful ways to us, and then we will use some CSS tips and tricks to decorate the best method.
What is the best way to create a document title?Before answering this question, let's assume that you are now placing the title at the top of the document, and let's take a look at three ways to achieve similar effects.
Method A: Does it make sense?<span class=heading>Super Cool Page Title</span>
Although the <span> tag is a convenient tag in some cases, it doesn't make much sense for page titles. The only benefit of using this method is that we can specify a css style for the heading class so that the text looks like a title.
.heading {
font-size: 24px;
font-weight: bold;
color: blue;
}
Now, all headers marked with heading will get bigger, thicker, and blue, which is great, right? But what if someone uses a browser that doesn't support css to access this page?
For example, what happens if we put CSS styles in an external stylesheet file that is not supported by the old browser—or when the screen reads the page for a disabled user? Users who access this page through these channels will not see (no sound) the difference between the title and the text.
The annotation method like class=heading slightly describes the meaning of the tag content, but <span> is just a general purpose container, which only allows most browsers to change the default display style.
When search engines crawl this page, they will skip the <span> tag as if it was not there, and will not increase the weight for the keywords that may be included. Later, more relationships between search engines and page titles will be mentioned in this chapter.
Finally, since the <span> tag is an inline element, we mostly need to place the content of method A into another block-level container, such as <p> or <div>, so that it can occupy a single line. This will generate a lot of unnecessary code. Even if you add the required container, browsers that do not support css will still display the text in their original way, so that users cannot see any difference between the title and the body.
Previous page1 2 3 4 5 Next page Read the full text