A
A
Artem2021-07-22 14:32:09
css
Artem, 2021-07-22 14:32:09

How to access the first element via first-child if there is an element with a different tag?

I created a card. After I started placing elements and noticed that I can’t access the first element through first-child. 4 link elements and one text. Removing the tag with the text solves the problem, but I’m wondering if it’s possible to access the first link and if so, how?
Here is the code on codepen https://codepen.io/kungfuprogramer/pen/LYyzmEK

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey delphinpro, 2021-07-22
@delphinpro

You don't need to contact him.

/*.card__links a:first-child{
  margin-left:10px;
}*/
.card__links .card__text {
  margin-right: 10px;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question