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-7Lines changed: 9 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -178,16 +178,18 @@ <h2>5. box model</h2>
178
178
<h2>6. position</h2>
179
179
<p><strong>Question:</strong> How absolute, relative, fixed and static position differ?</p>
180
180
<p><strong>Answer:</strong></p>
181
-
<p>absolute, place an element exactly where you want to place it. position is relative to parent. if no parent available then relatively place to the page itself.</p>
182
-
<p>relative, is position an element relative to itself. for example, if u set postion relative to an elment and set top:10px, it will move 10px down from where it would be normally.</p>
183
-
<p>fixed, element is positioned relative to viewport or the browser window itself. viewport doesnt changed if u scroll and hence fixed element will stay right in the same position</p>
184
-
<p>static, element will be positioned based on the normal flow of the document. usually, u will use position static to remove other position mibht be applied to an element.</p>
181
+
<p><em>absolute</em>, place an element exactly where you want to place it. position is relative to parent. if no parent available then relatively place to the page itself.</p>
182
+
<p><em>relative</em>, is position an element relative to itself. for example, if u set postion relative to an elment and set top:10px, it will move 10px down from where it would be normally.</p>
183
+
<p><em>fixed</em>, element is positioned relative to viewport or the browser window itself. viewport doesnt changed if u scroll and hence fixed element will stay right in the same position</p>
184
+
<p><em>static</em>, element will be positioned based on the normal flow of the document. usually, u will use position static to remove other position mibht be applied to an element.</p>
185
185
<p>ref: <ahref="http://www.barelyfitz.com/screencast/html-training/css/positioning/">css positioning in ten steps</a>, <ahref="http://css-tricks.com/absolute-relative-fixed-positioining-how-do-they-differ/">css position</a>, <ahref="https://developer.mozilla.org/en-US/docs/Web/CSS/position">MDN: position</a></p>
186
186
</div>
187
187
<divid="http_request">
188
-
<h2>7. something </h2>
189
-
190
-
<p>ref: </p>
188
+
<h2>7. specificity </h2>
189
+
<p><strong>Question:</strong> What is specificity</p>
190
+
<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>
191
+
<p>inline style usually wins then ID then class value (or pseudo-class or attribute selector), unversal selector (*) has no specificity.</p>
192
+
<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>
0 commit comments