您的位置:首页技术文章
文章详情页

多张图片自动换行后图片居中显示

【字号: 日期:2024-05-21 09:27:46浏览:72作者:猪猪

问题描述

多张图片横向并排显示,自动换行后,可以上下两排图片都居中显示吗

问题解答

回答1:

<!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居中可以了

回答2:不行的,试过了。如果没有自动换行可以居中显示,有自动换行后就左对齐的回答3:

text-align:center,这个就可以解决你的问题

相关文章: