html - flex-container 遍历兄弟容器
问题描述
我有一个 flex-container,它有一个属性 div作为它的兄弟-
我已将 flex-container 设置为,display: flex; flex-wrap: wrap;
但问题是当它包装时,它的项目会越过属性字段-
我确实尝试设置display: block
为attribution
字段,但它不起作用。我还尝试将包含 this和字段的父容器 ( footer
) 设置为,以制作一个弹性项目,但它仍然不起作用。display: flex
flex-container
attribution
attribution
当我在调试工具中将鼠标悬停在容器上时,我看到大小没有改变,但弹性项目已经溢出。
你能帮我找出问题吗?
#footer {
padding: 5% 10%;
background: getColor(light-gray-bg);
}
.references {
display: flex;
flex-flow: row wrap;
gap: 20%;
}
.references div {
display: flex;
flex-direction: column;
gap: 2vh;
}
.references h6 {
font-size: 1em;
margin-bottom: 5vh;
color: getColor(dark-grayish-violet);
}
.references a {
font-size: 0.9em;
font-weight: bold;
color: gray;
}
.attribution {
display: block;
margin-top: 3vh;
font-size: 11px;
text-align: center;
}
.attribution a {
color: #a33e70;
}
<section id="footer">
<!-- References -->
<section class="references">
<div class="our-company">
<h6>Our company</h6>
<a href="#">How we work</a>
<a href="#">Why Insure?</a>
<a href="#">View plans</a>
<a href="#">Reviews</a>
</div>
<div class="help-me">
<h6>Help me</h6>
<a href="#">FAQ</a>
<a href="#">Terms of use</a>
<a href="#">Privacy policy</a>
<a hred="#">Cookies</a>
</div>
<div class="contact">
<h6>Contact</h6>
<a href="#">Sales</a>
<a href="#">Support</a>
<a href="#">Live chat</a>
</div>
<div class="others">
<h6>Others</h6>
<a href="#">Careers</a>
<a href="#">Press</a>
<a href="#">Licenses</a>
</div>
</section>
<div class="attribution">
Challenge by <a href="https://www.frontendmentor.io?ref=challenge" target="_blank">Frontend Mentor</a>.
Coded by <a href="https://frontendmentor.io/profile/sapinder-pal">Sapinder</a>.
</div>
</section>
解决方案
推荐阅读
- python - 如何检查是否在窗口外的 TKinter 中按下了某个键?
- excel - Excel中更改字体颜色的按钮
- c# - EF Core 5 检索数据库多对多记录'值不能为空。(参数'源')'
- python - 使用for循环逐列遍历对象的非矩形嵌套列表
- javascript - 如何在 p5.js 中修改声音文件中的特定频率?
- c# - Json 格式在 Unity 中使用简单的 json 似乎无效
- text - 在 C++Builder 中使用上标
- c# - 如何在字符串中搜索文本并抓取搜索文本之后的所有内容,直到它到达一个字符?
- javascript - 使用 Angular js 引导程序添加后退按钮
- c++ - 为什么当 T=std::string custom Vector C++ 时在 push_back(T&&) 上出现 SIGSEGV 错误