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
+14-11Lines changed: 14 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -272,20 +272,20 @@ <h2>3. rapid fire</h2>
272
272
<p><strong>Answer:</strong> no.</p>
273
273
<p><strong>Question:</strong> Does padding-top or padding-bottom has effect on inline elemet?</p>
274
274
<p><strong>Answer:</strong> no.</p>
275
+
<p><strong>Question:</strong>If you have a <p> element with font-size: 10rem, will the text be responsive when the user resizes / drags the browser window?</p>
276
+
<p><strong>Answer:</strong> no.</p>
275
277
<p><strong>Question:</strong> The pseudo class :checked will select inputs with type radio or checkbox, but not <option> elements.</p>
276
278
<p><strong>Answer:</strong> False</p>
277
279
<p><strong>Question:</strong> In a HTML document, the pseudo class :root always refers to the <html> element.</p>
278
280
<p><strong>Answer:</strong> True</p>
279
281
<p><strong>Question:</strong> The translate() function can move the position of an element on the z-axis.</p>
280
-
<p><strong>Answer:</strong> False</p>
281
-
<p><strong>Question:</strong>If you have a <p> element with font-size: 10rem, will the text be responsive when the user resizes / drags the browser window?</p>
282
-
<p><strong>Answer:</strong> no.</p>
282
+
<p><strong>Answer:</strong> False</p>
283
283
</div>
284
284
285
285
286
286
<divid="bdo">
287
-
<h2>4. px, em or %</h2>
288
-
<p><strong>Question:</strong> What do you prefer px, em or % and why?</p>
287
+
<h2>4. units</h2>
288
+
<p><strong>Question:</strong> What do you prefer px, em % or pt and why?</p>
289
289
<p><strong>Answer:</strong> it depends.</p>
290
290
<p>px, gives fine grained control and maintains alignment because 1 px or multiple of 1 px is guaranteed to look sharp. px is not cascade, this means if parent font-size is 20px and child 16px. child would be 16px.</p>
291
291
<p>em, em is the width of the letter 'm' in the selected typeface. maintains relative size. you can have responsive fonts. However, this concept is tricky. 1em is equal to the current font-size of the element or the browser default. if u sent font-size to 16px then 1em = 16px. The common practice is to set default body font-size to 62.5% (equal to 10px). em is cascade</p>
@@ -320,8 +320,8 @@ <h2>7. specificity </h2>
320
320
321
321
<divid="mark">
322
322
<h2>8. box model</h2>
323
-
<p><strong>Question:</strong> What is css box model?</p>
324
-
<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>
323
+
<p><strong>Question:</strong> What are the properties related to box model?</p>
324
+
<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 width of an element, you set content height and width.</p>
325
325
<p>Technically, height, width, padding and border are part of box model and margin is related to it.</p>
<p><strong>Question:</strong> What do u know about tranisition 3D?</p>
343
+
<p><strong>Question:</strong> What do u know about tranisition?</p>
344
344
<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>Whare are some peseudo classed u have used?</p>
412
+
<p><strong>Question:</strong>What are the some peseudo classed u have used?</p>
413
413
<p><strong>Answer: </strong> pseudo class tells you specific state of an element. allow to style element dynamically. The most popular one is <code>:hover</code>. Besides i have used <code>:visited</code>, <code>:focus</code>, <code>:nth-child</code>, <code>nth-of-type</code>, <code>:link</code>, etc.</p>
414
414
<p>pseudo classes is better if you dont want to mess up with javascript however, pesudo-classes is slow to process and apply rules.</p>
415
415
<p>ref: <ahref="http://coding.smashingmagazine.com/2011/03/30/how-to-use-css3-pseudo-classes/">How to use pseudo classes</a>, <ahref="http://css-tricks.com/pseudo-class-selectors/">meet pseudo classes</a>, <ahref="https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes">list of pseudo classes</a></p>
<p><strong>Question:</strong> How do you optimize css selectors?</p>
434
434
<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>
435
435
<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