Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个以像素为单位的 div (divPix) 和一个以百分比 (divPer) 为单位的 div。divPer 的高度会随着它的内容而变化。我希望浏览器重新调整 divPix 的高度以匹配 divPer 的高度。我该怎么做呢?谢谢你。
可能可以通过快速的一次性 jQuery 来完成它。
HTML
<div id="divPix"></div> <div id="divPer"></div>
JavaScript
$(function() { $('#divPix').height( $('#divPer').height() ); });