Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Title of the document</title> <style> div { color: #ffffff; display: flex; display: -webkit-flex; align-items: flex-start; -webkit-align-items: flex-start; } #box-one { background-color: #1c87c9; } #box-two { background-color: #8ebf42; } #box-three { background-color: #cccccc; } #box-four { background-color: #666666; } .normal { height: 100px; width: 100px; display: inline-block; } .big { height: 200px; width: 200px; display: inline-block; padding: 10px; } </style> </head> <body> <div> <span id="box-one" class="normal">Blue</span> <strong id="box-two" class="normal">Green</strong> <span id="box-three" class="normal">Grey</span> <span id="box-four" class="big"> The last div vertically aligns to its content's last line of text. How to align the top of all the colored divs. </span> </div> </body> </html>