私のdivに問題があります。私は右にイメージを浮かべています、そして、私はそれの横にテキストを持っています。 linear-gradient
divを作成しようとしていますが、div
はページ全体を埋めています。Divコンテンツにフィッティングしない
私はどのようにして自分のコンテンツに合ったdiv
を作成しますか?
私はinline-block
方法を試しました。それは画像の下に自分のテキストをクリアするだけです。
問題:
コード:
.Popcorn {
float: right;
position: relative;
top: -45px;
}
.Software {
padding: 4px;
min-width: 100%;
padding-top: 20px;
background: rgba(0, 0, 0, 0) linear-gradient(to bottom, #277FD8 0%, #ffffff 30%, #ffffff 100%) repeat scroll 0 0;
}
<img src="/img/popcorn_edited.png" class="Popcorn" />
<div class="Software">
<h3>The Software You Want!</h3>
<br>
<p>Android is the World's leading mobile and tablet operating system. This means no learning curves for Android users. The media box is powered by Android which allows you to download applications and share it with all your Android devices or vice versa.
You can download from millions of apps, games, books, movies and more on the Google Play store.</p>
</div>
から
min-width:100%
を削除することができます。 divは実際にあなたが好きなように動作します、それはコンテンツのサイズを持っています。 https://jsfiddle.net/c8k5t4mg/ –jsfiddleはうまくいきますが、私のコードでは画像に収まるはずがありません。それはそれの周りにラップされていません。 –
さて、わかりました。混乱させて申し訳ありません。 –