Skip to main content

Posts

Showing posts from June, 2014

Things you may not know about CSS

Grammatical error like style using CSS: .grammar{ -moz-text-decoration-color: green; -moz-text-decoration-line: underline; -moz-text-decoration-style: wavy; text-decoration-color: green; text-decoration-line: underline; text-decoration-style: wavy; } Output : CSS 'empty-cells' Property table{ empty-cells:hide; }    CSS @supports  Usually we do CSS feature-test using JavaScript. Now it can be done in CSS with a new property '@supports' . So for Firefox 22+ , Chrome 28+, Opera 12.1+ supports this feature. So we can look forward to using it soon! Example: /* basic usage */ @supports(prop:value) { /* more styles */ } /* real usage */ @supports (display: flex) { div { display: flex; } } /* testing prefixes too */ @supports (display: -webkit-flex) or (display: -moz-flex) or (display: flex) { section { display: -webkit-flex; display: -moz-flex; display: f...

Javascript - Some Useful Tips & Tricks

Use window.name for simple session handling window object has its own property 'name'. The name of the window is used primarily for setting targets for hyperlinks and forms. Windows do not need to have names. With this property we can achieve simple session storage. Browser preserves the property value ( window.name ) until the window/tab is closed.   Labels You can use a label to identify a loop, and then use the break or continue statements to indicate whether a program should interrupt the loop or continue its execution. var i, j; loop1: for (i = 0; i < 3; i++) { //The first for statement is labeled "loop1" loop2: for (j = 0; j < 3; j++) { //The second for statement is labeled "loop2" if (i === 1 && j === 1) { continue loop1; } console.log('i = ' + i + ', j = ' + j); } } // Output is: // "i = 0, j = 0" // "i = 0, j = 1" // "i = 0, j = ...