当前位置: 动力学知识库 > 问答 > 编程问答 >

javascript - height property

问题描述:

I have 2 div tag: <div class="right"> and <div class="left"> both right class and left class have height property is auto. I want height of left = height of right. Sorry I not enough lever to post code.

网友答案:

I think you can do $(".left").height($(".right").height()).

网友答案:

You can get one element's height by height().

and set one element's height by

css('height', 'the height')

so:

$('.right').css('height', $('.left').height() + 'px');

jsFiddle

Update:

.height(value)

is better :)

分享给朋友:
您可能感兴趣的文章:
随机阅读: