tailieunhanh - Tự học HTML và CSS trong 1 giờ - part 59

Tham khảo tài liệu 'tự học html và css trong 1 giờ - part 59', công nghệ thông tin, đồ họa - thiết kế - flash phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | 556 LESSON 18 Writing Good Web Pages Do s and Don ts If you re using a background image make sure that it doesn t interfere with the text Some images may look interesting on their own but can make text difficult to read when you put it on top of them. Keep in mind that backgrounds are supposed to be in the background. Subtle patterns are always better than wild patterns. Your visitors are visiting your pages for their content not to marvel at your ability to create faux marble in your favorite image editor. When in doubt try asking a friend to look at your pages. Because you re already familiar with the content you may not realize how hard your pages are to read. Someone who hasn t read them before will tell you that your text colors are too close to your background color or that the background image is interfering with the text. Of course you ll have to find a friend who will be honest with you. Making the Most of CSS and JavaScript Web design these days is about minimal markup styled using CSS. Sticking with the following rules of thumb will make sure that your sites load quickly and efficiently. Put Your CSS and JavaScript in External Files Nearly all browsers maintain a cache of recently loaded content the more content on your site that can be cached the more quickly pages on your site after the first one will load. You should put your styles in external style sheets and your JavaScript in linked scripts whenever you can. Linked files will be cached when users visit the first page on your site and then will be retrieved from the cache on subsequent page views. There are also advantages to this approach in terms of saving you time too. If the styles for each page on your site live in style tags on those pages you have to update every page when you decide to make a change. It s much easier to make those changes in an external style sheet. You can even include styles for specific pages in a single external style sheet if you use the class and id attributes .