The background-size: cover
property makes the image take the entire screen but it maintains the aspect ratio so only a portion of the image is seen on bigger screens. How can I make it ignore aspect ratio so that the image takes up the entire screen AND the entire image is visible?
HTML:
<html>
<head>
<link href="styles.css" rel=stylesheet>
<title>
Enjoy ;)
</title>
</head> <script type="text/javascript" src="getBG.js"></script></head>
<body>
<div class="intro">
<div class="textbg">
<div class="introText">
Welcome to PicShare
</div>
<div class="introDesc">
Today's theme is
</div>
</div>
</div>
<div class="back"> </div>
<div class="bg1" onclick="genBg()"><script>genBg()</script></div>
</body>
</html>
CSS:
html{
margin: 0px;
height: 100%;
}
body{
height: 100%;
margin: 0px;
background-color: #424242;
}
.intro{ //want this background to take up entire screen
height:100%;
background-color: #424242;
background-image: url("assets/themes/theme1.jpg");
background-repeat: no-repeat;
background-size: cover;
}