简体   繁体   中英

Media query doesn't work in my case

i used media queries long ago.

I'm already linked the main.css file so dont worry about it

I linked this in head for first step

<meta name="viewport" content="width=device-width, initial-scale=1.0">

Im using koala because of SASS and using this code in main.scss :

@media only screen and (max-width: 600px)  {
    .numet{
       margin-top:150.5px;margin-left:150px;
    }
}

Im calling numet class on a picture because style="" it's not an option at the moment.

<img class="numet" style="" src="wt.png" alt=""> 

What im trying to do here when the screen is max-width:600px for example

when im checking this project on a galaxy s5 i want the pciture go down 150.5px.

and go left 150px. BUT the PROBLEM is that it isn't working it does nothing. My css file isn't cached in the browser so it's not the problem. I searched a lot of questions here on stackoverflow but none of them was good for me so please don't mark as a duplicate.

Thanks for the help. Im here to learn :)

Problem was that i didn't run the Koala program which is the compiler. So i started Koala it complied my main.scss file for main.css and now it works well.

So if you are having problem with this always check that your compiler is running. :)

@FacundoCorradini thanks for the help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM