如果只是单纯设置height的话,很可能是无法撑起某些组件的,所以一般需要连同line-height一起设置,诸如以下代码:
.yourdiv { height: 40px; line-height: 40px }