How to align a div to the top of its parent but keeping its inline-block behaviour?

后端 未结 5 2098
后悔当初
后悔当初 2020-11-29 21:38

See: http://jsfiddle.net/b2BpB/1/

Q: How can you make box1 and box3 align to the top of the parent div boxContainer?

#boxContainerContai         


        
5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-29 21:48

    As others have said, vertical-align: top is your friend.

    As a bonus here is a forked fiddle with added enhancements that make it work in Internet Explorer 6 and Internet Explorer 7 too ;)

    Example: here

提交回复
热议问题