题解 | #display - flex#
display - flex
https://www.nowcoder.com/practice/3cc2145587af4382a6017c2e568b9adf
<!DOCTYPE html> <html> <head> <meta charset=utf-8> <style type="text/css"> * { margin: 0; padding: 0; box-sizing: border-box; } nav ul { height: 2rem; list-style: none; display:flex; flex-direction: row; justify-content: center; align-items: center; } nav ul li { border: 1px solid black; justify-content: flex-start; align-items: stretch; } nav ul li:first-child { font-size: 1.2rem; } </style> </head> <body> <nav> <ul> <li>home</li> <li>spaceships</li> <li>planets</li> <li>stars</li> </ul> </nav> </body> </html>