简体   繁体   English

响应式设计不适用于heroku部署的Rails应用程序?

[英]Responsive design not working on heroku deployed rails app?

I recently deployed a rails app onto: http://secret-brook-8909.herokuapp.com/ 我最近在以下位置部署了Rails应用程序: http : //secret-brook-8909.herokuapp.com/

I intended it to look on the iphone 4s to look like it would using: http://responsive.victorcoulon.fr/ 我打算让它在iphone 4s上看起来像它使用的样子: http ://响应.victorcoulon.fr /

If you look at the stylesheet of my rails app you will actually see that i hardcoded all the widths of the containers to be 320px. 如果您查看我的rails应用程序的样式表,您实际上会看到我将容器的所有宽度硬编码为320px。 But when I open it on my browser on my iphone it looks like its being opened on a larger resolution screen. 但是,当我在iPhone上的浏览器中打开它时,看起来好像是在较大分辨率的屏幕上打开了它。 Additionally, on the iPhone if you click the profile button, the button doesn't look the same as it does on a normal browser. 此外,在iPhone上,如果单击配置文件按钮,则该按钮的外观与普通浏览器上的外观不同。

What can I do to fix these issues? 我该如何解决这些问题?

您需要在文档的头部添加视口声明

<meta name="viewport" content="width=device-width, initial-scale=1.0">

I can't see any issues in the HTML code and when I shrink my browser it displays perfectly. 我在HTML代码中看不到任何问题,并且当我缩小浏览器时,它可以完美显示。

When testing with the iPhone be careful of the caching that Safari does. 使用iPhone测试时,请注意Safari进行的缓存。 Make sure you clear the cache and also close down any running instances of Safari before trying again. 在重试之前,请确保清除缓存关闭所有正在运行的Safari实例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM