html - 使用css拉伸内容以适应桌面页面
问题描述
如何拉伸此内容以适应桌面的整个页面宽度?
html:
<div class="entry-content">
<blockquote class="wp-embedded-content" data-secret="paBu4nyBJV">.
<p>. <a href="https://tbwdrawingprize.artopps.co.uk/online-
entry/">Online Entry</a></p></blockquote>
<p><iframe title="“Online Entry” — TBW Drawing
Prize" class="wp-embedded-content" sandbox="allow-scripts"
security="restricted" style="position: absolute; clip: rect(1px,
1px, 1px, 1px);" src="https://tbwdrawingprize.artopps.co.uk/online-
entry/embed/#?secret=paBu4nyBJV" data-secret="paBu4nyBJV"
width="600" height="338" frameborder="0" marginwidth="0"
marginheight="0" scrolling="no"></iframe></p>
<p> </p>
<p><embed style="width: 500px; height: 300px;"
解决方案
如果您指的是 iframe - 宽度设置为600px
width 属性。如果将其替换为100%
它将填充父级的宽度。
<iframe title="“Online Entry” — TBW Drawing
Prize" class="wp-embedded-content" sandbox="allow-scripts"
security="restricted" style="position: absolute; clip: rect(1px,
1px, 1px, 1px);" src="https://tbwdrawingprize.artopps.co.uk/online-
entry/embed/#?secret=paBu4nyBJV" data-secret="paBu4nyBJV"
width="100%" height="338" frameborder="0" marginwidth="0"
marginheight="0" scrolling="no"></iframe>
如果您想让更改对所有iframe
和embed
标签通用,请尝试以下 css
iframe, embed {
width: 100% !important
}
推荐阅读
- mysql - Laraver 查询 Union All
- android - Flutter [错误:flutter/lib/ui/ui_dart_state.cc(177)] 未处理的异常:类型“int”不是类型转换中“String”类型的子类型
- css - 如何为超大屏幕编写媒体查询(4000 像素以上,即 62 英寸显示器)
- java - WatchService 被多次触发(MODIFY 被触发,甚至在 CREATE 完成之前) JAVA
- go - 跨平台 AES CryptLib
- html - 将部分划分为固定高度的部分和使用 flexbox 的可变部分
- android - 使用 ACTION_MANAGE_OVERLAY_PERMISSION 在后台启动活动
- arrays - 表达式在数组中必须有指向对象类型错误
- tsql - 尝试在 Auzre 数据仓库中将列更改为非空时出错
- python - 从集合中弹出一个元素时如何选择元素?