簡體   English   中英

如何增加圖像頂部的高度並保持底部固定?

[英]How to increase the height by the top of an image and keep the bottom fixed?

我想使用jQuery調整圖像HTML的大小。

這很容易elt.css({height: '42px'}) ,但是我的問題是圖像的放大倍數在底部,即圖像的頂部不動,而底部是拉伸或捷徑。

像這里: http : //jsfiddle.net/763wumr0/

絕對編輯: http//jsfiddle.net/763wumr0/12/

我想換一種方式! 圖像的底部是固定的,即圖像的頂部增加或減少。

我怎樣才能做到這一點?

謝謝。

用絕對定位?

http://jsfiddle.net/OxyDesign/pss3ysru/

的CSS

.img-container{
    width: 50px;
    height: 50px;
    position:relative;
}
.img-bottom
{
    width: 50px;
    height: 50px;
    position:absolute;
    bottom:0;
    left:0;
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM