我有一个 SVG 图标(Font Awesome),它不断溢出并超出我的导航栏。我尝试过overflow: hidden;
,但没有改变任何东西。请帮助我理解并解决问题。
更新#1:
我注意到,如果我不设置position
(默认为static
),那么它的行为就像正常的一样。但我需要设置position
为,relative
因为我正在使用该right
属性来对齐项目。我还注意到,将位置从静态更改为任何位置都会产生问题。
HTML 结构-
<div class="collapsible-card">
<div class="collapsible-card-title">
<img src="https://yt3.ggpht.com/a/AATXAJzlZzr16izsGHBCHIkO3H7n-UiHyZPCJFEPiQ=s88-c-k-c0xffffffff-no-rj-mo" class="unselectable" alt="Youtuber's Logo">
<h5>PewDiePie</h5>
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="chevron-down" class="svg-inline--fa fa-chevron-down fa-w-14 drop-icon" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
<path fill="currentColor" d="M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z">
</path>
</svg>
</div>
<div class="collapsible-card-item-container" style="display: block; max-height: 1140px;">
<div class="collapsible-card-items">
<a href="https://www.youtube.com/watch?v=8HHZiNdrZGA" target="_blank">
<img src="https://i.ytimg.com/vi/8HHZiNdrZGA/mqdefault.jpg" alt="Video's Thumbnail">
<div class="collapsible-card-item-info-container">
<h3>I Made The WORST Minecraft MISTAKE There Is. .. - Part 40</h3>
<span>2020-03-13</span>
</div>
</a>
</div>
<div class="collapsible-card-items">
<a href="https://www.youtube.com/watch?v=1B1f9PGLbIs" target="_blank">
<img src="https://i.ytimg.com/vi/1B1f9PGLbIs/mqdefault.jpg" alt="Video's Thumbnail">
<div class="collapsible-card-item-info-container">
<h3>I'm Back in Minecraft! - Part 39</h3>
<span>2020-03-06</span>
</div>
</a>
</div>
红糖糍粑
青春有我
相关分类