css 圖片和文字對齊的辦法
全文:https://jingyan.baidu.com/article/75ab0bcbeee547d6874db256.html
實驗代碼:
<!doctype html> <html> <head> <meta charset="utf-8"> <title>無標題文檔</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css"> <script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script> <script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script> </head> <body> <div class="container"> <img style="vertical-align:bottom" src="http://www.runoob.com/wp-content/uploads/2014/06/64.jpg"> 本章我們將講解 Bootstrap 中的多媒體對象(Media Object)。這些抽象的對象樣式用於創建各種類型的組件(比如:博客評論),我們可以在組件中使用圖文混排,圖像可以左對齊或者右對齊。媒體對象可以用更少的代碼來實現媒體對象與文字的混排。 媒體對象輕量標記、易於擴展的特性是通過向簡單的標記應用 class 來實現的。你可以在 HTML 標簽中添加以下兩種形式來設置媒體對象: </div> </body> </html>
//我記得 Bootstrap 有一個類是可以實現這樣的效果的,文本圍繞用的是“多媒體類”,而以上代碼實例的效果是圖片底部對齊文本第一行。
學習:http://www.runoob.com/cssref/pr-pos-vertical-align.html