gpt4 book ai didi

javascript - 我如何应用 css 边框和 css 填充

转载 作者:行者123 更新时间:2023-11-27 23:12:30 26 4
gpt4 key购买 nike

我需要有条件地突出显示现有应用程序的菜单项。为了突出显示该元素,我正在为该特定元素使用底部边框。但是已经有一个正在应用的填充,并且突出显示的行需要在底部(附图供引用)

.menulist {
background: white;
color: black;
font-family: 'Times New Roman', Times, serif;
transition: height .3s;
z-index: 9;
width: 100%;
}

.menulist .menulist-menu-bar {
display: flex;
align-items: center;
flex-wrap: wrap;
padding: 8px;
justify-content: flex-start;
position: relative;
justify-content: inherit;
}

.menulist .menulist_nav {
padding-left: 0;
list-style: none;
font-size: 14px;
line-height: 1.71;
font-weight: normal;
margin: 0;
display: flex;
flex-wrap: wrap;
align-content: center;
align-items: stretch;
height: 100%;
}

.menulist_bottom_border {
border-bottom: 2px solid;
border-color: gray;
margin-left: 20px;
}
<header class="menulist">
<div class="menulist-menu-bar">
<div>
<ul class="menulist_nav">
<div class="menulist_bottom_border">nav1</div>
<div>nav2</div>
<div>nav3</div>
</ul>
</div>
</div>
</header>

最佳答案

兄弟,可以了。看到这个:-

.menulist {
background: white;
color: black;
font-family: 'Times New Roman', Times, serif;
transition: height .3s;
z-index: 9;
width: 100%;
}

.menulist .menulist-menu-bar {
display: flex;
align-items: center;
flex-wrap: wrap;
padding: 8px;
justify-content: flex-start;
position: relative;
}

.menulist .menulist_nav {
padding-left: 0;
list-style: none;
font-size: 14px;
line-height: 1.71;
font-weight: normal;
margin: 0;
display: flex;
flex-wrap: wrap;
align-content: center;
align-items: stretch;
height: 100%;
}

.menulist_bottom_border {
border-bottom: 2px solid;
border-color: gray;
margin-left: 20px;
}
<header class="menulist">
<div class="menulist-menu-bar">
<div>
<ul class="menulist_nav">
<div class="menulist_bottom_border">nav1</div>
<div class="menulist_bottom_border">nav2</div>
<div class="menulist_bottom_border">nav3</div>
</ul>
</div>
</div>
</header>

您看到了意想不到的事情,因为只有一个 div 具有类菜单列表底部边框。由于大多数元素都具有 flex 显示属性,所以它看起来像这样。

关于javascript - 我如何应用 css 边框和 css 填充,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58448379/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com