Show Buttons
Share On Facebook
Share On Twitter
Share On Google Plus
Share On Linkdin
Share On Reddit
Share On Stumbleupon
Contact us
Hide Buttons

Category: Fundamentals

0

css — circular profile pictures

Nowa­days, cir­cu­lar pro­file pic­tures are very pop­u­lar. It’s really sim­ple to cre­ate the cir­cu­lar pro­file pic­ture from a given square image using border-radius. Fol­low­ing exam­ple, ren­ders an orig­i­nal square image as well as the…

0

css — vertically align text

Let’s see the exam­ple on hor­i­zon­tally align­ing the text using text-align: cen­ter as shown in the below pen. To ver­ti­cally align the text for a sin­gle line of text we can use the fol­low­ing technique.…

0

querySelector vs getElementById

Get Ele­ment By Id It returns a node list which is live, mean­ing if you add or remove any ele­ment from the DOM the node list will update It is faster rel­a­tive to the query…

0

window vs document

Web browser is made up of hier­ar­chy of objects. At the root level we have a win­dow object. Win­dow It is the root level ele­ment in any web page. All the global vari­ables are defined…

0

pseudo elements vs pseudo classes

pseudo ele­ments They allow you to style cer­tain parts of a doc­u­ment. For exam­ple, you can style the first let­ter of each para­graph. MDN list of pseudo ele­ments The fol­low­ing video demon­strates the pseudo…

0

window.onload vs document.onload

window.onload It is fired when the entire page loads, includ­ing its con­tent (images, css, scripts, etc.) $(window).load() document.onload It is fired when the DOM is ready which can be prior to images and other…

0

nodejs: generate uuid / guid

node-uuid pro­vide a sim­pler and reli­able way to cre­ate unique id. It is rig­or­ous imple­men­ta­tion of RFC4122 (v1 and v4) UUIDs. // npm i node-uuid var uuid = require(‘node-uuid’); // Gen­er­ate a v1 (time-based) id…

0

css: margin does not work

Once in a while when two ele­ments with the fol­low­ing cri­te­ria has only con­tent (no padding and no bor­der) has ver­ti­cal mar­gins applied to it When they touch each other the mar­gin col­lapse to the…

0

position: relative

Overview To design and under­stand the page lay­outs, we need to under­stand the posi­tion prop­erty in css. An ele­ment is said to be posi­tioned, when its posi­tion attribute is set. posi­tion : rel­a­tive || absolute…