所以我的頁腳有問題:我有兩個頁面使用特定的位置值,并且由于它們與所有其他頁面不同,設定為的頁腳
position: absolute
bottom: 0
不粘在底部并且有問題......對于2頁,當我使用時,頁腳將粘在底部:
position: relative
bottom: 0
所以現在我問是否有辦法將 2 個特定頁面的絕對值更改為相對值?
頁腳位于共享檔案夾中,這意味著它會自動放置到所有頁面中
uj5u.com熱心網友回復:
您可以根據當前頁面向正文添加一個類,以在特定情況下添加 css:
.footer{
position: absolute;
bottom: 0;
}
.login .footer, .shop .footer{
position: relative;
}
html:
<body class="login">
<div class="footer"></div>
</body>
uj5u.com熱心網友回復:
<div style = "position: absolute; bottom:0; ">
和對于另一個標簽
<div style = "position: relative; bottom:0; ">
使用行內 CSS
uj5u.com熱心網友回復:
我的建議是,在這兩個特定頁面上再添加一個具有
position: realtive; !important
這樣它將覆寫基類的絕對定位。
uj5u.com熱心網友回復:
您可以對這些頁面使用行內 css,如下所示:
第 1 頁:
<div style = "position: relative; bottom:0; ">
第2頁:
<div style = "position: absolute; bottom:0; ">
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/465711.html
