I have a dropdown menu, with a 100% width, however the links in the dropdown are way too thin, I want the text of each link to be on one line. I feel like it's the '100% width', but without that the links are not directly under the main navigation link that the fall under.
#main-nav a {
color: #ce2029;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.2em;
padding: 0px 20px;
}
#main-nav ul {
display: flex;
}
#main-nav li {
text-align: center;
position: relative;
}
#main-nav li:hover .sub-menu>li {
display: flex;
justify-content: center;
top: 10px;
}
.sub-menu li {
display: none;
position: absolute;
top: 0px;
}
.sub-menu {
display: flex;
flex-direction: column;
justify-content: center;
position: absolute;
background-color: #2b303a;
box-shadow: 1px 1px 4px 0 rgba(0, 0, 0, 0.2);
width: 100%;
}
<nav id="main-nav">
<ul>
<li><a href="#">Services</a>
<ul class="sub-menu">
<li><a href="#">Website & Application Development</a></li>
<li><a href="#">iOS & Android Development</a></li>
<li><a href="#">SAAS</a></li>
<li><a href="#">AI & Data Science</a></li>
<li><a href="#">Databases</a></li>
</ul>
</li>
question from:
https://stackoverflow.com/questions/66064376/how-do-i-make-my-dropdown-menu-links-wider 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…