1. 100% width divs not spanning entire width of the browser in webkit. Even Body can not span the entire width of the  browser. 
So crazy.
There is a funny way to fix it: 
html { overflow-y: scroll; }

2.  When Div is 100% width, set padding: 20px. Then its actual width is bigger than 100%. Be careful!!!!

3. Book review:

>1. Margin collapsing
Margin collapsing only happens with the vertical margins of block boxes in the normal flow of the 
document. Margins between inline boxes, floated, or absolutely positioned boxes never collapse. 
 
>2. Inline boxes
Inline boxes are laid out in a line horizontally. Their horizontal spacing can be adjusted using 
horizontal padding, borders, and margins (see Figure 3-9). However, vertical padding, borders, 
and margins will have no effect on the height of an inline box. Similarly, setting an explicit height 
or width on an inline box will have no effect either. The horizontal box formed by a line is called a 
line box, and a line box will always be tall enough for all the line boxes it contains. There is 
another caveat, though—setting the line height can increase the height of this box. Because of 
these reasons, the only way you can alter the dimensions of an inline box is by changing the line 
height or horizontal borders, padding, or margins. 
 
>3. display: inline-block
Helpfully, CSS2.1 allows you to set the display property of an element to be inline-block. As 
the name suggests, this declaration makes the element line up horizontally as if it were an inline 
element. However, the contents  of the box behave as though the box were a block-level, 
including being able to explicitly set widths, heights, vertical margins, and padding. Historically, 
this property has been poorly supported; hence, it’s relative obscurity. Thankfully, inline-block is 
now supported by Firefox 3.0 and above, IE 8, and  the latest versions of Safari and Opera, so I 
think we are going to see inline-block being used to create more interesting layouts over the 
next few years.  
 
position: static, relative, absolute, fixed
>4. position: relative and absolute
The main problem people have with positioning is remembering which type of 
positioning is which. Relative positioning is “relative” to the element’s initial 
position in the flow of the document, whereas absolute positioning is “relative” 
to nearest positioned ancestor or, if one doesn’t exist, the initial container block.
 
>5. float
Because floated boxes aren’t in the normal flow of the document, block boxes in the regular flow 

of the document behave as if the floated box wasn’t there.

最新文章

  1. ITerm2下使用ssh访问Linux
  2. 使用Android点击按钮跳转页面
  3. mongodb学习5--mongo的type类型
  4. InnoDB主键设计
  5. z-index属性
  6. js里的原型
  7. 版本控制 - SVN/TortoiseSVN
  8. c# DataGridView操作
  9. (转载)关于gcd的8题
  10. 使用ARM模板部署自动扩展的Linux VMSS(1)
  11. 爬虫框架Scrapy 之(一) --- scrapy初识
  12. (转)SQLServer_十步优化SQL Server中的数据访问 二
  13. linux 7 更改主机名
  14. 关于Https
  15. Spring 集成 Swagger UI
  16. SQLSERVER创建该存储过程时不会出错,但是执行存储过程时报错
  17. Spring Cloud(Dalston.SR5)--Feign 与 Hystrix 断路器整合
  18. 使用crf++
  19. 【webstorm】project目录树显示不出
  20. CENTOS7更换YUM源为163源

热门文章

  1. 基于nodejs实现js后端化处理
  2. 碰到一个在app内部浏览器锚点异常的问题
  3. Eclipse:Cannot complete the install because of a conflicting dependency.问题解决
  4. 状态图 Statechart Diagram
  5. easyui textbox event 添加
  6. [转]Handy adb commands for Android
  7. 【NS2仿真】TCP协议
  8. Visual Studio 2010 简体中文旗舰、专业版(MSDN原版下载)
  9. 关于全局唯一ID生成方法
  10. WEB 安全之 SQL注入 < 三 > 提权