how to convert this site to a mobile site or make it liquid?

心不动则不痛 提交于 2020-01-07 00:33:29

问题


Im wondering if there is a way to convert static pages to mobiles pages. By mobile-pages I mean to make it possible to drag the desktop content to a smaller window-size (e.g smartphone size: 320px). Make the content to follow the size of the window? how Do I need to change the css? how do I need to make the math? thanks...I suppose there must be frameworks or tools to make this possible?

Pls some guides and thoughts will be more than welcome.

Check my this static example

thanks for yr time! Y/


回答1:


@Yoni; you can use mediaqueries to define your css with in that media query

but define <meta name="viewport" content="width=device-width" /> in your html page

there are other link also http://css-tricks.com/6206-resolution-specific-stylesheets/ , http://webdesign.about.com/od/css3/a/css3-media-queries.htm




回答2:


You can use Media Queries. For more information please reference Responsive Web Design: What It Is and How To Use It.

My recommendation is that you first design the website without positioning anything. Just get it fleshed out and decide the typography, colours and so forth (ie: design.css).

Then use media queries to begin positioning things appropriately. For viewports at least 960 pixels wide (ie: design-960.css) it'll look like this:

@media only screen and (min-width: 960px)
{
    // [...]
}

For viewports at most 359 pixels wide (ie: design-240.css) it'll look like this:

@media only screen and (max-width: 359px)
{
    // [...]
}

And so on. You are going to want the follow code so it renders on mobile devices at the proper scale:

<meta name="viewport" content="width=device-width; initial-scale=1"/>


来源:https://stackoverflow.com/questions/7387977/how-to-convert-this-site-to-a-mobile-site-or-make-it-liquid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!