扫码关注官方订阅号
多张图片横向并排显示,自动换行后,可以上下两排图片都居中显示吗
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Document</title> <style> div{ text-align: center; } </style> </head> <body> <div> <img src="http://www.php.cn/static/images/footer.gif" alt=""> <img src="http://www.php.cn/static/images/footer.gif" alt=""> <img src="http://www.php.cn/static/images/footer.gif" alt=""><br> <img src="http://www.php.cn/static/images/footer.gif" alt=""> <img src="http://www.php.cn/static/images/footer.gif" alt=""> </div> </body> </html>
DIV居中可以了
不行的,试过了。如果没有自动换行可以居中显示,有自动换行后就左对齐的
text-align:center,这个就可以解决你的问题
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
扫描下载App
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
DIV居中可以了
不行的,试过了。如果没有自动换行可以居中显示,有自动换行后就左对齐的
text-align:center,这个就可以解决你的问题