Hai,
i am using media queries in CSS (to view the website in mobile devices) . The problem i face here is , i am able to reduce the font size but not able to reduce the image size. i am using CSS 2.1 so, background-size:cover; isn't supported...can anyone help me how to reduce image size?.
here i have attached the css and the html file.
Loading
Anoop Kumar SharmaPosted Oct 14, 2013, 12:43 PM
<html lang="en">
<head>
<meta charset="utf-8">
<title>Mobile Sitetitle>
<style>
#image {
background-image: url(largeimage.jpg);
}
@media only screen and (max-width: 320px) {
#image {
background-image: url(smallimage.jpg);
}
}
style>
head>
<body>
<div id="image">div>
body>
html>
In this example we are using largeimage.jpg for desktop version of website and using smallimage.jpg for mobile website(max-width:320px ) using media query.
Hope this will help you.