2 回答

TA貢獻(xiàn)1859條經(jīng)驗 獲得超6個贊
該圖像被設(shè)置為您的背景<div>,因此它的大小將取決于該圖像的width和。因此,如果高度較大,則會顯示更多內(nèi)容。只是為了說明,請檢查下面我的代碼。我已經(jīng)給出了a ,現(xiàn)在圖像顯示了該高度。height<div>background-image<div>height : 600px
因此,簡而言之,您的背景圖像僅顯示元素的大小。元素越大,圖像就會出現(xiàn)越多。
<div class="container"
style=" height: 600px; /* Just to illustrate */
position: relative;
background: url('https://firebasestorage.googleapis.com/v0/b/growthfilepractice.appspot.com/o/1%20(2).jpg?alt=media&token=48244df9-a2bb-412a-81f5-854e2dbc4939');
background-repeat: no-repeat;
background-size:500px 500px;">
<a class="nameAnchor"
href ="https://github.com/"
style=" text-decoration: none;
position: absolute;
color: white;
left: 10px; /* Set your Left position here */
top: 100px; /* set your top position here */
">
<span>Amarjeet Singh</span>
</a>
</div>
- 2 回答
- 0 關(guān)注
- 138 瀏覽
添加回答
舉報