の一番下に立ち往生:事業部は、私は下のスクリーンショットの状況を持っている親
私は青で囲まれたdiv要素は、(黒に囲まれた)親のdivの上に整列させたい
としてイメージ(赤で囲まれています)があります。どうすればこれを達成できますか?
top -10px
はオプションです(10は正確な数値に置き換えられます)が、この方法で問題を解決する正確な値を見つけるためにはさまざまな画面サイズで作業する必要があります。
div要素のためのHTMLは以下の通りです:
<div class="product">
<img class="productImg" src="http://placehold.it/300x240">
<div class="productTxt">
<h1>Title</h1>
<h3>Price</h3>
<p>Short Description Short Description Short Description Short Description Short Description Short Description Short Description Short Description Short Description </p>
</div>
</div>
とCSS:
.product {
box-sizing: border-box;
margin: 0px;
padding: 10px;
width: 100%;
height: 330px;
border: 5px solid black;
}
.productImg {
width: 240px;
height: 300px;
display: inline-block;
border: 3px solid red;
}
.productTxt {
border: 3px solid blue;
display: inline-block;
}
オウ、私もちょうどこのを入力しています:(...とにかく1。 – nmnsud