Skip to content

Commit 0b92a33

Browse files
committed
added margin related style
1 parent 8fbe8e3 commit 0b92a33

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

css.html

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -230,20 +230,20 @@ <h2>8. applied rule</h2>
230230
<p><strong>Answer:</strong> red</p>
231231
ref: <a href="http://davidshariff.com/quiz/">David Shariff: quiz</a>
232232
</div>
233-
<!-- <div id="optional_tag">
234-
<h2>9. self closing tag</h2>
235-
<p><strong>Question:</strong> What are optional closing tag? and why would u use it?</p>
236-
<p><strong>Answer:</strong> p, li, td, tr, th, html, body, etc. you dont have to provide end tag. whenever browser hits a new tag it automatically ends the previous tag. However, you have to be careful to escape it.</p>
237-
<p><strong>reason:</strong> you can save some byte and reduce bytes needs to be downloaded in a html file.</p>
233+
<div id="optional_tag">
234+
<h2>9. applied rule-2</h2>
235+
<p><strong>Question:</strong> What will happen to the position of #example?</p>
238236
<pre><code>
239-
&lt;p&gt;Some text<br/>&lt;p&gt;Some more text<br/>&lt;ul&gt;<br/> &lt;li&gt;A list item<br/> &lt;li&gt;Another list item<br/>&lt;/ul&gt;
237+
&lt;style&gt;<br/> #example {<br/> margin-bottom: -5px;<br/> }<br/>&lt;/style&gt;<br/>&lt;&lt;p id=&quot;example&quot;&gt;Hello&lt;/p&gt;p id=&quot;example&quot;&gt;Hello&lt;/p&gt;
240238
</code></pre>
241-
<p> the above html will be parsed as the following blocks.</p>
239+
<p><strong>Answer:</strong> All elements succeeding #example will move 5px updward.</p>
240+
<p><strong>reason:</strong> .</p>
242241
<pre><code>
243-
&lt;p&gt;Some text&lt;/p&gt;<br/>&lt;p&gt;Some more text&lt;/p&gt;<br/>&lt;ul&gt;<br/> &lt;li&gt;A list item&lt;/li&gt;<br/> &lt;li&gt;Another list item&lt;/li&gt;<br/>&lt;/ul&gt;
244-
</code></pre>
245-
<p>ref: <a href="http://www.w3.org/TR/REC-html40/index/elements.html">W3.org: index of elements</a> </p>
246-
</div> -->
242+
&lt;style&gt;<br/> #example {<br/> margin-left: -5px;<br/> }<br/>&lt;/style&gt;<br/>&lt;&lt;p id=&quot;example&quot;&gt;Hello&lt;/p&gt;p id=&quot;example&quot;&gt;Hello&lt;/p&gt;
243+
</code></pre>
244+
<p><strong>Answer:</strong> #example will move 5px left.</p>
245+
<p>ref: <a href="">David Shariff</a> </p>
246+
</div>
247247

248248
<!-- <div id="div_span">
249249
<h2>10. span vs div</h2>

0 commit comments

Comments
 (0)