Editing Talk:1144: Tags

Jump to: navigation, search
Ambox notice.png Please sign your posts with ~~~~

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 46: Line 46:
 
:::Now, to extend the metaphor into the real world, you can think of <code>&lt;div&gt;</code> as meaning "container" and <code>&lt;span&gt;</code> as meaning "effect". "Container" doesn't mean very much by itself; it's just "a thing into which you can put other things". Likewise, "effect" just means "a way in which you can change how other things look". ("Effect" isn't necessarily the best term here, but I can't think of a better one.) "Container" provides no clues as to what kind of container it is or what you might find inside; "effect" doesn't really tell you what kind of visual change you're getting.
 
:::Now, to extend the metaphor into the real world, you can think of <code>&lt;div&gt;</code> as meaning "container" and <code>&lt;span&gt;</code> as meaning "effect". "Container" doesn't mean very much by itself; it's just "a thing into which you can put other things". Likewise, "effect" just means "a way in which you can change how other things look". ("Effect" isn't necessarily the best term here, but I can't think of a better one.) "Container" provides no clues as to what kind of container it is or what you might find inside; "effect" doesn't really tell you what kind of visual change you're getting.
  
:::Imagine, then, a Christmas tree. You can put the Christmas tree in a tree stand (<code>&lt;div class="tree-stand"&gt;Christmas tree&lt;/div&gt;</code>) or inside a big box (<code>&lt;div class="big-box"&gt;Christmas tree&lt;/div&gt;</code>), or both at once if you're feeling saucy (<code>&lt;div class="big-box"&gt;&lt;div class="tree-stand"&gt;Christmas tree&lt;/div&gt;&lt;/div&gt;</code>). Note that the closing tag will backtrack through the code and close the first DIV it finds, so that you could put other things inside the big box too: <code>&lt;div class="big-box"&gt;&lt;div class="tree-stand"&gt;Christmas tree&lt;/div&gt;Christmas cookies&lt;/div&gt;</code>. Likewise, you can attach ornaments and tinsel to the tree. Since they're effects that you're adding to the tree, rather than containers into which you're putting the tree, you'd use SPAN: <code>&lt;span class="ornaments"&gt;Christmas tree&lt;/span&gt;</code> and/or <code>&lt;span class="tinsel"&gt;Christmas tree&lt;/span&gt;</code>.  
+
:::Imagine, then, a Christmas tree. You can put the Christmas tree in a tree stand (<code>&lt;div class="tree-stand"&gt;Christmas tree&lt;/div&gt;</code>) or inside a big box (<code>&lt;div class="big-box"&gt;Christmas tree&lt;/div&gt;</code>), or both at once if you're feeling saucy (<code>&lt;div class="big-box"&gt;&lt;div class="tree-stand"&gt;Christmas tree&lt;/div&gt;&lt;/div&gt;</code>). Note that the closing tag will backtrack through the code and close the first DIV it finds, so that you could put other things inside the big box too: <code>&lt;div class="big-box"&gt;&lt;div class="tree-stand"&gt;Christmas tree&lt;/div&gt;Christmas cookies&lt;/div&gt;</code>. Likewise, you can attach ornaments and tinsel to the tree. Since they're effects that you're adding to the tree, rather than containers into which you're putting the tree, you'd use SPAN: <code>&lt;span class="ornaments"&gt;Christmas tree&gt;</code> and/or <code>&lt;span class="tinsel"&gt;</code>.  
  
 
:::You can even have a Christmas tree with ornaments on the left and tinsel on the right, in a tree stand, inside a big box, with some cookies in the box with it:  
 
:::You can even have a Christmas tree with ornaments on the left and tinsel on the right, in a tree stand, inside a big box, with some cookies in the box with it:  

Please note that all contributions to explain xkcd may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see explain xkcd:Copyrights for details). Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel | Editing help (opens in new window)

Templates used on this page: