常にコンテンツのサイズを持った背景画像が必要です。画面のサイズではありません!私は画像の下までスクロールすることができます。このためのCSSのソリューションはありますか?CSSの背景画像のコンテンツサイズ
答えて
div/containerにコンテンツをラップし、指定したコンテンツdiv/containerの背景イメージとして使用します。あなたが特定のサイズの背景画像を持ってしようとしている場合、それはCSS 1よりも多くのHTMLの問題のように聞こえる、DIV /コンテナにbackground-size:cover;
'background-size:cover;'はイメージが繰り返されるため動作しません。イメージはコンテンツのサイズに伸ばされるべきです –
'' background-repeat:no-repeat; ' – Santi
残念ながら、それは問題を解決しません。画像は穴の内容をカバーしていません... –
のCSSプロパティを与える、以下を参照してください。
http://www.w3schools.com/TAgs/att_body_background.asp
あなたは空想-er機能を探している場合、あなたは次のようなJavaScriptのソリューションを、検討する必要があります:
http://pixelcog.github.io/parallax.js/
これはHELだった場合、私に教えてくださいpful、または何かを参照している場合
画像とテキストを含む中間のdivを参照してください。 LiveFiddle。どんな質問でもコメントをお願いします。幸運は
body {
margin: 0;
height:100vh;
}
#top_box {
text-align: center;
height: 20%;
border: 1px solid blue;
background: red;
}
.two_area{
display:inline-flex;
}
#middle_box {
overflow: auto;
height: 280px;
background: url(http://fehlbelichtet.stefanwensing.de/wp-content/uploads/sites/6/2016/04/alte-strasse-endlos.jpg);
background-repeat: no-repeat;
background-size: cover;
background-position: center center;
background-attachment: fixed;
border: 1px solid black;
color: red;
text-align: justify;
width:50%;
}
h1.tittle {
text-align: center;
}
#middle_box_right{
width:50%;
}
#footer_box {
border: 1px solid yellow;
text-align: center;
background: blue;
color: white;
}
<div id="top_box">
<h1>
Header area
</h1>
</div>
<div class="two_area">
<div id="middle_box">
<h1 class="tittle">
Contentable Image Area
</h1> Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop
publishing software like Aldus PageMaker including versions of Lorem Ipsum.Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer
took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset
sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the
industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially
unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.Lorem Ipsum is simply dummy text
of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries,
but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker
including versions of Lorem Ipsum.Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled
it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages,
and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since
the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in
the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic
typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem
Ipsum.Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop
publishing software like Aldus PageMaker including versions of Lorem Ipsum.Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer
took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset
sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's
standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.
It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.Lorem Ipsum is simply dummy text of the
printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries,
but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker
including versions of Lorem Ipsum.Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled
it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages,
and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since
the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in
the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</div>
<div id="middle_box_right">
<h1 class="tittle">2nd area</h1>
</div>
</div>
<div id="footer_box">
<h1>Footer area</h1>
</div>
- 1. CSS:背景色の背景画像
- 2. CSS背景画像
- 3. CSSの画像背景
- 4. スクロールCSSの背景画像
- 5. CSS内の背景画像
- 6. GWT CSSの背景画像
- 7. フッタの背景画像CSS
- 8. CSSの背景画像&ドロップシャドー
- 9. オーバーライドCSSの背景画像
- 10. CSSの背景画像
- 11. リセットCSSの背景画像
- 12. ストレッチCSSの背景画像
- 13. Jquery CSS背景画像rotate
- 14. WebpackインラインCSS背景画像
- 15. フェードイン/アウト背景画像CSS
- 16. CSS背景RGBA&BG画像
- 17. 背景画像上にCSSオーバーレイ画像
- 18. 背景画像上の背景画像
- 19. 背景画像カルーセルの背景画像
- 20. CSSのフルスクリーンの背景画像のサイズ
- 21. ie6 CSSの背景画像の問題
- 22. CSSの背景画像のセンタリング
- 23. CSS画像の背景の位置
- 24. 画像付きJavaFX CSSボタンの背景| |
- 25. WordPressのカスタマイザーCSS背景画像
- 26. CSS - 背景画像への拡大
- 27. Safari CSSの問題/背景画像
- 28. .jspでCSSの背景画像
- 29. jQueryプラグインのCSS背景画像をプレビュー
- 30. CSSサイドバーメニュー背景画像の問題
はなし高さのdivにコンテンツを入れて、それはコンテンツと一緒に成長します。次に 'background-size:cover;'または 'background-size:contains;'を実行します。 – Santi
あなたのマークアップと問題解決の試みを提供してください。あなたの現在のアプローチに応じて解決策が異なる場合があります。 – Serlite