如果浏览器尺寸很小,请完全更改网站 [英] Change site completely if browser size is small

查看:103
本文介绍了如果浏览器尺寸很小,请完全更改网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前在我的CSS中使用媒体查询,但我的网站仍然看起来不好。有没有办法首先确定浏览器的智慧,然后加载不同的索引文件?



在这里发布一些代码是我的媒体查询:

  @媒体屏幕和(最大宽度:600px){
.topbar {
opacity:0;
}
....
}


解决方案

script type =text / javascript>
if(screen.width <= 699){
document.location =http://mobilesite.com;
}
< / script>


I am currently using media query in my css but my site is still looking bad. Is there a way to determine first the witdh of a browser and then load different index files?

To post some code here is my media query:

@media screen and (max-width: 600px) {
  .topbar{
    opacity: 0;
  } 
....
}

解决方案

I would say do some more research on building your CSS but to answer your question:

<script type="text/javascript">
if (screen.width <= 699) {
document.location = "http://mobilesite.com";
}
</script>

这篇关于如果浏览器尺寸很小,请完全更改网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆