M
M
mad_max19922019-01-31 11:14:08
Sass
mad_max1992, 2019-01-31 11:14:08

How to remove the last element in sass?

How to remove the last element using sass here is the code, everything seems to be correct but last-child doesn't work...
.menu__item
margin-left: 90px
position: relative
&:after
content: "\\\\"
display: block
position: absolute
top: 0
left: 100%
padding-left: 38px
color: $color_white
font-size: 17px
font-weight: 600
&:last-child
display: none

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
FeST1Val, 2019-01-31
@FeST1Val

Layout in the studio, but I think that your block is not the last one ... something like this ... The button will be the last element, but it is different in class:

<div class="menu">
  <div class="menu__item"></div>
  <div class="menu__item"></div>
  <div class="menu__item"></div>
  <div class="menu__item"></div>
  <div class="menu__item"></div>
  <div class="menu__item"></div>
  <div class="menu__button"></div>
</div>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question