What is the easiest way to make a website responsive? [closed]

醉酒当歌 提交于 2019-12-25 17:55:54

问题


I am a beginner and I've created some of my website already, but I realized that it wouldn't be visible well in all devices and screen sizes. I am willing to restart on my website, and implement this responsive framework, but I don't know where to get started, how to get started, which framework to use, or anything about creating a responsive website. I've looked into Bootstrap, but I saw that you had to go with the navigation bar that they provide, and I don't want that. I want to create my whole website customized by me. I've seen some websites, where when you are on your phone, it automatically goes to something like m.facebook.com, what is their method of doing that? Are they rewriting their whole entire code for each resolution? Please help!


回答1:


If you DO NOT want to use bootstrap, you can use standard media queries "fluid design" instead. I created a easy to follow fiddle with some fun stuff for you to try out http://jsfiddle.net/xfobotx6/7/

remember to put <meta name="viewport" content="width=device-width, initial-scale=1.0" /> in your <head> section of your html to make this work.

edit It is strongly opinion base on "what is the easiest way?" I just gave you an example of "a" way, but its up to you to decide what is easiest for you :)




回答2:


you can go with @Adam Buchanan Smith's answer if your interested in responsive design. if not, just do something like this with javascript to redirect the page like you said from facebook.com to m.facebook.com

if (screen.width <= 800) {
            window.location = "page.aspx";
        }

By doing this, you will have to do at least 2 versions (desktop & mobile) of your website. On the upside, you can fully customize it.



来源:https://stackoverflow.com/questions/31526812/what-is-the-easiest-way-to-make-a-website-responsive

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