1 回答

TA貢獻1816條經驗 獲得超6個贊
您沒有使用 id 選擇器來引用 css 頁面中的頁腳部分,可能您在 CSS 文件的底部引用了 #fixed 來代替頁腳。
// 使用這個代替
#footer{
position: fixed;
bottom: 0;
left: 0;
height :50px;
width:100%;
background-color: transparent;
}
您在菜單導航、部分和細分 (#portfiolio) 上使用了相同的選擇器,您需要學習如何正確創建布局并正確使用 css 選擇器。您可以在 udemy 網頁設計簡介上免費學習。他們的解釋非常好,還有 Youtube 上的 Kenvin Powell 介紹 css 課程。
快速修復 獲取一個父級 div 和 2 個子級
<div class="parentDiv">
<div class="bgDiv"></div>
<div class="contentDiv></div>
</div>
假設當前屏幕尺寸為 746px,您可以使用這些單位來獲得所需的輸出
.parentDiv{
width: 646px;
max-width: 100%;
position: relative;
max-width: 100%;
margin: auto;
perspective: 500px;
height: 100%;
}
.bgDiv{
box-shadow: inset -3px -70px 8px 6vw rgba(255, 255, 255, 0.8);
background-image: linear-gradient(rgba(245, 242, 242, 0.44), rgba(255,
255, 255, 0.5)), url(https://placebear.com/500/300);
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-repeat: no-repeat;
z-index: -999;
background-size: cover;
}
.contentDiv{
position: absolute;
z-index: 999;
top: 20px;
left: 50px;
transform: translate3d(25px, 25px, 50px);
padding: 4rem;
}
- 1 回答
- 0 關注
- 132 瀏覽
添加回答
舉報