九宫格加边框(移动端flex布局)

tech2024-03-31  71

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>grids</title> <style> .grids { display: flex; flex-wrap: wrap; border-top: 1px solid #eee; border-left: 1px solid #eee; } .grids .item { display: flex; flex-direction: column; justify-content: center; align-items: center; width: 33.3333333%; height: 125px; border-right: 1px solid #eee; border-bottom: 1px solid #eee; box-sizing: border-box; } .grids .item .icon { width: 100px; height: 100px; border-radius: 50px; background-color: pink; margin-top: 5px; } </style> </head> <body> <div class="grids"> <div class="item"> <div class="icon"></div> <p>1</p> </div> <div class="item"> <div class="icon"></div> <p>2</p> </div> <div class="item"> <div class="icon"></div> <p>3</p> </div> <div class="item"> <div class="icon"></div> <p>4</p> </div> <div class="item"> <div class="icon"></div> <p>5</p> </div> <div class="item"> <div class="icon"></div> <p>6</p> </div> <div class="item"> <div class="icon"></div> <p>7</p> </div> <div class="item"> <div class="icon"></div> <p>8</p> </div> <div class="item"> <div class="icon"></div> <p>9</p> </div> </div> </body> </html>
最新回复(0)