DIV CSS 佈局教程網

 DIV+CSS佈局教程網 >> 網頁腳本 >> CSS入門知識 >> CSS詳解 >> CSS學習筆記:任意大小圖片是自適應居中
CSS學習筆記:任意大小圖片是自適應居中
編輯:CSS詳解     
文章簡介:平時筆記.強制換行:word-warp:block-Word; 任意大小圖片是自適應居中: CSS: .wrapperBox{border:1px solid red; width:100px; height:100px; display:table-cell; font-size:0; text-align:center; vertical-align:middle; *position:relative;padding:0; overflow:hidden; } .innerBox{text-align:center; vertical-align:middle; width:100px\9; *width:auto;font-size:0; *position:absolute;*top:50%;*left:50%;} img{ max-height:100px; max-width:100px; *position:relative;*bottom:50%;*right:50%;margin:0 auto;} Html <div class="wrapperBox"> <div class="innerBox"> <img src=/School/UploadFiles_7810/201603/20160324131436353.jpg" />
XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved