一

{"type":"编程笔记"}


  • Home

  • Archives
  • Search

collapsing margins of table

Posted on 2010-02-03   |   In css

display=block的元素,垂直方向的collapsing margins会发生重合。

ie8/safari/chrome中table默认的display=table,其渲染时vertical margin会发生重合,与display=block的元素效果一样,但在firefox中测试其效果与float元素的效果一样,不会发生垂直方向的margin重合。

个人的解决方法是将table设置为float=left,并在其后设置一个clear=both的div,避免table的margin被重合。

关于collapsing margins详细说明可查看CSS21规范的8.3.1 Collapsing margins。

另外对于一个maring:10px的div元素,如果此元素没有内容,并没有设置padding和border值,其上部的margin与其下部的margin也会重合,也就是此div在垂直方向上只会占据10px的高度。如果此div的top或者bottom与别的元素发生过重合,则其本身的top和bottom margin不会再重合。

规范原文说明如下

If the top and bottom margins of a box are adjoining, then it is possible for margins to collapse through it. In this case, the position of the element depends on its relationship with the other elements whose margins are being collapsed.

If the element’s margins are collapsed with its parent’s top margin, the top border edge of the box is defined to be the same as the parent’s.

Otherwise, either the element’s parent is not taking part in the margin collapsing, or only the parent’s bottom margin is involved. The position of the element’s top border edge is the same as it would have been if the element had a non-zero top border.

mysql客户端中比较有用的几个命令

Posted on 2010-01-28   |   In mysql

help

Read more »

mysql-5.0.37同步备份恢复的三种方法

Posted on 2009-12-10   |   In mysql

第一种

最简单的方法适用于数据库文件比较小,能在停止主数据库服务后几分钟内打完tar包的情况,这种情况与第一次做slave同步的方法一样:

Read more »

mysql-5.0.37 replication fails with log event entry exceeded max_allowed_packet

Posted on 2009-12-10   |   In mysql

配置文件中有二个参数设置需要注意,max_allowed_packet在主从服务器上的设置最好是设置相同,并且将read_buffer_size <= max_allowed_packet。

如果这二个配置正确,仍然报错,则需要stop slave,并change master to,调整master_log_pos的值,这个值与服务器的日志文件要对应上。

Read more »

mysql5中注意uuid函数的使用

Posted on 2009-12-03   |   In mysql

NOW()函数,因为在二进制日志里已经包括了时间戳,可以被正确复制到slave server上。

UUID()函数,具有非确定性,所以不能被复制到slave server,所以在存储过程或者触发器中要慎用。

UUID()

Read more »
1…515253…99
yuweijun

yuweijun

492 posts
12 categories
RSS
GitHub Twitter
© 2021 yuweijun
Powered by Hexo
Theme - NexT.Mist.KISS