Menu icon Foundation
Media Query for touch/non-touch devices

I'm aware modernizr adds a class for touch devices, does foundation remove this feature?
If not, how can I tap into it for my media queries or even just class selection i.e.

.touch.custom-div-name {
    key: value;
}
            

         

media querymodernizrtouch

I'm aware modernizr adds a class for touch devices, does foundation remove this feature?
If not, how can I tap into it for my media queries or even just class selection i.e.

.touch.custom-div-name {
    key: value;
}
            

         
Robin Cox about 5 years ago

Modernizr adds the class .touch to the html tag on devices with touch screens. So to target a div with the class "custom-div-name", do this:

html.touch .custom-div-name {
key: value;
}

(note the spacing between html.touch and .custom-div-name)

Alexander Assimidis about 5 years ago

Be aware this is not working everywhere only on newer devices!