function getcss(cssfile){

loadcss = document.createElement('link')

loadcss.setAttribute("rel", "stylesheet")

loadcss.setAttribute("type", "text/css")

loadcss.setAttribute("href", cssfile)

document.getElementsByTagName("head")[0].appendChild(loadcss)

}

if(screen.width <= '800')
// Defines the resolution range you're targeting (less than 800 pixels wide in this case)

{

getcss('css1.css')
// Defines the .css file you want to load for this range (css1.css)

}


else if(screen.width > '800' && screen.width < '1280')
// This time we're targeting all resolutions between 800 and 1280 pixels wide

{

getcss('css1.css')
//And we want to load the .css file named "css1.css"

}



else if(screen.width >= '1280' && screen.width < '1366')
//Targeting screen resolutions between 1280 and 1366px wide

{

getcss('css.css')
//Load css.css

}



else

{

getcss('css.css')
//This else statement has "if" condition. If none of the following criteria are met, load css.css

}





