我应该如何使该网站具有响应性?

时间:2020-04-23 17:06:12

标签: html css web

因此,我一直在尝试使标头应有的响应能力,但它似乎根本不起作用。 任何帮助都很好。

<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width">
</head>
<body>
<h2>This is just a test page that does not work on three tested devices any help would be nice.</h2>
</body>   
</html>

2 个答案:

答案 0 :(得分:1)

确保添加此<meta name="viewport" content="width=device-width, initial-scale=1">

答案 1 :(得分:-1)

您可以使用引导头,它将为您完成。

<head>
    <title>Bootstrap Example</title>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
      <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
      <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
</head>

Bootstrap对于创建网站非常有用:https://www.w3schools.com/bootstrap/default.asp