HTML:
<div class="logo-container">
<span>some text</span>
</div>
CSS:
.logo-container {
display: block;
background: url(img/logo.png) no-repeat center;
background-size: contain;
width:100%;
height:20%;
}
背景画像がスケーリングされた現在の寸法を取得するにはどうすればよいですか?
背景画像の寸法は の寸法とは異なると想定してい.logo-container
ます。