Hello. There is a block with links. The number of links in the block can be different. I want to highlight the first and last link, or rather change the border-radius. If the number of links would be fixed, I would do it like this:
.menu_left { display: inline-block; float: left; margin-top: 15px; border-radius: 10px; } .menu_left a { display: block; width: 210px; background-color: #EEEEEE; padding: 6px; } .menu_left a:nth-child(1) { border-radius: 10px 0 0 0; } .menu_left a:nth-child(4) { border-radius: 0 0 0 10px; }
<div class="menu_left"> <a href="/">ΠΠ»ΡΠΌΠΈΠ½ΠΈΠ΅Π²ΡΠ΅ ΡΠ°Π΄ΠΈΠ°ΡΠΎΡΡ</a> <a href="/">ΠΠΈΠΌΠ΅ΡΠ°Π»Π»ΠΈΡΠ΅ΡΠΊΠΈΠ΅ ΡΠ°Π΄ΠΈΠ°ΡΠΎΡΡ</a> <a href="/">ΠΠΎΠΌΠΏΠ»Π΅ΠΊΡΡΡΡΠΈΠ΅ ΠΊ ΡΠ°Π΄ΠΈΠ°ΡΠΎΡΠ°ΠΌ</a> <a href="/">Π Π΅ΠΊΠΎΠΌΠ΅Π½Π΄Π°ΡΠΈΠΈ ΠΏΠΎ Π²ΡΠ±ΠΎΡΡ ΡΠ°Π΄ΠΈΠ°ΡΠΎΡΠ°</a> </div>
How to be in my case?
first-child
andlast-child
- Alexey Shimansky