私は3列フレックスボックスを持っています。各列内では、ボタンを列の左下の隅に固定する必要があります。多くの研究と試行錯誤の後、私はこれを達成できないように見えます。画面の幅を変えて見ると、ボタンは常に列の上または下に移動します。私は、テキストセクション内のボタンを含めることを試みたし、また、列内の自分のdivのボタンを設定します。下のCSSで達成されているすべての画面幅で、列が同じ高さのままであることが重要です。誰もこの問題を助けることができますか?ボタンがフレックスボックスカラムの底に固定されていません
.flexbox {
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
flex-wrap: wrap;
}
.flexbox .col {
flex: 1;
margin: 10px;
}
.flexbox_colbutton {
flex: 1;
background: #fff;
align-items: flex-end;
display: flex;
justify-content: left;
}
.flexbox .col:nth-child(1) {
background: #fff;
-webkit-order: 0;
-ms-flex-order: 0;
order: 0;
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
}
.flexbox .col:nth-child(2) {
background: #fff;
-webkit-order: 1;
-ms-flex-order: 1;
order: 1;
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
}
.flexbox .col:nth-child(3) {
background: #fff;
-webkit-order: 2;
-ms-flex-order: 2;
order: 2;
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
}
.flexbox .col:nth-child(4) {
background: #fff;
-webkit-order: 3;
-ms-flex-order: 3;
order: 3;
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
}
@media (max-width: 480px) {
.flexbox col {
max-width: 98%;
}
\t
\t .flexbox {
flex-direction: column;
}
<div class="flexbox">
<div class="col">
<br>
<h5><center><strong>recent testimonial</strong></center></h5>
<p class="text-justify w3-padding">..DREW performed very well from the outset. When we had to value-engineer the project to bring it within budget they were extremely helpful with advice and assistance. The Site Manager was courteous and informative, and throughout performance levels were excellent."<br><br>
<i>Mark Holloway, Countryside Operations Manager, Bournemouth Borough Council<br>
[Hengistbury Head Visitor Centre]</i></p>
<br><br>
<div class="flexbox_colbutton">
<button class="w3-btn w3-red w3-medium" href="#">view project</button>
</div>
</div>
<div class="col">
<br>
<h5><center><strong>WHY OUR CLIENTS CHOOSE DREW</strong></center></h5>
<p class="text-justify text-left w3-padding">
✔ our clients are our first priority <br>✔ triple badge ISO accreditation <br>✔ highly experienced Director-led project teams<br>
✔ collaborative working approach to project delivery<br>
✔ extensive in-house technical expertise <br>✔ financially stable and long-established Company <br>
✔ excellent record on health, safety and the environment</p><br>
<br>
<div class="flexbox_colbutton">
<button class="w3-btn w3-red w3-medium" href="#">read more</button>
</div>
</div>
<div class="col">
<br>
<h5><center><strong>recent testimonial</strong></center></h5>
<p class="text-justify w3-padding">"..The scheme was delivered to budget and, although a challenging design, is of the highest quality. During construction DREW worked to ensure it responded with practical solutions to some challenging requirements .. I would certainly recommend them for future projects."<br><br>
<i>David Morris, Sweett (UK)<br>[St George's Primary School]</i></p><br>
<br><br>
<div class="flexbox_colbutton">
<button class="w3-btn w3-red w3-medium" href="#">view project</button>
</div>
</div>
</div>
こんにちはジョシュア - ありがとうございます。これは私の主な目標を達成するうえでうまくいった。ボタンは今私が意図したものではない列の全幅になっていますが、それはより良く見えると思います。残念ながら、列内のテキストが押し下げられているように見えましたが、これは大型または小規模のデバイスではあまりありませんが、中型スクリーンでは非常に目立つものです。テキストが正しく上部に揃うようにこれを修正する方法をアドバイスできますか?これまであなたの助けをありがとうございました。 – JanD
@JanDお客様のニーズに合わせて回答を更新しました。 –
"ボタンは現在全幅になっていますが、これは奇妙です。私の答えでコードスニペットを実行するとわかるように、ボタンは全幅ではありません。 –