I don’t understand what I’m doing wrong, why can’t I remove the underscore from the label? what should be done? how to arrange css?

.blog-flex-item { width: 370px; display: flex; flex-direction: column; justify-content: center; align-items: center; box-shadow: 0px 0px 5px 1px #eaeaea; height: 230px; margin-bottom: 30px; } .blog-flex-item__image { width: 159px; height: 130px; } .blog-flex-item__image img { width: 100%; height: 100%; } .blog-flex-item__title { color: #374049; font-size: 25px; margin-top: 20px; text-decoration: none; } .blog-flex-item:hover .blog-flex-item__title { text-decoration: none; color: red; } 
 <div> <a class="blog_link" href="#"> <div class="blog-flex-item"> <div class="blog-flex-item__image"><img src="http://www.youloveit.ru/uploads/gallery/main/162/pikachu.png" alt=""></div> <div class="blog-flex-item__title">текст</div> </div> </a> </div> 

  • one
    text-decoration: none; Ask for a link, not a div. That is, the element with the blog_link class. - Pyramidhead
  • @Pyramidhead doesn't work this way either, I already tried it and I just tried it again. I did such a hundred times, that now I’m not going to all, I didn’t get enough sleep, I don’t understand - Yaroslav Saenko
  • everything, figured out - Yaroslav Saenko
  • Look in the console. Most likely, some other rule interrupts these. - Pyramidhead

1 answer 1

 .blog-flex-item { width: 370px; display: flex; flex-direction: column; justify-content: center; align-items: center; box-shadow: 0px 0px 5px 1px #eaeaea; height: 230px; margin-bottom: 30px; } .blog-flex-item__image { width: 159px; height: 130px; } .blog-flex-item__image img { width: 100%; height: 100%; } .blog-flex-item__title { color: #374049; font-size: 25px; margin-top: 20px; text-decoration: none; } .blog-flex-item:hover .blog-flex-item__title { text-decoration: none; color: red; } /* Вот это надо было сделать */ .blog_link { text-decoration: none; } 
 <div> <a class="blog_link" href="#"> <div class="blog-flex-item"> <div class="blog-flex-item__image"><img src="http://www.youloveit.ru/uploads/gallery/main/162/pikachu.png" alt=""></div> <div class="blog-flex-item__title">текст</div> </div> </a> </div>