源代碼
點擊運行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>教程</title> <style> img.top {vertical-align:text-top;} img.bottom {vertical-align:text-bottom;} </style> </head> <body> <p>一個<img src="/images//images//images/logo.png" alt="w3cschool" width="270" height="50" />默認對齊的圖像。</p> <p>一個<img class="top" src="/images//images//images/logo.png" alt="w3cschool" width="270" height="50" /> text-top 對齊的圖像。</p> <p>一個<img class="bottom" src="/images//images//images/logo.png" alt="w3cschool" width="270" height="50" /> text-bottom 對齊的圖像。</p> </body> </html>
運行結果