问题
How can i write CSS that handle a different effect on Mac OS and different on other OS versions.
i.e.
.(mac){
height: 100%;
width: 100%;
overflow: hidden;
}
.(win and linux){
height: 100%;
width: 100%;
overflow: scroll;
}
回答1:
You cannot do this with pure CSS, you can detect OS like MAX or WIN with JavaScript, and then use that to load different CSS styles.
You can use the result of window.navigator
to find information about the OS.
console.log(window.navigator);
来源:https://stackoverflow.com/questions/39012649/how-to-change-css-according-to-user-operating-system