Tham khảo tài liệu 'creating applications with mozilla-chapter 4. css in mozilla applications-p1', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Chapter 4. CSS in Mozilla Applications-P1 This chapter describes how Cascading Style Sheets CSS are used to create the look and feel of a Mozilla application s interface. Although XUL has a central role in creating a structure for an application s interface defining widgets and their functionality and creating the basic application code it is CSS that creates the visible portion of an application. XUL and CSS often work so closely together that they seem inseparable but XUL is generally responsible for the structure of an application s interface and CSS is responsible for the application s presentation. As described in the next sections it is not until an XPFE application has been skinned or styled with stylesheets that it has a usable interface. The first few sections in this chapter provide basic information about using CSS and some examples of how the Mozilla interface is created. They include reference material you can refer back to as you learn more. Starting with the Creating New Skins section you can dive in have some fun with CSS and begin to create your own skins. The xFly package example created earlier in the book shows how to add custom styles to the XUL files you created in Chapters Chapter 2 and Chapter 3. . Interface Basics Before describing the practice of using CSS let s get some basic theory out of the way. When we talk about the interface of an application we mean all of the parts of the application that are displayed and allow the user to interact. Buttons windows pages menus sliders and descriptive text are all parts of the interface. In Mozilla XUL usually defines the basic structure of the interface and CSS defines its presentation. These two aspects of the interface -- the way it s organized and the way it s presented -- are kept as distinct from one another as possible in Mozilla and in many good programming environments. Indeed this separation is what gives rise to the concept of skins -- coherent separate and typically swappable looks