如何使這些div當窗口調整大小,並在移動設備上是100%的寬度,以向下移動; Subject class =「project-cards」DIV垂直移動窗口調整大小後
繼承人的代碼... 調整窗口大小。 這裏有很多事情要做,首先當窗口調整大小時,我想讓三個div向下移動到一個垂直行。當窗口達到大約一個手機的大小,我想三個div仍然是垂直的,寬度爲100%;因此它覆蓋了整個頁面的寬度。調整大小時,您可以看到div內的內容出現問題。例如文本和按鈕重疊。我知道我不能問兩個問題,但如果你能幫我讓三個div有迴應,那對我會有很大的幫助。訪問網站Xlaeo.tk
.mainCenter{
width:100%;
padding-right:100px;
padding-left:100px;
padding-top: 50px;
height:700px;
}
.project-wrapper{
margin-top: 420px;
}
.headerProjects{
font-size: 25px;
font-weight: BOLD;
margin-left: 52px;
margin-bottom: 20px;
color: #d80068;
}
.projectholders{
height:auto;
width:100%;
margin:0 auto;
display: flex;
justify-content: center;
margin-bottom: 100px;
min-width: 200px;
}
.projects-cards{
border:.9px solid #f7f7f7;
border-radius: 2rem;
display: block;
width: 30%;
margin-left:25px;
}
.projects-cards:hover{
box-shadow: 0 2px 4px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12);
transition-delay: 1s;
transition-duration: .5s;
}
.media-top{
width:100%;
height:300px;
border-bottom: 1.9px solid gray;
position: relative;
}
.media-top img{
border-top-left-radius: 2rem;
border-top-right-radius: 2rem;
}
.project-info{
width:100%;
}
.progress-left{
float: left;
width: 150px;
height: 150px;
}
.project-money{
float: right;
width: 170px;
border-bottom: 1px solid #c7c8c9;
}
.project-money h1{
font-size: 16.9px;
color: gray;
font-weight: bold;
width:900%;
}
.visitProject-button-H{
padding: 20px;
float:right;
}
.visi-project{
height:50px;
width:135px;
background-color: #ff0043;
font-size: 20px;
font-weight: bold;
border:none;
border-top-left-radius: 1rem;
border-bottom-left-radius: 1rem;
}
.under{
display: flex;
margin:0 auto;
justify-content: center;
font-size: 60px;
color: #ff0043;
}
<div class="projectholders">
<div class="projects-cards">
<div class="media-top" >
<img src="http://cdn.pcwallart.com/images/mercedes-benz-biome-seed-wallpaper-1.jpg" width="100%" height="100%" />
</div>
<div class="project-info">
<div class="progress-left">
<img src="https://camo.githubusercontent.com/40a03a2e27517edee74b177b7d48f1632b31c693/687474703a2f2f692e696d6775722e636f6d2f414a30364157452e706e67"
width="100%" height="100%;" />
</div>
<div class="project-money">
<h1>Backed by $102,323 </h1>
</div>
<div class="visitProject-button-H">
<button class="visi-project" type="button">Visit</button>
</div>
</div>
</div>
<div class="projects-cards">
<div class="media-top">
<img src="https://cdn.dribbble.com/users/149817/screenshots/1436337/speedcam.gif" width="100%" height="100%" />
</div>
<div class="project-info">
<div class="progress-left">
<img src="https://camo.githubusercontent.com/40a03a2e27517edee74b177b7d48f1632b31c693/687474703a2f2f692e696d6775722e636f6d2f414a30364157452e706e67"
width="100%" height="100%;" />
</div>
<div class="project-money">
<h1>Backed by $9,564 </h1>
</div>
<div class="visitProject-button-H">
<button class="visi-project" type="button">Visit</button>
</div>
</div>
</div>
<div class="projects-cards">
<div class="media-top">
<img src="http://coolwallpaperz.info/user-content/uploads/wall/o/27/girl-motorcycle-streamlined-cool-sumer-370761.jpg" width="100%" height="100%" />
</div>
<div class="project-info">
<div class="progress-left">
<img src="https://camo.githubusercontent.com/40a03a2e27517edee74b177b7d48f1632b31c693/687474703a2f2f692e696d6775722e636f6d2f414a30364157452e706e67"
width="100%" height="100%;" />
</div>
<div class="project-money">
<h1>Backed by $23,324 </h1>
</div>
<div class="visitProject-button-H">
<button class="visi-project" type="button">Visit</button>
</div>
</div>
</div>
</div>
檢查這些鏈接 https://www.w3schools.com/css/css_rwd_viewport.asp, https://www.w3schools.com/css/css_rwd_mediaqueries .asp –