⭐请看下面的代码,可以使多个图片在同一行展示
核心代码
display: flex; /*就是可以把多个图片放在一行展示,发不下的话再换行*/
🏳️🌈🏳️🌈🏳️🌈🏳️🌈🏳️🌈🏳️🌈
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>第三 展示部分</title> <style> #exhibition { width: 980px; height: 292px; margin: 0 auto; padding-top: 170px; background-repeat: no-repeat; } .aaa { margin: 0 auto; display: flex; /*就是可以把多个图片放在一行展示,发不下的话再换行*/ } div { padding-left: 15px; height: 260px; width: 916px; } </style> </head> <body> <div id="exhibition"> <div class="aaa"> <div><img src="ikun.png" alt=""></div> <div><img src="ikun.png" alt=""></div> <div><img src="ikun.png" alt=""></div> <div><img src="ikun.png" alt=""></div> </div> </div> </body> </html>