tailieunhanh - Creating Cool Web Sites with HTML, XHTML, and CSS- P4
Creating Cool Web Sites with HTML, XHTML, and CSS- P4: 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. | 124 Creating Cool Web Sites with HTM L XHTM L and CSS img src When you have a graphics file the img tag is used to place that file in the text. Suppose that I have a file called that I want to use as the opening graphic in my Web page. The following example shows how this file might appear in an HTML document html head title The Black Box title head body img src alt black box logo h1 Welcome to the Black Box h1 People are always trying to figure out how things work. From How Things Work to Why Things Work it s an obsession. But why Why not just think of everything in life as a simple i Black Box i . br br Ready to change your perspective a href yes a body html The img formatting tag has quite a variety of attributes as this chapter illustrates. The two attributes that must appear in the img tag are a specification of the image source file itself in the format src filename and a tag indicating the alternative text to display if the image cannot be loaded the alt text tag. Figure 7-1 shows how the preceding HTML appears when viewed in a browser. Figure 7-1 The Black Box page with graphics specified but not loaded. Please purchase PDF Split-Merge on to remove this watermark. Chapter 7 From Dull to Cool by Adding Graphics The small box at the top of Figure 7-1 with a small x inside is not the graphic I wanted to include rather it s an indication from Internet Explorer that an inline graphic was specified with the img tag but not loaded. In this case the graphic was not loaded because I mistyped the name of the graphics file specifying rather than . Did you notice Instead the text of the alt attribute is shown but it s definitely not what I want To correct the problem simply fix the spelling. Figure 7-2 shows what the resulting Web page looks like with all the information properly loaded more attractive than with the unloaded graphic eh . Figure 7-2 The Black Box Web page .
đang nạp các trang xem trước