bootstrap、css或responsible不适用于移动设备和pc



我的网站是用PHP构建的。如果我访问此页面www.xyz.com/post.php那么这在手机和电脑中都能正常工作。如果我访问这个页面www.xyz.com/post/23/what-is-php则引导程序不在两个设备中加载。

如果我使用基本href和元视口。。。下面有这样的东西

<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">

我使用http访问frindly url。。。我认为这个出现了问题

删除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">

shrink-to-fit=no只会让溢出的内容从屏幕上掉下来。我建议你不要。

最新更新