tailieunhanh - WEB DESIGN AND MARKETING SOLUTIONS FOR BUSINESS WEBSITES phần 8

Ví dụ, dòng mã này có thể được sử dụng để tham khảo các tập tin CSS cho màn hình hiển thị của trình duyệt: phương tiện truyền thông = "màn hình , dự báo "/ Có một số thuộc tính quan trọng. Các rel và các thuộc tính loại cho trình duyệt liên kết cho một tập tin CSS, | WEB DESIGN AND MARKETING SOLUTIONS FOR BUSINESS WEBSITES Implementing the printer-friendly style sheet CSS files are linked to the document inside the head tag. There are different ways of doing this but the most common way is through the link tag. For instance this single line of code might be used to reference the CSS file for the browser display link rel stylesheet href css type text css media screen projection There are several important attributes. The rel and type attributes tell the browser that the link is for a CSS file and the media attribute dictates where the style sheet should be applied. In this example the CSS file is intended for screens basically traditional browser windows and projection environments which is the term for browsers that operate in kiosk mode8 . Linking a dedicated print style sheet is exactly the same except the media attribute changes. link rel stylesheet href css type text css media print The implementation does not get much more complicated than that. The harder work comes in actually developing and maintaining the additional style sheet which includes choosing the page elements that stay and the ones that need to be hidden from the printer. What stays what goes At some point you have printed a web page. Most likely it looked terrible. You wondered why all the extraneous garbage in the navigation sidebar advertisements and footer had to waste half a toner cartridge when all you wanted was the content. When a site is built using CSS for design it s incredibly easy to hide these elements from printers using a print style sheet. Typically the first line of the print CSS file is dedicated to hiding the visual elements not needed for printing. For instance header img leftcol rightcol ul menu previousstuff commentform advertisements display none Deciding what actually stays and what goes may provide some consternation. Seriously consider what users want when they print a web page. 99 percent of the time the .

TỪ KHÓA LIÊN QUAN