object - Bootstrap v5 响应式 iframe 不工作,窗口太小图像不响应
问题描述
我花了几个小时尝试使用 iframe 或 Bootstrap v5 中的对象嵌入响应式 svg 图像。使用此代码:
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6" crossorigin="anonymous">
<title>Hello, world!</title>
</head>
<body>
<h1>Hello, world!</h1>
<section id="about" class="about py-5 ">
<div class="row align-items-center container py-5 mx-auto">
<div class="text col-lg-6 col-md-12 col-12">
...
</div>
<div class="col-lg-6 col-md-12 col-12">
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item" width="100%" src='https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/AJ_Digital_Camera.svg' allowfullscreen></iframe>
</div>
</div>
</div>
</section>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/js/bootstrap.bundle.min.js" integrity="sha384-JEW9xMcG8R+pH31jmWH6WWP0WintQrMb4s7ZOdauHnUtxwoG2vI5DkLtS3qm9Ekf" crossorigin="anonymous"></script>
</body>
</html>
不幸的是,图像似乎没有响应,并且看起来被一个框架切割,如下所示:
我究竟做错了什么?我也尝试使用object
,但还是不行。
解决方案
推荐阅读
- active-directory - Rundeck ldap 连接以 NullPointerException 结束
- java - 设置自定义字体以设置单词 java 不起作用
- php - Symfony 5 - 基于浏览器语言的网站翻译后重定向
- c++ - 如何为其成员为字符串类型的结构变量分配内存
- spring-boot - Vaadin Spring-Boot 应用程序在生产模式下作为 JAR 运行时不会呈现 CSS
- apache-kafka - kafka + 如何验证 kafka broker 领导者是否与 kafka cli 命令平衡
- c++ - 带有折叠表达式的模板会创建不需要的参数副本
- java - ThreadPoolExecutor 在达到队列容量时创建新线程后首先执行队列中的任务,而不是执行新的传入作业
- docker - docker-compose 错误:FileNotFoundError:[Errno 2] 没有这样的文件或目录
- c++ - QT 中的 UDP 消息接收问题