Skip to content

Commit 1f181f7

Browse files
committed
added css specificity
1 parent 7af7c41 commit 1f181f7

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

css.html

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -178,16 +178,18 @@ <h2>5. box model</h2>
178178
<h2>6. position</h2>
179179
<p><strong>Question:</strong> How absolute, relative, fixed and static position differ?</p>
180180
<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>
185185
<p>ref: <a href="http://www.barelyfitz.com/screencast/html-training/css/positioning/">css positioning in ten steps</a>, <a href="http://css-tricks.com/absolute-relative-fixed-positioining-how-do-they-differ/">css position</a>, <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/position">MDN: position</a></p>
186186
</div>
187187
<div id="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: <a href="http://coding.smashingmagazine.com/2007/07/27/css-specificity-things-you-should-know/">css specificity: things you need to know</a>, <a href="http://www.standardista.com/css3/css-specificity/">specifishity</a>, <a href="http://specificity.keegan.st/">specificiyt calculator</a></p>
191193
</div>
192194
<div id="download_order">
193195
<h2>8. applied rule</h2>

0 commit comments

Comments
 (0)