Search code examples
htmlcssperformanceoptimizationpagespeed

Which CSS is faster? Does cap size improve speed?


Is there a shortcut for three code hexcodes, example, black can be wrote two ways

.black{color:#000}
.black{color:#000000}

Can #DBDBDB this be wrote shorter? As #DBD does not work.

Also what is faster, does it matter, I notice Firebug spits colors and some other vars in case sensitive format. Does it matter? Is it faster to have everything lowercase so the browser and user can load and render faster?

.webform{color:#dbdbdb}
.WebForm{color:#DBDBDB}

Solution

  • Can #DBDBDB this be wrote shorter? As #DBD does not work.

    No. The only things shorter than a 6-hex colour codes are 3-hex codes (which only work for XXYYZZ colours) and (some) named colours (and there isn't one that matches #DBDBDB).

    Also what is faster

    Stop micro-optimising. If there is a difference it won't be a significant one and will probably vary from browser to browser.