1.上下外邊距會疊壓
2.父子級包含的時候,子級的margin-top會傳遞給父級。
3.設置 margin-left:auto 時,此時 元素會緊緊的靠在 右側
4.設置 margin-right:auto 時,此時 元素會緊緊的靠在 左側
5.綜合3.4兩點 當同時設置 margin-left:auto; margin-right:auto 時,元素會緊緊的位於父類元素的正中間
總結:
外邊距存在很多問題,建議用內邊距(padding)替代外邊距
1.上下外邊距會疊壓
2.父子級包含的時候,子級的margin-top會傳遞給父級。
3.設置 margin-left:auto 時,此時 元素會緊緊的靠在 右側
4.設置 margin-right:auto 時,此時 元素會緊緊的靠在 左側
5.綜合3.4兩點 當同時設置 margin-left:auto; margin-right:auto 時,元素會緊緊的位於父類元素的正中間
總結:
外邊距存在很多問題,建議用內邊距(padding)替代外邊距
作者:mandy 1.實現效果 2.html部分: <div id="ifrContentId"></div> 3.js部分 $(document).ready(function () {