首页
极刻
圈子
教程
开源
登录 / 注册
返回教程:CSS 教程
TRY RUN / 在线示例
CSS 教程 垂直对齐图像
CSS 教程 垂直对齐图像
源代码
运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>安科教程(www.ancii.com)</title> <style> img.top {vertical-align:text-top;} img.bottom {vertical-align:text-bottom;} </style> </head> <body> <p>An <img src="/statics/images/w3c/logo.png" alt="w3cschool" width="270" height="50" /> image with a default alignment.</p> <p>An <img class="top" src="/statics/images/w3c/logo.png" alt="w3cschool" width="270" height="50" /> image with a text-top alignment.</p> <p>An <img class="bottom" src="/statics/images/w3c/logo.png" alt="w3cschool" width="270" height="50" /> image with a text-bottom alignment.</p> </body> </html>
运行结果