HTML Compiler Online
Javascript Online Compiler
index.html
Change Theme
Compress code
Format code
Download Code
Clear Code
Copy Code!
RunĀ
ctrl+s or click
Output
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>CSS - align self</title> <style> .container1 { display: flex; align-items: center; } #target1 { align-self: self-end; background: #bd1e60; } .container2 { display: flex; align-items: flex-start; } #target2 { align-self: center; background: #bd1e60; } .containers { height: 150px; margin: 10px 0; border: 2px solid #bd1e60; } .containers div { margin: 1px; padding: 10px 15px; color: white; font-family: sans-serif; background-color: #27aaa4; } </style> </head> <body> <h2>align-self: value</h2> <p>align-self property aligns the flex item by overwriting the align-items property.</p> <div class="containers container1"> <div>1</div> <div>2</div> <div>3</div> <div id="target1">4</div> <div>5</div> <div>6</div> <div>7</div> <div>8</div> </div> <div class="containers container2"> <div>1</div> <div>2</div> <div>3</div> <div id="target2">4</div> <div>5</div> <div>6</div> <div>7</div> <div>8</div> </div> </body> </html>
RunĀ