Hello everyone,
I am currently setting up a navigation element for a CMS. I cannot control the text that goes into each li. This element needs to work regardless of how much text the user puts in the li. The HTML is also auto generated by the CMS I am using, I cannot change the markup.
Here is the code:
<style>
.navigation-root {
padding: 10px 0;
display: flex;
background-color: #d3d3d3;
}
.navigation-item {
flex: 1 1 0;
margin: 10px;
font-size: 18px;
font-weight: 500;
line-height: 18px;
display: flex;
background-color: #fff;
text-align: center;
list-style-type: none;
}
.navigation-item a {
color: black;
width: 100%;
padding: 10px;
border: 2px solid #fff;
text-decoration: none;
display: flex;
align-items: center;
justify-content: center;
}
.navigation-item a::after {
content: "â—˘";
display: inline-block;
transform: rotate(-45deg);
font-size: 12px;
}
</style>
<div class="navigation">
<ul class="navigation-root">
<li class="navigation-item">
<a href="#">Handbags</a>
</li>
<li class="navigation-item">
<a href="#">Tops & T-shirts</a>
</li>
<li class="navigation-item">
<a href="#">Nightwear & Loungewear</a>
</li>
<li class="navigation-item">
<a href="#">Jeans</a>
</li>
<li class="navigation-item">
<a href="#">Knitwear</a>
</li>
</ul>
</div>
The ::after pseudo element behaves how I would like to to when it is placed after text that is on one line. However when the text goes to two lines then it seems to get pushed to the end of the container and does not move.
Could anyone give any insights as to why the ::after pseudo element behaves differently when the text breaks onto two lines?