您的位置:首頁技術文章
文章詳情頁

多張圖片自動換行后圖片居中顯示

瀏覽:108日期:2024-05-21 09:27:46

問題描述

多張圖片橫向并排顯示,自動換行后,可以上下兩排圖片都居中顯示嗎

問題解答

回答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,這個就可以解決你的問題

相關文章:
国产综合久久一区二区三区