TAILIEUCHUNG - ASP.NET 4 Unleased - p 32

Tôi khuyên bạn nên làm tất cả những thiết kế trang web của bạn bằng cách sử dụng phương pháp thảo luận trong phần này. Bạn nên đặt tất cả các thiết kế trang web của bạn trong một bên ngoài CSS nằm trong một thư mục Theme. Đặc biệt, bạn không nên thay đổi sự xuất hiện của một điều khiển bằng cách thay đổi thuộc tính của nó. Hơn nữa, bạn nên tránh sử dụng các tập tin da. | 284 CHAPTER 6 Designing Websites with Themes FIGURE Styling with Cascading Style Sheets. I recommend that you do all your web page design by using the method discussed in this section. You should place all your page design in an external CSS located in a Theme folder. In particular you should not modify the appearance of a control by modifying its properties. Furthermore you should avoid using Skin files. The advantage of using Cascading Style Sheets is that they result in leaner and faster loading pages. The more content that you can place in an external Style Sheet the less content must be loaded each time you make a page request. The contents of an external Style Sheet can be loaded and cached by a browser and applied to all pages in a web application. If on the other hand you modify the appearance of a control by modifying its properties additional content must be rendered to the browser each time you make a page request. For example if you modify a Label control s BackColor property an additional Style attribute is rendered when the Label control is rendered. Using Skins is no different than setting control properties. Skins also result in bloated pages. For example if you create a Skin for a Label control the properties of the Label Skin must be merged with each Label control on each page before the Label is rendered. From the Library of Wow eBook Adding Cascading Style Sheets to Themes 285 NOTE In this book I try to avoid formatting controls by using control properties. Instead I perform all the formatting in a Style Sheet embedded in the page using the style tag . I would prefer to place all the control formatting in an external Style Sheet but that would require creating a separate file for each code sample which would make this book much longer than it already threatens to be. Adding Multiple Cascading Style Sheets to a Theme You can add as many CSS files to a Theme folder as you need. When you add multiple Cascading Style Sheets to a Theme all the .