0
這隻發生在我的iPhone上。每次我隱藏/顯示一個元素時,它都會給出不同的字體大小。當我顯示和隱藏一個以上的元素的「全部顯示」區域打開可見性時字體大小發生變化
<style>
.asdf_2{
font-size:12px;
}
</style>
<script>
function showhide(x){
if(document.getElementById(x).style.display == '')
{
document.getElementById(x).style.display = 'none';
}
else
{
document.getElementById(x).style.display = '';
}
}
</script>
<div class="content">
<div class="asdf_all" onClick="showhide('showme1');showhide('showme2');">Show All</div>
<div class="asdf">
<div class="asdf_1" onClick="showhide('showme1');">Show1</div>
<div class="asdf_2" id="showme1" style="display:none">asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf
</div>
</div>
<div class="asdf">
<div class="asdf_1" onClick="showhide('showme2');">Show2</div>
<div class="asdf_2" id="showme2" style="display:none">asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf
</div>
</div>
</div>
你怎麼知道的東西,你不能看到字體大小變化? – Ryan
Show1,Show2顯示正確的字體大小。這只是「顯示全部」,正在改變字體大小。 – user1949899
它適合屏幕的框?就像當你隱藏第一個盒子時,第二個盒子有更多的空間,所以它擴大了? –