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
Copy file name to clipboardExpand all lines: css.html
+9-8Lines changed: 9 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -308,15 +308,15 @@ <h2>6. display vs visibility</h2>
308
308
</div>
309
309
<divid="http_request">
310
310
<h2>7. specificity </h2>
311
-
<p><strong>Question:</strong> What is specificity</p>
311
+
<p><strong>Question:</strong> What is specificity? How do u calculate specificity?</p>
312
312
<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>
313
313
<p>inline style usually wins then ID then class value (or pseudo-class or attribute selector), unversal selector (*) has no specificity.</p>
314
314
<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>
315
315
</div>
316
316
317
317
<divid="mark">
318
318
<h2>8. box model</h2>
319
-
<p><strong>Question:</strong>What is css box model?</p>
319
+
<p><strong>Question:</strong>Why you should care aobut css box model?</p>
320
320
<p><strong>Answer:</strong> everything in a web page is a box where you can control size, position, background, etc. Each box/content area is optionally surrounded by padding, border and margin. When you set height and widht of an element, you set content height and width</p>
<p><strong>Answer:</strong> overflow property deals with the content if content size exceeds the allocated size for the content. You can make extra content visible, hidden, scroll or auto (viewport default behavior).</p>
370
368
<p><strong>Question:</strong> Does overflow: hidden create a new block formatting context?</p>
371
-
<p><strong>Answer:</strong> yes</p>
369
+
<p><strong>Answer:</strong> yes</p>
370
+
<p><strong>Extra:</strong> overflow property deals with the content if content size exceeds the allocated size for the content. You can make extra content visible, hidden, scroll or auto (viewport default behavior).</p>
<p><strong>Question:</strong> How do you optimize css selectors?</p>
429
+
<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>
430
+
<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>
0 commit comments