网页适用于所有android设备

网页适用于所有android设备,android,html,css,Android,Html,Css,我正在开发一个android项目,其中包含多个活动,每个活动都包含网络视图。我使用html文件和css来实现这一点。但是我的网页在不同的android设备中是不同的。我不想要水平滚动,它必须自动适应所有设备。这是怎么可能的?有人能为我找到解决方案吗 my webview.xml <WebView android:layout_width="fill_parent" android:layout_height="fill_parent" android:scro

我正在开发一个android项目,其中包含多个活动,每个活动都包含网络视图。我使用html文件和css来实现这一点。但是我的网页在不同的android设备中是不同的。我不想要水平滚动,它必须自动适应所有设备。这是怎么可能的?有人能为我找到解决方案吗

my webview.xml

   <WebView
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:scrollbars="none"
    android:id="@+id/webView" />
my cube.html文件

   <!DOCTYPE html>
   <html>
   <head>
  <meta charset="ISO-8859-1">
   <title>INTRODUCTION</title>
  <link rel="stylesheet" href="mystyles.css" type="text/css" />
  </head>
  <body>
 <div class="section">
  <h2>CUBE ROOT OF UNITY</h2>
  <p>As discussed in the previous section that the cube roots of unity are <mark class=          "bold">1, &#x03C9 and &#x03C9<sup> 2</sup></mark> where <mark class= "bold">&#x03C9    =e<sup>i2&#x3c0;/3</sup> = -1/2 + i &#x221A;3/2 and &#x03C9<sup>2</sup> = e<sup>i4&#x3c0;/3</sup> = -1/2 -i &#x221A;3/2.</mark> We shall now obtain cube roots of unity by an alternative method.</p>

</div>
</body></html>

您可能想尝试将name=viewport content=width=device width,user scalable=no放入html文件的-容器中


这将调整文档大小并防止用户缩放,因此最终您将拥有一个可垂直滚动的文档。

在html文件的头部尝试此操作,请告诉我结果:我试过了,但它不起作用。我试过了,它只在480 dp的设备上工作。我找不到关于这个问题的确切解决方案。你添加了doctype吗!!:在网页的顶部,哪一行需要在标签后面添加这一行??我试过了,但它不起作用。我需要在css中实现媒体查询来实现这一点吗?如果你只是将它添加到头部上方的元容器中,它应该会起作用-至少它对我的设备起作用。我添加了它,但它不起作用。我需要水平滚动以查看不符合我的设备分辨率的内容。
   <!DOCTYPE html>
   <html>
   <head>
  <meta charset="ISO-8859-1">
   <title>INTRODUCTION</title>
  <link rel="stylesheet" href="mystyles.css" type="text/css" />
  </head>
  <body>
 <div class="section">
  <h2>CUBE ROOT OF UNITY</h2>
  <p>As discussed in the previous section that the cube roots of unity are <mark class=          "bold">1, &#x03C9 and &#x03C9<sup> 2</sup></mark> where <mark class= "bold">&#x03C9    =e<sup>i2&#x3c0;/3</sup> = -1/2 + i &#x221A;3/2 and &#x03C9<sup>2</sup> = e<sup>i4&#x3c0;/3</sup> = -1/2 -i &#x221A;3/2.</mark> We shall now obtain cube roots of unity by an alternative method.</p>

</div>
</body></html>
 h2 
 {
font-family: "Times New Roman",Times,serif;
color: #002671;
font-size: 23px;
font-weight: bold;
 border-bottom: 2px solid #CCC;
padding-bottom: 7px;
 margin: 24px 0px 0px;
 }