I did a round bordered text right next to the nav-menu. I having issues on how will I put the text underneath the texts. Refer to the image below.
I wanted to put the coming soon texts underneath the COMPANY and CONTACT menu (I don’t mean doing a sub-menu) Below are the code I did for doing this.
JavaScript
x
16
16
1
<el-menu-item index="4">{{ $t("Tabnav.nav_n") }}</el-menu-item>
2
<div class = csoon1>
3
<span class = text>COMING SOON</span>
4
</div>
5
<el-menu-item index="4">{{ $t("Tabnav.nav_n") }}</el-menu-item>
6
<div class = csoon2>
7
<span class = text>COMING SOON</span>
8
</div>
9
10
.text {
11
border: 2px solid #00db99;
12
border-radius: 10px;
13
background-color: #00db99;
14
font-size: 13px;
15
}
16
Is it possible to put the round bordered text underneath? If not I’ll try make it stick next to the menu text and get them compressed.
Advertisement
Answer
This is something that I think flexbox is really good for.
The code can look something like this – you’d need to adjust for vue.js of course.
JavaScript
1
13
13
1
<div class="flex-column">
2
<el-menu-item index="4">{{ $t("Tabnav.nav_n") }}</el-menu-item>
3
<div class = csoon1>
4
<span class = text>COMING SOON</span>
5
</div>
6
</div>
7
<div class="flex-column">
8
<el-menu-item index="4">{{ $t("Tabnav.nav_n") }}</el-menu-item>
9
<div class = csoon2>
10
<span class = text>COMING SOON</span>
11
</div>
12
</div>
13
So as you can see, I just wrapped each of the two elements with a div and gave it a class of flex-column. Then in CSS you just add.
JavaScript
1
5
1
.flex-column {
2
display: flex;
3
flex-direction: column;
4
}
5