Прежде всего ваша разметка сломана, <ul>
должен содержать только <li>
.
Вложенный элемент <ul>
должен быть помещен в элемент <li>
.
С учетом сказанного, мы можем спрятать пулю на <li>
, у которой есть гнездо <ul>
, просто имея его.
[yellow] {
position: relative;
list-style: none;
}
[yellow]>li {
position: relative;
padding-left: 1rem;
}
[yellow]>li:before {
content: "\25CF";
color: #F2A900;
position: absolute;
left: 0;
}
[nested] {
/* So we can apply a z-index */
position: relative;
/* higher z-index value than the bullet*/
z-index: 1;
/* we can use margin here but since we have position relative why not use left */
left: -1rem;
/* push the nested ul so it looks nested */
padding-left: 3rem;
/* none-transparent background to hide the bullet*/
background: white;
}
<ul yellow>
<li>Lifecycle Automation – employees, contractors, business partners, RPA/bots</li>
<li>Identity Governance controls: </li>
<li>
<ul nested>
<li>Role-based access control (RBAC) model</li>
<li>Policy model–suitability and separation of duties (SOD)</li>
</ul>
</li>
<li>Account and Password Management</li>
</ul>
Если вы хотите присвоить вложенному <ul>
ту же пулю, мы можем упростить код следующим образом.
[yellow],[nested] {
position: relative;
list-style: none;
}
li {
position: relative;
padding-left: 1rem;
}
li:before {
content: "\25CF";
color: #F2A900;
position: absolute;
left: 0;
}
[nested] {
position: relative;
z-index: 1;
left: -1rem;
padding-left: 3rem;
background: white;
}
<ul yellow>
<li>Lifecycle Automation – employees, contractors, business partners, RPA/bots</li>
<li>Identity Governance controls: </li>
<li>
<ul nested>
<li>Role-based access control (RBAC) model</li>
<li>Policy model–suitability and separation of duties (SOD)</li>
</ul>
</li>
<li>Account and Password Management</li>
</ul>