Sep '23 • Help
Targeting an element using the last-child selector in css
Hey guys!
So I'm just trying to remove one border from a list of a tags at the very bottom of my page at the footer. I've been working on this for a couple hours the last two days and I cannot figure it out. My CSS is overwriting it somehow, because whenever I do get the CSS to change for that element it also changes all the elements in the list.
I've tried making generalized code like so:
ul li a:last-child {
border-right: none;
}
&
ul li:last-child {
border-right: none;
}
The former removes the right border from all elements in the list.
The latter just removes margin between the elements somehow.
I've tried watching videos and going to the Zilla docs and Web3 schools, but I'm missing something.
Let me know if you have any ideas or thoughts!
2
6 comments
Trey Delcamp
6
Targeting an element using the last-child selector in css
Developer Pro
skool.com/developerpro
Learn how to code. Make money. Have fun. Enjoy life.
Leaderboard (30-day)
Powered by