I'm trying to add a slash after the first link in my UL, but instead, it's adding a slash after every link. I've attempted various solutions without success.
Here is my current view/html code:
<?php foreach ($this->config->item('languages') as $i => $language): ?>
<li class="language-nav__item"<?php if ($i == 0): ?> <?php elseif ($i == sizeof($this->config->item('languages'))-1): ?><?php endif; ?>>
<a class="language-nav__link" href="<?php echo base_url() . $language['alias'] . '/' . $pages[$view]->{'url_' . $language['language']}; echo ($view == 'home')? '' : str_replace('/' . $this->uri->segment(1), '', uri_string()); ?>">
<?php echo $language['name']; ?>
</a>
</li>
<?php endforeach; ?>
</ul>
This section displays two links/languages.
Next, in my CSS file:
.language-nav a:nth-child(1):before {
content: "/";
color: white;
}
After applying this styling, a slash is shown after each link. When targeting it like this:
.language-nav li:nth-child(1):before {
content: "/";
color: white;
}
A slash is added AFTER the last link rather than after the first one (in the middle where it should be). What am I missing here? Thank you.