javascript - css layout problem! Come to God
世界只因有你
世界只因有你 2017-05-18 11:01:03
0
5
475

Code effect
http://u6.gg/Xbj

I want to put the avatar into the frame and make it adaptive.

Here comes a master to help me change the code.

世界只因有你
世界只因有你

reply all(5)
洪涛
  1. .bg adds relative positioning;

  2. Put a p outside the avatar and use absolute positioning, set the size you want; Use percentages for all key units

  3. Avatar setting width, height100%

过去多啦不再A梦

img length and width are 100%

为情所困

Image adaptive img {max-width: 100%;}
Place that person in the picture

我想大声告诉你

Add class: <img class="img-box" src="./0.jpg" class="avatar">

class style:

.img-box {
position: absolute;
left: 150px;
top: 25px;
width: 122px;
height: 124px;
}
.bg {
position: absolute;
}
You should find the cut image People want specific sizes, I made them by manual debugging

Ty80
.bg {
    position: relative;
}

.avatar {
    position: absolute;
    top: 9%;
    left: 14.5%;
    width: 12%;
}

.top-bg {
    width: 100%;
    position: relative;
    z-index: 2;
}

Change the window size as you wish

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!