difference between height and background cover code example
Example 1: css background image cover center
html {
background: url(images/bg.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
Example 2: html background size fit text
<div class="myDiv">
<div class="bgImage">
<h1>My Image</h1>
</div>
</div>
<style>
.myDiv {
text-align: center;
}
.myDiv h1 {
display: inline-block;
font-size: 3.5em;
border-radius: 20px;
background: rgba(43, 166, 203, 0.5);
padding: 0.5em 0.2em 0.8em 0.5em;
}
</style>