CSS Mastery

Simon Collison, Andy Budd, Cameron Moll

出版社

Apress

出版时间

2009-10-29

ISBN

9781430223979

评分

★★★★★
书籍介绍
这本书最打动人的,是它把看似繁杂的 CSS 讲成了有内在逻辑的整体。它反复强调一个朴素却少有人坚持的理念:语义化的标记优先于表现,class 命名要描述"是什么"而非"长什么样",避免"classitis"这类给每个元素都套一层的坏习惯。书中把布局归结为定位、浮动、margin 三个根本概念,让初学者能看清门道而非死记技巧。它适合两类人:一是刚接触 CSS、想建立正确思维方式的人;二是写过不少代码、却被多浏览器兼容和 specificity 冲突困扰、希望理清"为什么这条规则不生效"的人。它不追求炫技,而是帮你把规则想清楚后再面对千变万化的兼容问题。
AI导读
核心看点
  • 系统梳理CSS布局核心:定位、浮动与边距。
  • 深入解析CSS3特性及多浏览器兼容方案。
  • 强调语义化标记与高效选择器命名规范。
读者共识
  • 结构清晰,是系统学习CSS的经典之作。
  • 部分技术细节陈旧,需甄别过时内容。
  • 译文质量参差,建议对照原文或代码阅读。
精彩摘录
  • "所有CSS布局的根本都是3个基本概念:定位、浮动、margin操纵。"
  • "在符合标准的浏览器中,如果元素的内容太大,它只会超出box之外。但是,IE会扩展整个元素(。。。-_-)"
  • "Meaningful markup provides the developer with several important benefits. Meaningful pages are much easier to work with than presentational ones. For example, say you need to change a quotation on a page. If the quotation is marked up correctly, it is easy to scan through the code until you find the"
  • "When naming your IDs and classes, it is important that you keep the names as “unpresentational” as possible. For instance, if you want all of your form notification messages to be red, you could give them a class of red. This is fine as long as there are no other red elements on the page. However, s"
  • "At the same time, they can be overused and even abused. Novice CSS authors often add classes to nearly everything in an attempt to get fine-grained control over their styles. Early WYSIWYG editors also had the tendency to add classes each time a style was applied. Many developers picked up this bad "
  • "In the preceding example, each element is identified as being part of a news story by using an individual news-related class name. This has been done to allow news headlines and text to be styled differently from the rest of the page. However, you don’t need all these extra classes to target each in"
  • "When browser manufacturers started to create standards-compliant browsers, they wanted to ensure backward compatibility. To accomplish this, they created two rendering modes: standards mode and quirks mode. In standards mode, the browser renders a page according to the specifications, and in quirks "
  • "With even a moderately complicated style sheet, it is likely that two or more rules will target the same element. CSS handles such conflicts through a process known as the cascade. The cascade works by assigning an importance to each rule. Author style sheets are those written by the site developers"
用户评论
详尽清晰文笔佳
作者对CSS技巧的一些经验之谈。并提及了CSS 3。
入门css的好书
CSS3万岁~~~
除了case完全啃完,所以还是practice makes perfect,一边看一边练,一点点递进,其实css的知识点真的不算多,最奇妙的是一个效果可以有好几种方法去实现,大头还是兼容性问题,但是规则清楚之后真是没什么。作者开头几句话说的很欢乐,国外的大神们都喜欢引一些对人类天性的思考。最大的收获大概就是更好的用了后代选择器,再也不要一堆class id的去控制自己的css了。css3是个很令人振奋的地方,语意化是一直要努力的方向。
虽然内容有些过时了,但是整体上还是非常不错的一本书,结构清晰,能够带你完整又系统地学习CSS相关知识,我很喜欢书中实现的日历样式,非常的精巧时尚
内容较旧 可读性差
几年前看的,当时印象深刻
因为是6年前的书了,所以很多内容过时了,比如书中讨论了很多关于IE6以及更低版本IE浏览器的支持,比如大量使用background image. 像CSS这样更新换代很快的语言,还是推荐看更新的书.
还是有点老了...
下载
收藏