css - Minimize HTML page load time if it contains image icons -
i want html page loads faster can. i'm trying put css styles same .css file , javascript code 1 .js file. how colleagues told me makes web page load faster. want ask questions it.
just sure: colleagues right? on situations it's better break css or js code separate files?
question is: if have lot of small icons on page, "delete, edit, add", should load image icons @ once or each icon separately? if i'll load icons @ once, how select desired one, if icon's size 40x40px?
thank you!
are colleagues right?
single files can downloaded single http requests (with single sets of http headers, etc, etc) , can compressed more efficiently multiple files. performance perspective, if need content, better place them in single file.
on situations it's better break css or js code separate files?
when need specific page load (e.g. homepage) or when there sections of site use large chunk of script isn't used elsewhere can beneficial break files then.
if have lot of small icons on page, "delete, edit, add", should load image icons @ once or each icon separately?
from performance standpoint, same rules apply. however, there no way specify content image (and icons don't decorate text content images) part of larger file. have use hacks involving background images. breaks separation of concerns around content , style , involves using semantically incorrect elements, , requires further hackery provide alternative content users can't see image , hackery job alt attribute.
if i'll load icons @ once, how select desired one, if icon's size 40x40px?
you have element specific dimensions , background image background-position set part of image want shows through.
Comments
Post a Comment