摘要:
Over the generations, people realized that math is not fun, so a new CSS property called box-sizing was created. When you set box-sizing: border-box; on an element, the padding and border of that elem... 阅读全文
摘要:
#main { max-width: 600px; margin: 0 auto; }Using max-width instead of width in this situation will improve the browser's handling of small windows. This is important when making a site usable on mob... 阅读全文
摘要:
虽然写过很多css代码,但每次动手写都让我痛苦不堪,如何组织好那一堆堆的代码,如何提高代码复用率,甚至如何命名类,这些都让我纠结。下面的浅显的谈一谈在看了《编写高质量代码》中的html和css部分以及搜索网络上一些相关资料对编写高质量的HTML和CSS的一些基本认识。 HTML 在说css之前必须先说说html ,没有它css是浮云。就像是要建栋别墅,光有那些装饰品(css)没有房子基本的结构... 阅读全文
摘要:
老是被人问到px、pt和em的区别,自己有时候也会纠结到底该用什么单位,今天特意查了一些文章,下面这篇虽然很久远了,但解释的比较全面,转载收藏之。点击查看原文 这里引用的是Jorux的“95%的中国网站需要重写CSS”的文章,题目有点吓人,但是确实是现在国内网页制作方面的一些缺陷。我一直也搞不清楚px与em之间的关系和特点,看过以后确实收获很大。平时都是用px来定义字体,所以无法用浏览器字体... 阅读全文