After using HTML5 and jquery to create a section, I attempted to set an image as the background. However, the image is not filling the entire section, leaving a 2px space around all sides inside the section. Below is the code I used:
<div id="container" data-role="page">
<div style="..." data-role="header"><h>HOME</h></div>
<section id="mainsection">
</section>
</div>
CSS:
#mainsection
{
height:40px;
width:40%;
margin-left:5%;
margin-top:5%;
float:left;
background: url("images/pic99.png") no-repeat;
background-size : cover;
background-color:red;
}
Even after trying to use the background-size property in percentage, the issue persisted. Also, I am utilizing jquery-1.10.2.js, jquery.mobile-1.3.2.js, jquery.mobile-1.3.2.min.css. The background-color property sets correctly to 100%, but the problem arises when using an image in the background property.