I have the following code on my ASP.net page (I would like it to be responsive):
<div class="mobileTabsNav">
<div style="width: 100%; height: auto; min-height: 50px; max-height: 50px; background: #00ff00; background: url('/theImages/mobileMWBtn.png'); background-size: cover; text-align: center;">
PLEASE SIGN IN
</div>
</div>
CSS
.mobileTabsNav
{
display: none;
width: 100%;
overflow: hidden;
}
@media (max-width: 715px)
{
.mobileTabsNav
{
display: block;
}
}
It seems that the bottom of the image is cropped:

When I change it to background-size: 100% 100%;, the image is stretched too much on a particular screen, as shown in the example shown here:

As you can see, the image is distorted.
In any case, so that the curve is the same at different levels of the screen, or do I need to add three separate images?
Image used in the script:




.mobileTabsNav
{
width: 100%;
overflow: hidden;
}
<div class="mobileTabsNav">
<div style="float: left; background: url('http://i.stack.imgur.com/NnCbY.png') no-repeat; min-height: 50px; min-width: 10px; max-width: 10px; background-size: contain;">
</div>
<div style="background: url('http://i.stack.imgur.com/KbPm8.png')"></div>
<div style="float: right; background: url('http://i.stack.imgur.com/rll1d.png') no-repeat; min-height: 50px; min-width: 10px; max-width: 10px; background-size: contain;">
</div>
</div>
Run codeHide result
source
share