S
S
sleepy_hungry2019-11-11 02:06:13
Yii
sleepy_hungry, 2019-11-11 02:06:13

Why doesn't the :nth-child pseudo-class work for me?

Please help me understand
html

<ul class="menu d-flex">
            <li><a href="#main" class="menu__item">Main</a></li>
            <li><a href="#features" class="menu__item">Features</a></li>
            <li><a href="#gallery" class="menu__item">Gallery</a></li>
            <li><a href="#team" class="menu__item">Team</a></li>
            <li><a href="#contacts" class="menu__item">Contacts</a></li>
          </ul>

css
.menu {
  justify-content: space-between;
  padding: 50px 0;
}

.menu__item {
  padding: 0 15px 37px;
  border-bottom: 3px solid transparent;
  position: relative;
  z-index: 2;
}

.menu__item:nth-child(5) {
  padding-right: 0;
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vyacheslav, 2018-10-18
@krov119

public function getТ2() 
    { 
        return $this->hasMany(Т2::className(), ['t1_id' => 'id'])->onCondition(['user_id' =>  500]); 
    }

or
public function getТ2() 
    { 
        return $this->hasMany(Т2::className(), ['t1_id' => 'id'])->where(['user_id' =>  500]); 
    }

learn the documentation.

S
Sergey delphinpro, 2019-11-11
@sleepy_hungry

.menu__itemsole descendant<li>
And it's probably better to reset the last one

.menu > li:last-child > .menu__item { padding-right: 0; }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question