The source code is as follows
- css code
.menu {
display: flex;
align-items: center;
justify-content: center;
font-size: 16px;
padding: 0 50px;
}
.menu__item {
all: unset;
flex-grow: 1;
display: flex;
align-items: center;
justify-content: center;
padding: 9px 0 14px;
text-align: center;
cursor: pointer;
}
.icon {
width: 42px;
height: 42px;
stroke: white;
fill: transparent;
stroke-width: 1pt;
stroke-miterlimit: 10;
stroke-linecap: round;
stroke-linejoin: round;
stroke-dasharray: 400;
}
- html code
<menu class="menu">
<button class="menu__item"><svg class="icon" viewBox="0 0 24 24">...</svg>item1</button>
<button class="menu__item"><svg class="icon" viewBox="0 0 24 24">...</svg>item2</button>
<button class="menu__item"><svg class="icon" viewBox="0 0 24 24">...</svg>item3</button>
</menu>
Packed and viewed in the browser, the flex style that should be on the 'menu__item' is not working, only the 'menu' has!!!
- css in F12
.menu, .menu__item {
display: flex;
align-items: center;
justify-content: center;
}
.menu {
font-size: 16px;
padding: 0 50px;
}
.menu__item {
all: unset;
flex-grow: 1;
padding: 9px 0 14px;
text-align: center;
cursor: pointer;
}