【问题标题】:How can i use my css file in my html file on android?如何在 android 上的 html 文件中使用我的 css 文件?
【发布时间】:2021-09-06 21:09:31
【问题描述】:

我在我的计算机上创建了一个带有 css 的 html 网站,它可以完美运行。但我也希望它也能在 android 上运行,所以我创建了一个文件夹并将文件移动到其中。当我打开 html 文件时,css 文件不起作用。

<html lang="en" dir="ltr">
  <head>
    <link rel="stylesheet" type="text/css" href="style.css" media="screen">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="description" content="Home">
    <meta name="keywords" content="Home">
    <meta name="author" content="Censored">
    <title>Home</title>
  </head>

An image from the html & css files folder

【问题讨论】:

  • 如果你有一个网站,那为什么不能使用android webview?
  • android 上的浏览​​器对本地 HTML 文件存在安全问题;我最近对此感到沮丧 - 基本上你需要一个网络服务器来托管文件。表示您需要可用的网络。
  • 这取决于您如何打开 html 文件。你没有告诉我们你做了什么。

标签: android html css web mobile-website


【解决方案1】:

webview 方法应该可行,但这意味着您必须为每个场景编写一个应用程序。

Load HTML file into WebView

【讨论】:

    猜你喜欢
    • 2013-05-21
    • 2021-09-21
    • 2011-10-29
    • 1970-01-01
    • 2019-05-13
    • 2011-08-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多