Codeeffekt
http://u6.gg/Xbj
Ich m?chte den Avatar in den Rahmen einfügen und ihn anpassungsf?hig machen.
Jemand kann mir helfen, den Code zu ?ndern.
.bg添加相對定位;
給頭像外面再套一個p使用絕對定位,設(shè)你想要的大??;重點(diǎn)單位全用百分比
頭像設(shè)置width,height100%
添加class:<img class="img-box" src="./0.jpg" class="avatar">
class樣式:
.img-box {
position: absolute;
left: 150px;
top: 25px;
width: 122px;
height: 124px;
}
.bg {
position: absolute;
}
你應(yīng)該找切圖的人要具體尺寸的,我這里是靠手工調(diào)試出來的
.bg {
position: relative;
}
.avatar {
position: absolute;
top: 9%;
left: 14.5%;
width: 12%;
}
.top-bg {
width: 100%;
position: relative;
z-index: 2;
}
隨你怎么改變窗口大小