Click here to Skip to main content
15,893,487 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
HTML
<meta name="viewport" content="width=device-width, user-scalable=no">

<title>Translate mockup</title>

<style>

@media only screen and (max-width : 799px) {
  #content { width:600px; }
}

@media only screen and  (min-width : 400px) and (max-width :599px) {
  #content { width:320px;}

}

</style>
Posted
Updated 27-Sep-14 9:59am
v3
Comments
Member 11111612 27-Sep-14 15:55pm    
Guys, Help :( im a newbie. How can i set a viewport content 600px in web then it will automatically fit in mobile to 320px
SteveyJDay 29-Sep-14 9:03am    
Did my solution not work?

1 solution

Try this. Using this solution the width of #content will be 600px unless the media query conditions are hit then the width of #content will be 320px.

CSS
#content {width:600px;}

@media only screen and (max-width:320px), only screen and (max-width:640px) and (orientation:landscape){
  #content { width:320px;}
}
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900