引导程序,CSS或响应式计算机无法在移动设备和PC上正常工作

时间:2018-11-21 14:32:09

标签: php bootstrap-4

我的网站是使用PHP构建的。如果我访问此页面 www.xyz.com/post.php 那么这在移动设备和PC中都可以正常工作。如果我访问此页面 www.xyz.com/post/23/what-is-php 然后引导程序不会同时加载到这两个设备中。

如果我使用基本href和meta视口...如下所示

 <base href="http://localhost/postblog/post.php">
 <body style="background-color: #EAEAEA"> 



<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">

然后只能在PC上工作,而不能在移动设备上工作...这就是问题所在 全头代码

 <head>
<base href="http://localhost/postblog/post.php">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">

<title>Blog Home - Start Bootstrap Template</title>

<!-- Bootstrap core CSS -->
<link href="home/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

<!-- Custom styles for this template -->
<link href="home/css/blog-home.css" rel="stylesheet">

我将httpaccess用于明显的网址...我认为这是问题所在

2 个答案:

答案 0 :(得分:2)

删除shrink-to-fit=no

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

添加斜杠以从家里获取内容

<!-- Bootstrap core CSS -->
<link href="/home/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet"> 
<!-- Custom styles for this template -->
<link href="/home/css/blog-home.css" rel="stylesheet">

答案 1 :(得分:0)

shrink-to-fit=no只会让所有溢出都从屏幕上掉出来。我建议尝试不使用。