HTML CSS examples for CSS Layout:Box
make an inline-block box stick to the top
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> .a<!--from ww w. jav a 2 s.c om--> { width:100px; height:401px; display:inline-block; background-color:Chartreuse; vertical-align:top; } .b { width:401px; height:601px; display:inline-block; margin-left:31px; background-color:yellow; } </style> </head> <body> <div class="container"> <div class="a"></div> <div class="b"></div> </div> </body> </html>