While it is possible to size images relative to the viewport width using CSS (for example, img.thing { width: 50%; }
), it is generally not recommended. This is because scaled images can appear blurry or blocky/jaggy depending on the resizing algorithm used by the browser. Although there are some CSS properties like SVG's image-rendering
and -ms-interpolation-mode
in IE that attempt to improve image quality during scaling, they are not always reliable.
Furthermore, CSS background-image
s cannot currently be resized at all, although this feature is being proposed for CSS3.
In a liquid layout design, the goal is to adjust the spacing between fixed-size images based on changes in viewport width rather than resizing the entire page, including images. Users can still zoom in on the page with modern browsers, but may experience a decrease in image quality as a result.