C
C
cupacabka2020-02-05 02:12:29
HTML
cupacabka, 2020-02-05 02:12:29

Why is the sass rule not working?

Good afternoon, tell me this question. I do it as a tutorial. why the rule does not work, although everything works in the video description.

<ul class="menu">
            <li class="menu_item"><a href="#" class="menu_link">Главная</a></li>
            <li class="menu_item"><a href="#require" class="menu_link">ппппппп</a></li>

</ul>


apply sac with media rule
@media  (max-width:1200px)
    .menu
        &_item
            padding-right: 20px


Everything works here, the paddings between the elements change
and then I try to do it as in the training video , I
add a rule to the sas to change the font size
.menu
    &_item 
      padding-right: 20px
    &_link 
      font-size: 13px


And for some reason it doesn't work. In the video one to one, I copy directly from the source code from the tutorial, the html code from there also substituted everything, compared everything one to one. And there is no font change.
if registered with classes
@media  (max-width:1200px)
    .menu
        &_item
            padding-right: 20px
    .menu_item .menu_link
            font-size: 13px


then everything works. I don't understand why that is.

Further also

.subheader
    &_logo
      img 
        width: 100%
    &_text
      font-size: 11px


it doesn't catch up

like that

.subheader
        &_logo
            img
                width: 100%
        .col-md-4.offset-md-1 .subheader_text
                font-size: 11px


Yes

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Aetae, 2020-02-05
@Aetae

sass result

.menu
    &_link
no , just . There is a problem with this somewhere. Maybe down the code there is another declaration for , which has a higher priority in the right of precedence, and when you already specify this rule has a higher priority over the next one as a more precise selector. Most likely this ad is going lower in 1200px - in that case just change the order of . .menu_item .menu_link.menu_link
@mediamax-width@media

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question