私はこれを調査しましたが、JavaScript ソリューションしか見つけられなかったので、CSS ソリューションが可能かどうかを誰かが知っているのだろうか...
コード スニペットを次に示します。
HTML
<div id="container">
This is a small amount of text to appear over the stretched
background image, but I want to be able to see the entire image.
</div>
CSS:
div#container
{
background: url('images/bigImage.png') no-repeat 0 0;
background-size: 100%; /* makes the image stretch (vertically and horizontally) to the width of the device, so I've no idea what height the background image will be rendered at.*/
}
背景画像が div 全体を覆い、画像全体が表示されるように使用できる CSS はありますか?
前もって感謝します。