【问题标题】:how to change the height of UI semantic如何改变 UI 语义的高度
【发布时间】:2021-01-18 12:20:22
【问题描述】:

我使用语义 UI 并将视频嵌入到 iFrame 标记中。但我想改变语义 UI 的高度。

    <div className="video_box ui embed">
                    <iframe
                        width="100%"
                        height="100%"
                        src="https://www.youtube.com/embed/tkLLGHa8XuI?start=23"
                        frameborder="0"
                        allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
                        allowfullscreen
                    ></iframe>
                </div>

这是我的 css 文件。我正在尝试改变这里的高度

video_box {
display: flex;
width: 50%;
height: 500px; /*This is not working*/
margin-right: 10px;
align-items: center;

}

【问题讨论】:

  • 你需要以像素为单位的 iframe 高度,例如 - iframe {height:500px}
  • &lt;div className="video_box ui embed"&gt; &lt;iframe width="100%" height="500px" &gt;&lt;/iframe&gt; &lt;/div&gt;

标签: css reactjs user-interface height semantic-ui


【解决方案1】:

你还需要设置 iframe 的高度,所以:

.iframe, .video_box {
height: 500px;
};

【讨论】:

  • 我改成了,但还是不行。
【解决方案2】:

检查一下:

.video_box {
display: flex;
width: 50%;
height: 500px;
margin-right: 10px;
align-items: center;
}
iframe {
  height:500px
}
<div className="video_box ui embed">
                    <iframe
                        width="100%"
                        height="100%"
                        src="https://www.youtube.com/embed/tkLLGHa8XuI?start=23"
                        frameborder="0"
                        allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
                        allowfullscreen
                    ></iframe>
                </div>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-10-09
    • 2019-06-17
    • 2018-03-04
    • 2020-03-09
    • 2015-01-27
    • 2012-10-08
    • 1970-01-01
    • 2010-11-27
    相关资源
    最近更新 更多