TAILIEUCHUNG - CSS Mastery- P7

CSS Mastery- P7: The human race is a naturally inquisitive species. We just love tinkering with things. When I recently bought a new iMac, I had it to bits within seconds, before I’d even read the instruction manual. We enjoy working things out ourselves and creating our own mental models of how we think things behave. We muddle through and only turn to the manual when something goes wrong or defies our expectations. | CASE STUDY ROMA ITALIA Figure 10-1. Roma Italia home page 277 CHAPTER 10 The foundation When drafting markup the factors I consider most important are that it be as meaningful and as lightweight as possible. By meaningful I mean the HTML elements and selector names we choose appropriately represent the content in such a way that if we were to experience the web with all styling removed the hierarchy and structure of the content would still make sense. Long gone are the days of spacer GIFs and repeated br elements. These have been replaced with elements that logically or semantically represent the content An ordered list of top-selling items ol The principal heading on a page h1 A quotation from a happy customer blockquote and cite This approach requires that we remove presentational information from our thinking a concept described comprehensively by Andy Clarke in his remarkable book Transcending CSS New Riders 2006 . I still vividly recall my early experiences with CSS as we coded a rather large-scale web application thinking we were cleverly creating a series of presentational class names that allowed us to mark up content with elegant clarity such as this p class arial red 10 only to endure a painful day of reckoning when the application required a redesign and dozens of templates were to become anything but red Arial 10-pixel type. By lightweight I mean marking up our content with the fewest parts possible for all things markup elements attributes and values for HTML selectors properties and values for CSS. For example background-color c27e28 background-image url . img background-repeat no-repeat is minimized as background c27e28 url . img no-repeat You ll see numerous examples of meaningful and lightweight markup throughout this case study some of which I ll describe here and the large majority of which you ll be able to discover on your own. 278 CASE STUDY ROMA ITALIA An eye toward HTML 5 On the topic of meaningful and .

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.