I created an ecommerce page and added @media to make the page responsive. but its not working fine can you please take a look where I am doing mistake more over if my coding style is wrong then please correct . More over my images are not also responsive too..
Here is the code
@media(min-width:1200px){
*{margin:0; padding:0;}
#header{
width:100%; height:54px; background-color:#090; position:fixed; z-index:2;
}
#wrapper{
width:80%; background-color:#F7F4F4; margin:auto;
}
#category1{
width:100%; background-color:#FF6;
}
#category1::after{content:" "; display:block; clear:both;
}
#cat1_leftside{
width:20%; height:350px; background-color:#0FF; float:left;
}
#cat1_rightside{
width:80%; height:350px; background-color:#636; float:right; color: white;
}
#home_category1_boxes1{
width: 180px; position: absolute; display: inline; height: 350px;
}
#home_category1_boxes2{
width: 390px; position: absolute; display: inline; height: 350px; margin-left: 200px;
}
#home_category1_boxes3{
width: 390px; position: absolute; display: inline; height: 350px; margin-left: 577px;
}
#footer{
width:100%; height:100px; background-color:#2F2F2F;
}
}
@media(min-width:768px) and (max-width:1199px){
*{margin:0; padding:0;}
#header{
width:100%; height:54px; background-color:#090; position:fixed; z-index:2;
}
#wrapper{
width:80%; background-color:#F7F4F4; margin:auto;
}
#category1{
width:100%; background-color:#FF6;
}
#category1::after{content:" "; display:block; clear:both;
}
#cat1_leftside{
width:20%; height:350px; background-color:#0FF; float:left;
}
#cat1_rightside{
width:80%; height:350px; background-color:#636; float:right; color: white;
}
#home_category1_boxes1{
width: 180px; position: absolute; display: inline; height: 350px;
}
#home_category1_boxes2{
width: 390px; position: absolute; display: inline; height: 350px; margin-left: 200px;
}
#home_category1_boxes3{
width: 390px; position: absolute; display: inline; height: 350px; margin-left: 577px;
}
#footer{
width:100%; height:100px; background-color:#2F2F2F;
}
}
@media(min-width:100px) and (max-width:767px){
*{margin:0; padding:0;}
#header{
width:100%; height:54px; background-color:#090; position:fixed; z-index:2;
}
#wrapper{
width:80%; background-color:#F7F4F4; margin:auto;
}
#category1{
width:100%; background-color:#FF6;
}
#category1::after{content:" "; display:block; clear:both;
}
#cat1_leftside{
width:20%; height:350px; background-color:#0FF;
}
#cat1_rightside{
width:80%; height:350px; background-color:#636; color: white;
}
#home_category1_boxes1{
width: 180px; position: absolute; height: 350px;
}
#home_category1_boxes2{
width: 390px; position: absolute; height: 350px; margin-left: 200px;
}
#home_category1_boxes3{
width: 390px; position: absolute; height: 350px; margin-left: 577px;
}
#footer{
width:100%; height:100px; background-color:#2F2F2F;
}
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Resposive layout</title>
<link rel="stylesheet" type="text/css" href="style.css"/>
</head>
<body>
<div id="header"> <h3> Header area </h3>
</div>
<br>
<br>
<br>
<div id="wrapper">
<div id="category1">
<div id="cat1_leftside"><h3> Horizontal Slider Cat 1 </h3></div>
<div id="cat1_rightside"><h3> </h3></div>
<div id="home_category1_boxes1">
<ol><h3>Men Dress</h3> </ol>
<ol>Men Dress 1</ol>
<ol>Men Dress 2</ol>
<ol>Men Dress 3</ol>
<br>
<ol><h3>Men Accessories</h3></ol>
<ol>Men Accessories1</ol>
<ol>Men Accessories2</ol>
<ol>Men Accessories3</ol>
</div>
<div id="home_category1_boxes2"> <img src="images/boxes/cat1/big.jpg" width="376" height="350"></div>
<div id="home_category1_boxes3">
<img src="images/boxes/cat1/box1.jpg" width="140px"/>
<img src="images/boxes/cat1/box2.jpg" width="140px"/>
<img src="images/boxes/cat1/box3.jpg" width="140px"/>
<img src="images/boxes/cat1/box4.jpg" width="140px"/>
</div>
</div>
<br>
<div id="footer">
</div>
</div>
</body>
</html>