PNLdev
Tutorial
Front-end
HTML
reference
CSS
reference
JavaScript
reference
En
English
فارسی
En
English
فارسی
Tutorial
Front-end
HTML
reference
CSS
reference
JavaScript
reference
Run
<!DOCTYPE html> <html> <head> <style> #main { width: 250px; height: 150px; border: 5px solid blue; display: flex; align-items: flex-start; } #main div { flex: 1; } #myBlueDiv { align-self: center; } </style> </head> <body> <h1>align-self property example</h1> <div id="main"> <div style="background-color:red;">RED</div> <div style="background-color:blue;" id="myBlueDiv">BLUE</div> <div style="background-color:green;">Green</div> </div> <p><b>Note:</b> When we use the align-self property in our codes, the align-item property becomes ineffective.</p> <p><b>Note:</b> Internet Explorer 10 and earlier versions do not support the align-self property.</p> </body> </html>