python - Meta viewport 在 phone 和 chrome 设备模式下完全没有效果
问题描述
大家好,我使用的是 html,但是当我<meta>
在 head 中添加以下元素时,Viewport 在手机和 chrome 设备模式下不会改变:
<!DOCTYPE html>
<html>
<head>
<title>phone</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body style="background-image: url('space.jpg')">
<img src="https://www.drgoulu.com/wp-content/uploads/HLIC/c2281c83670e31d8aaab7cb642b824db.png">
<p>Python est un langage de programmation objet, multi-paradigme et multiplateformes. Il favorise la programmation impérative structurée, fonctionnelle et orientée objet. Wikipédia</p>
</body>
</html>
有谁知道这可能是什么原因造成的?
解决方案
尝试width: 100%
放入img
标签
# style.css
img {
max-width: 100%;
# or simple width
# width: 100%;
}
或直接在img
标签中
<img style="width: 100%" src="https://www.drgoulu.com/wp-content/uploads/HLIC/c2281c83670e31d8aaab7cb642b824db.png">
推荐阅读
- .htaccess - 使用 3 个参数和文本重写 Mod
- java - 如何使用java代码从excel单元格表中获取逗号分隔值
- winapi - 检查对话窗口是否“锁定”主窗口
- python - Pandas 和 TypeError:&:“str”和“bool”不支持的操作数类型
- reactjs - 将业务逻辑放入 saga 可以吗
- python - 如何使用 matplotlib 绘制特定像素大小的图形?
- orbeon - ORBEON 表格:在 Excel 导入期间未正确导入日期
- angular - Angular:如何删除选定的数据行?
- java - 将jstring转换为c++字符串导致java代码执行出错
- laravel - Distant relationships between two models in Laravel