Since your original image is 1600x100
the height is 6.25%
of its width, so you could try this
#logo {
background: url(http://dummyimage.com/1600x100/000/fff.jpg) no-repeat;
width: 100%;
height: auto;
padding-bottom : 6.25%;
background-size: cover;
}
Example on codepen: http://codepen.io/anon/pen/EnJvI
Note: you can't simply use height: 6.25%
because the height would be relative to the height of the parent element (the body
element, whose height is not defined and it is 0
, since your logo element is empty).
The padding-bottom
use instead the width of the element itself to calculate the correct value (this technique is often used to keep the correct aspect ratio of videos on responsive design, fyi).
Anyway, I don't recommend to use empty markup for styling purpose: your logo should be a regular img
element rather than a background, since a logo usually conveys information