You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>ref: <ahref="http://www.vanseodesign.com/css/vertical-centering/">6 methods for vertical center</a>, <ahref="http://coding.smashingmagazine.com/2013/08/09/absolute-horizontal-vertical-centering-css/">Absolute horizontal and vertical centering</a></p>
414
414
</div>
415
-
<divid="something">
415
+
<divid="optimizeSelector">
416
416
<h2>13. optimize selector</h2>
417
417
<p><strong>Question:</strong> How do you optimize css selectors?</p>
418
418
<p><strong>Answer: </strong> This is very open and depend on what you are trying to achieve. If i order selectors interms of render speed it would be like id, class, tag, siblings, child, descendent, universal, attribute, pseudo. Speed of ID and class is very close. However your code should be readable, maintainable and DRY along with highly performant.</p>
419
419
<p>The best practices in general are: avoid universal selectors, don't repeat yourself, remove redundant selectors, be as specific as possible, and keep learning.</p>
<p><strong>Question:</strong> How can you load css resources conditionally?</p>
425
425
<p><strong>Answer:</strong> @import allows you to load/import stylesheet by using a prth (uri) representing the location of the file. You can define one or more media by comma seperation for which you want to load the stylesheet. If browser dont support the media stylesheet will not be loaded.</p>
426
426
<p>ref: be careful while using @import (<ahref="http://www.stevesouders.com/blog/2009/04/09/dont-use-import/">don't use @import</a>)</p>
427
427
</div>
428
-
<divid="something">
428
+
<divid="cssSprite">
429
429
<h2>15. sprite</h2>
430
430
<p><strong>Question:</strong> Why would you use sprites?</p>
431
431
<p><strong>Answer:</strong> When you have multiple images/icons, browser makes seperate call to the server for each one of them. sprite is a technique to combine all of them (usually similar one in terms of type of image. For example, you will put jpg in one sprite) in one image. you can later optimize the image. To display the icon you set height, width and background position.</p>
432
432
<p>popular libraries like bootstrap use this technques. If you repeat the image. want to scale you have to be careful with sprite.</p>
<p><strong>Question:</strong> What is specificity? How do u calculate specificity?</p>
438
438
<p><strong>Answer:</strong> is a process of determining which css rule will be applied to an element. it actually determines which rules will take precedence. </p>
439
439
<p>inline style usually wins then ID then class value (or pseudo-class or attribute selector), unversal selector (*) has no specificity.</p>
440
440
<p>ref: <ahref="http://coding.smashingmagazine.com/2007/07/27/css-specificity-things-you-should-know/">css specificity: things you need to know</a>, <ahref="http://www.standardista.com/css3/css-specificity/">specifishity</a>, <ahref="http://specificity.keegan.st/">specificiyt calculator</a></p>
441
441
</div>
442
-
<divid="standard_quirks">
442
+
<divid="shadowDom">
443
443
<h2>17. shadow DOM</h2>
444
444
<p><strong>Question:</strong> What is shadow DOM?</p>
445
445
<p><strong>Answer:</strong> encapsulate part of a DOM. hide subtree. you can have same ID in different shadow DOM. Polymers uses it. This way your DOM becomes reusable and u dont have to do iframe. if interviewer is not happy with your answer give him the links and tell him to spend a weekend on reading.</p>
<p><strong>Question:</strong> What do u know about tranisition?</p>
451
451
<p><strong>Answer:</strong> transition allows to add an effect while changing from one style to another. You can set the which property you want to transition, duration, how u want to transit (linear, ease, ease-in, ease-out, cubic-bezier) and delay when transition will start. you can transition more than one property by comma seperation</p>
<p><strong>Question:</strong> What are the reasons to use preprocessor?</p>
497
497
<p><strong>Answer:</strong> you write css in high level with some special syntax (declaring variable, nested syntax, mathmetical operations, etc.) and that is compiled to css. Preprocessor helps you to speed up develop, maintain, ensure best practices and also confirms concatenation, compression, etc.</p>
498
498
499
499
ref: <ahref="http://css-tricks.com/musings-on-preprocessing/">css preprocessor</a>, <ahref="https://developers.google.com/chrome-developer-tools/docs/css-preprocessors">working with preprocessor</a>
500
500
</div>
501
-
<divid="download_order">
502
-
<h2>21. show & tell</h2>
501
+
<divid="seeAndTell">
502
+
<h2>21. see & tell</h2>
503
503
<p><strong>Question:</strong> What is the color of text sausage for he following rule?</p>
0 commit comments