Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
移动Css&;桌面Css设置_Css_Mobile_Web_Desktop - Fatal编程技术网

移动Css&;桌面Css设置

移动Css&;桌面Css设置,css,mobile,web,desktop,Css,Mobile,Web,Desktop,我设置了一个桌面和移动Css,我将桌面放在index.html上,移动设备放在m.index.html上,但桌面同时出现在桌面/笔记本电脑和移动设备上。如何让移动设备工作您不需要单独的html和Css文件 按照建议在html的元素中添加视口元标记,并用于tablet/mobile的单独css:-)-类似于这样: // main css .foo { width: 1000px; } // Mobile: @media (max-width: 600px) { .foo { w

我设置了一个桌面和移动Css,我将桌面放在index.html上,移动设备放在m.index.html上,但桌面同时出现在桌面/笔记本电脑和移动设备上。如何让移动设备工作

您不需要单独的html和Css文件

按照建议在html的
元素中添加视口元标记,并用于tablet/mobile的单独css:-)-类似于这样:

// main css
.foo {
  width: 1000px;
}

// Mobile:
@media (max-width: 600px) {
  .foo {
     width: 500px;
  }
}

你是如何包含css的?你确定你真的点击了m.index.html吗?当我加载m.index.html时,我看到了mobile.css,当我加载index.html时,我看到了desktop.css并重置了。cssI正在使用chrome查看源…//desktop css.foo{width:1000px;}//mobile.css:@media(max width:600px){.foo{宽度:500px;}}