I have the following code in 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 the bottom portion of the image is getting cut off:
When I change it to background-size: 100% 100%;
, the image is stretched too much on certain screen as in the example shown here:
As you can see the image is distorted.
Is there anyway to ensure the curve is the same across the board of different screen sizes or do I have to add three separate images?
The image being used on the Fiddle:
.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>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…