I'm having an issue trying to use the background-size:cover;
in css.
To explain:
When I have one div of width 100% and fixed height, when I control+ and control- in browser, the background image of that div is not fitted inside the div, it changes( a zoom in/out effect if I can say it like this ).
If I have a div of 100% width and another div( child of the first ) with fixed width and height and I set the background image with background-size: cover, that zoom in/out effect does not work.
I hope I explained OK, but let me show the problem in code.
<html>
<head>
<title>Test</title>
<style>
body
{
background:red;
}
.test
{
width: 100%;
height: 300px;
background-image: url( 'http://bhodbuzz.com/wp-content/uploads/2015/06/6924750-mountain-wallpaper.jpg' );
background-size: cover;
}
.test2
{
width: 100%;
margin: 0px auto;
}
.inner
{
margin: 0px auto;
width: 900px;
height: 300px;
background-image: url( 'http://bhodbuzz.com/wp-content/uploads/2015/06/6924750-mountain-wallpaper.jpg' );
background-size: cover;
}
</style>
</head>
<body>
<div class="test"></div>
<div class="test2"><div class="inner"></div></div>
</body>
</html>
How to fix the problem ?