Last active
September 24, 2015 20:18
-
-
Save piotrkulpinski/8917461 to your computer and use it in GitHub Desktop.
Markup styles example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<img alt="" class="alignnone" src="http://placehold.it/350x150"> | |
<p>Within this document, references will be made to <em>elements</em> and <em>attributes</em>. It's important to understand the difference, <wbr>so consider this sample code:</p> | |
<p><code><a href="index.php">Home</a></code></p> | |
<p>The base <abbr title="HyperText Markup Language">HTML</abbr> element is the <code>a</code> in this case. The attribute is any additional information about that element within the initial < > pair, or the <code>href</code> value in this case.</p> | |
<p>To view the example usage for any item within this document, please view its source.</p> | |
<hr> | |
<h2>Header <a href="#">Examples</a></h2> | |
<p>The main page header of this guide is an <code>h1</code> element. Please reserve <code>h1</code> for individual page titles only. Any header elements may include links, as depicted in the example.</p> | |
<p>The secondary header above is an <code>h2</code> element, which may be used for any form of important page-level header. More than one may be used per page. Consider using an <code>h2</code> unless you need a header level of less importance, or as a sub-header to an existing <code>h2</code> element. Any header level may include links, as depicted in the example.</p> | |
<h1>First-Level Header</h1> | |
<p>The header above is an <code>h3</code> element, which may be used for any form of page-level header which falls below the <code>h2</code> header in a document hierarchy. More than one may be used per page.</p> | |
<h2>Second-Level Header</h2> | |
<p>The header above is an <code>h3</code> element, which may be used for any form of page-level header which falls below the <code>h2</code> header in a document hierarchy. More than one may be used per page.</p> | |
<h3>Third-Level Header</h3> | |
<p>The header above is an <code>h3</code> element, which may be used for any form of page-level header which falls below the <code>h2</code> header in a document hierarchy. More than one may be used per page.</p> | |
<h4>Fourth-Level Header</h4> | |
<p>For all headers below third-level, follow the guidelines listed above. Only use lower header levels when necessary.</p> | |
<h5>Fifth-Level Header</h5> | |
<p>For all headers below third-level, follow the guidelines listed above. Only use lower header levels when necessary.</p> | |
<h6>Sixth-Level Header</h6> | |
<p>For all headers below third-level, follow the guidelines listed above. Only use lower header levels when necessary.</p> | |
<hr> | |
<h2>Paragraphs</h2> | |
<p>All paragraphs are wrapped in <code>p</code> tags. Additionally, <code>p</code> elements can be wrapped with a <code>blockquote</code> element <em>if the <code>p</code> element is indeed a quote</em>. Historically, <code>blockquote</code> has been used purely to force indents, but this is now achieved using CSS. Reserve <code>blockquote</code> for quotes. Here's an example of correct usage:</p> | |
<blockquote cite="http://lipsum.com/feed/html"> | |
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras euismod fringilla arcu. Integer posuere. Aliquam ipsum. Donec eget massa ac orci tempus euismod. Donec quis neque nec neque consequat sollicitudin. Donec commodo tempor nulla. Suspendisse venenatis. Ut ut leo. Nunc placerat urna at libero. Nunc suscipit lacus.</p> | |
<p><cite><a href="http://lipsum.com/feed/html">lipsum.com</a></cite></p> | |
</blockquote> | |
<p>Additionally, you might wish to cite the source, as in the above example. (The correct method involves the <code>cite</code> attribute directly applied to the <code>blockquote</code> element, but since no browser makes any use of that information whatsoever, it's useful to also specify the standalone <code>cite</code> element.)</p> | |
<hr> | |
<h2>Inline Text</h2> | |
<p>You might have noticed all the monospaced text in this guide. There are a number of inline <abbr title="HyperText Markup Language">HTML</abbr> elements you may use anywhere within other elements, including <abbr title="Abbreviation">abbr</abbr>, <cite>cite</cite>, <code>code</code>, <del>del</del>, <em>em</em>, <ins>ins</ins>, <kbd>kbd</kbd>, <strong>strong</strong>, and <var>var</var>.</p> | |
<dl> | |
<dt><abbr title="Abbreviation">abbr</abbr></dt> | |
<dd>Used for any abbreviated text, whether it be initialism or otherwise. Generally, it's less work and useful (enough) to mark up only the first occurence of any particular abbreviation on a page, and ignore the rest. Any text in the <code>title</code> attribute will appear when the user's mouse hovers the abbreviation (although notably, this does not work in Internet Explorer for Windows). Example abbreviations and usage: <abbr title="National Aeronautics and Space Administration">NASA</abbr>, <abbr title="HyperText Markup Language">HTML</abbr>, and <abbr title="Massachusetts">Mass.</abbr></dd> | |
<dt><code>code</code></dt> | |
<dd> | |
<p>Used for computer code samples. Useful for technology-oriented sites, not so useful otherwise. Example code and usage:</p> | |
<pre> | |
<code>function getJello() { | |
echo $aDeliciousSnack; | |
}</code> | |
</pre> | |
<p>Inline usage: just like elsewhere in this document, <abbr title="HyperText Markup Language">HTML</abbr> elements like <code>em</code> or <code>code</code> can be considered code, and marked up as such.</p> | |
</dd> | |
<dt><cite>cite</cite></dt> | |
<dd>Used for defining a citation or reference to other information sources. Example cited text and usage: More information can be found in <cite>[ISO-0000]</cite></dd> | |
<dt> | |
<del datetime="2011-04-22T19:00:00+03:00">del</del> | |
</dt> | |
<dd> | |
Used for deleted or retracted text which still must remain on the page for some reason. Since the default style inc a strikethrough line, it's preferable to the <code>s</code> element. The <code>del</code> element also has a <code>datetime</code> attribute which allows you to include a timestamp directly in the element. Example deleted text and usage: She bought <del datetime="2011-04-22T19:00:00+03:00">two</del> <ins datetime="2011-04-22T19:00:00+03:00">five</ins> pairs of shoes. | |
</dd> | |
<dt><em>em</em></dt> | |
<dd>Used for denoting emphasized text. In most instances where you'd want to italicize text (using the <abbr title="HyperText Markup Language">HTML</abbr> element <code>i</code> or otherwise) you should use the <code>em</code> element instead. Notable exceptions are stylistic italicizing of proper titles, foreign languages, etc. where italicizing is used for differentiation instead of emphasis. In those cases, no proper <abbr title="HyperText Markup Language">HTML</abbr> elements exist, so an <code>i</code> element or a <code>span</code> element with a custom class may be preferable. Example emphasized text and usage: You simply <em>must</em> try the negitoro maki!</dd> | |
<dt> | |
<ins datetime="2011-04-22T19:21:00+03:00">ins</ins> | |
</dt> | |
<dd> | |
Used for inserted text and counterpart to the <code>del</code> element. Like <code>del</code>, <code>ins</code> has a <code>datetime</code> attribute which allows you to include a timestamp directly in the element. Example inserted text and usage: She bought <del datetime="2011-04-22T19:21:00+03:00">two</del> <ins datetime="2011-04-22T19:21:00+03:00">five</ins> pairs of shoes. | |
</dd> | |
<dt><kbd>kbd</kbd></dt> | |
<dd>Used for text which should be typed by the user. Mainly useful for computer instructions. Example keyboard text and usage: Please press <kbd>Enter</kbd> to continue.</dd> | |
<dt><strong>strong</strong></dt> | |
<dd>Used for denoting stronger emphasis than the <code>em</code> element. In most instances where you'd want to bold text (using the <abbr title="HyperText Markup Language">HTML</abbr> element <code>b</code> or otherwise) you should use the <code>strong</code> element instead. Notable exceptions are stylistic bolding of examples, first occurences of names in an article, etc. where bolding is used for differentiation instead of emphasis. In those cases, no proper <abbr title="HyperText Markup Language">HTML</abbr> elements exist, so <code>b</code> element or a <code>span</code> element with a custom class may be preferable. Example strong text and usage: <strong>Don't</strong> stick nails in the electrical outlet.</dd> | |
<dt><var>var</var></dt> | |
<dd>Used for variables within computer code snippets. Useful for technology-oriented sites, not so useful otherwise. Example code and usage: Add 5 to <var>$result</var> and recalculate.</dd> | |
<dt><small>small</small></dt> | |
<dd>The <code>small</code> element represents side comments such as small print.</dd> | |
<dt style="text-decoration: line-through">s</dt> | |
<dd>The <code>s</code> element represents contents that are no longer accurate or no longer relevant. When indicating document edits, use the <code>del</code> instead.</dd> | |
<dt><q>q</q></dt> | |
<dd><q cite="http://www.w3.org/wiki/HTML/Elements/q">The <code>q</code> element represents some phrasing content quoted from another source.</q> as stated on w3.org wiki.</dd> | |
<dt><dfn>dfn</dfn></dt> | |
<dd>The <dfn title="Hyper Text Markup Language">HTML</dfn> is the publishing language of the World Wide Web.</dd> | |
<dt><samp>samp</samp></dt> | |
<dd>The <code>samp</code> element represents output from a program or computing system. If you input a wrong value, it is displayed as <samp>error!!</samp></dd> | |
<dt><mark>mark</mark></dt> | |
<dd> | |
The <code>mark</code> element represents a run of text in one document marked or highlighted for reference purposes, due to its relevance in another context. | |
<blockquote lang="en-GB"> | |
<p>Look around and you will find, no-one's really <mark>colour</mark> blind.</p> | |
</blockquote> | |
<p lang="en-US">As we can tell from the <em>spelling</em> of the word, the person writing this quote is clearly not American.</p> | |
</dd> | |
</dl> | |
<hr> | |
<h2>Subscripts and Superscripts</h2> | |
<p>In order to test how subscripts and superscripts (<code>sub</code> and <code>sup</code> markup) work inside running text, we need some dummy text around constructs like x<sub>1</sub> and H<sub>2</sub>O (where subscripts occur). So here is some fill so that you will (hopefully) see whether and how badly the subscripts and superscripts mess up vertical spacing between lines. Now superscripts: M<sup>lle</sup>, 1<sup>st</sup>, and then some mathematical notations: e<sup>x</sup>, sin<sup>2</sup> <i>x</i>, and some nested superscripts (exponents) too: Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p> | |
<hr> | |
<h2>Address</h2> | |
<address> | |
John Doe LLC<br> | |
111 Example Avenue<br> | |
13341 Ano Liosia<br> | |
Athens, Greece<br> | |
Phone: +39 210 123 4567<br> | |
web : <a href="http://www.singeridis.com/markup">www.singeridis.com/markup/</a><br> | |
email : <a href="mailto:[email protected]">[email protected]</a> | |
</address> | |
<hr> | |
<h2>Figure and figcaption</h2> | |
<p>The <code>figure</code> element represents some flow content.</p> | |
<hr> | |
<h2>Lists</h2> | |
<p>Then there are the lists. <code>ul</code> denotes an unordered list (ie. a list of loose items that don't require numbering, or a bulleted list). <code>ol</code> denotes an ordered list, and various numbering schemes are available through the CSS (including 1,2,3... a,b,c... i,ii,iii... and so on). Each item within the <code>ul</code> or <code>ol</code> requires a surrounding <code><li></code> and <code></li></code> tag, to denote individual items within the list (as you may have guessed, <code>li</code> stands for list item).</p> | |
<p>Additionally, <code>dl</code> is another list type called a definition list. Instead of list items, the content of a <code>dl</code> consists of <code>dt</code> (Definition Term) and <code>dd</code> (Definition description) pairs. Though it may be called a "definition list", <code>dl</code> can apply to other scenarios where a parent/child relationship is applicable. For example, it may be used for marking up dialogues, with each <code>dt</code> naming a speaker, and each <code>dd</code> containing his or her words.</p> | |
<p>Example lists and usage:</p> | |
<ul> | |
<li>This is an unordered list.</li> | |
<li>It has two items.</li> | |
</ul> | |
<ol> | |
<li>This is an ordered list.</li> | |
<li>It has two items.</li> | |
<li>No, I lied, it has three.</li> | |
</ol> | |
<dl> | |
<dt>This is a term.</dt> | |
<dd>This is the definition of that term, which both live in a <code>dl</code>.</dd> | |
<dt>Here is another term.</dt> | |
<dd>And it gets a definition too, which is this line.</dd> | |
<dt>Here is term that shares a definition with the term below.</dt> | |
<dt>Here is a defined term.</dt> | |
<dd><code>dt</code> terms may stand on their own without an accompanying <code>dd</code>, but in that case they <em>share</em> descriptions with the next available <code>dt</code>. You may not have a <code>dd</code> without a parent <code>dt</code>.</dd> | |
</dl> | |
<hr> | |
<h2>Tables</h2> | |
<p>The following table has a caption. The first row and the first column contain table header cells only; other cells are data cells.</p> | |
<table> | |
<caption> | |
Caption: Sample table: Areas of some countries, in sq km | |
</caption> | |
<thead> | |
<tr> | |
<th>Country</th> | |
<th>Total area</th> | |
<th>Land area</th> | |
</tr> | |
</thead> | |
<tbody> | |
<tr> | |
<th>Greece</th> | |
<td>131,990</td> | |
<td>130,800</td> | |
</tr> | |
<tr> | |
<th>Finland</th> | |
<td>337,030</td> | |
<td>305,470</td> | |
</tr> | |
<tr> | |
<th>Iceland</th> | |
<td>103,000</td> | |
<td>100,250</td> | |
</tr> | |
<tr> | |
<th>Norway</th> | |
<td>324,220</td> | |
<td>307,860</td> | |
</tr> | |
<tr> | |
<th>Sweden</th> | |
<td>449,964</td> | |
<td>410,928</td> | |
</tr> | |
</tbody> | |
</table> | |
<hr> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment