 
    
<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>margin: auto Archives - Complete, Concrete, Concise</title>
	<atom:link href="https://complete-concrete-concise.com/tag/margin-auto/feed/" rel="self" type="application/rss+xml" />
	<link>https://complete-concrete-concise.com/tag/margin-auto/</link>
	<description>Practical Information Without The Bloat</description>
	<lastBuildDate>Sat, 28 Apr 2018 04:52:11 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>
	<item>
		<title>Sectioning Using HTML and Auto Centering Content</title>
		<link>https://complete-concrete-concise.com/tutorials/webdev/front-end-basics/sectioning-using-html-and-auto-centering-content/</link>
		
		<dc:creator><![CDATA[richardsplanet]]></dc:creator>
		<pubDate>Sat, 28 Apr 2018 04:52:11 +0000</pubDate>
				<category><![CDATA[Front-End Basics]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[div]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[margin: auto]]></category>
		<category><![CDATA[span]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[webdev]]></category>
		<guid isPermaLink="false">https://complete-concrete-concise.com/?p=3643</guid>

					<description><![CDATA[<p>We saw that you can style the &#60;body&#62; tag to contain your content. In this tutorial, we'll see a better way.</p>
<p>The post <a href="https://complete-concrete-concise.com/tutorials/webdev/front-end-basics/sectioning-using-html-and-auto-centering-content/">Sectioning Using HTML and Auto Centering Content</a> appeared first on <a href="https://complete-concrete-concise.com">Complete, Concrete, Concise</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div class="preamble">
In the previous exercise, you saw that it is possible to structure the width and position of content using the <span class="html-tag">body</span> element.<br />
The <span class="html-tag">body</span> is rarely styled, except for possibly a background. HTML has a number of invisible HTML elements that are used for structuring your content.
</div>
<p>The HTML elements you have seen can be best described as <strong>content</strong> elements because they either marked up specific content &#8211; like paragraphs, lists, headings, or hyperlinks &#8211; or they add semantic meaning to the content &#8211; <span class="html-tag">strong</span>, <span class="html-tag">em</span>, <span class="html-tag">i</span>, or <span class="html-tag">mark</span>. But they don’t group together related items &#8211; all elements are pretty much independent of each other.<br />
HTML provides a number of elements that allow styling without semantic meaning or grouping together related items.</p>
<h2>Contents</h2>
<ol type="1">
<li><a href="#span"><span class="html-tag">span</span></a></li>
<li><a href="#div"><span class="html-tag">div</span></a></li>
<li><a href="#centering-blocks-using-margin-auto">Centering Blocks Using <span class="css-property">margin: auto;</span></a></li>
<li><a href="#summary">Summary</a></li>
<li><a href="#playing-around">Playing Around</a></li>
<li><a href="#references">References</a></li>
</ol>
<h2 id="span"><span class="html-tag">span</span></h2>
<p>The <span class="html-tag">span</span> element behaves very much like <span class="html-tag">strong</span>, <span class="html-tag">em</span>, <span class="html-tag">i</span>, or<span class="html-tag">mark</span>: it is <strong>inline</strong> and it can be applied to a bunch of text:</p>
<div id="cb1" class="sourceCode">
<pre class="sourceCode html"><code class="sourceCode html"><a id="cb1-1" class="sourceLine" data-line-number="1"></a><span class="kw">&lt;p&gt;</span>This is some <span class="kw">&lt;strong&gt;</span>strong text<span class="kw">&lt;/strong&gt;&lt;/p&gt;</span>
<a id="cb1-2" class="sourceLine" data-line-number="2"></a><span class="kw">&lt;p&gt;</span>This is some <span class="kw">&lt;i&gt;</span>italic text<span class="kw">&lt;/i&gt;&lt;/p&gt;</span>
<a id="cb1-3" class="sourceLine" data-line-number="3"></a><span class="kw">&lt;p&gt;</span>This is some <span class="kw">&lt;span&gt;</span>span text<span class="kw">&lt;/span&gt;&lt;/p&gt;</span></code></pre>
</div>
<p>Since the <span class="html-tag">span</span> element has no styling applied, the text it encloses will use whatever style is applied to the <span class="html-tag">p</span> tag.<br />
More importantly, the <span class="html-tag">span</span> element has <strong>no semantic meaning</strong>. Any styles you apply to a <span class="html-tag">span</span> are decorative &#8211; User Agents (browsers) will not infer anything special about that text.<br />
All the colour coding used in these pages is done using <span class="html-tag">span</span>.<br />
Consider:</p>
<div id="cb2" class="sourceCode">
<pre class="sourceCode css"><code class="sourceCode css"><a id="cb2-1" class="sourceLine" data-line-number="1"></a><span class="fu">.html-tag</span> {
<a id="cb2-2" class="sourceLine" data-line-number="2"></a>  <span class="kw">background-color</span>: <span class="dv">#FCFCFC</span>;
<a id="cb2-3" class="sourceLine" data-line-number="3"></a>  <span class="kw">border</span>: <span class="dv">1px</span> <span class="dv">solid</span> <span class="dv">black</span>;
<a id="cb2-4" class="sourceLine" data-line-number="4"></a>  <span class="kw">border-radius</span>: <span class="dv">5px</span>;
<a id="cb2-5" class="sourceLine" data-line-number="5"></a>  <span class="kw">padding</span>: <span class="dv">0</span> <span class="dv">3px</span>;
<a id="cb2-6" class="sourceLine" data-line-number="6"></a>}
<a id="cb2-7" class="sourceLine" data-line-number="7"></a>
<a id="cb2-8" class="sourceLine" data-line-number="8"></a><span class="fu">.css-property</span> {
<a id="cb2-9" class="sourceLine" data-line-number="9"></a>  <span class="kw">font-size</span>: <span class="dv">18px</span>;
<a id="cb2-10" class="sourceLine" data-line-number="10"></a>  <span class="kw">font-weight</span>: <span class="dv">bold</span>;
<a id="cb2-11" class="sourceLine" data-line-number="11"></a>  <span class="kw">font-family</span>: <span class="dv">monospace</span>;
<a id="cb2-12" class="sourceLine" data-line-number="12"></a>  <span class="kw">color</span>: <span class="dv">blue</span>;
<a id="cb2-13" class="sourceLine" data-line-number="13"></a>  <span class="kw">margin</span>: <span class="dv">0</span> <span class="dv">3px</span>;
<a id="cb2-14" class="sourceLine" data-line-number="14"></a>}</code></pre>
</div>
<p>When applied to the following text:<a id="fnref1" class="footnote-ref" href="#fn1"><sup>1</sup></a></p>
<div id="cb3" class="sourceCode">
<pre class="sourceCode html"><code class="sourceCode html"><a id="cb3-1" class="sourceLine" data-line-number="1"></a><span class="kw">&lt;p&gt;</span>The paragraph is a common HTML element, it is
<a id="cb3-2" class="sourceLine" data-line-number="2"></a>  written <span class="kw">&lt;span</span><span class="ot"> class=</span><span class="st">"html-tag"</span><span class="kw">&gt;</span><span class="dv">&amp;lt;</span>p<span class="dv">&amp;gt;</span><span class="kw">&lt;/span&gt;</span>.
<a id="cb3-3" class="sourceLine" data-line-number="3"></a><span class="kw">&lt;/p&gt;</span>
<a id="cb3-4" class="sourceLine" data-line-number="4"></a>
<a id="cb3-5" class="sourceLine" data-line-number="5"></a><span class="kw">&lt;p&gt;</span>The eagle eyed will notice I use the CSS property
<a id="cb3-6" class="sourceLine" data-line-number="6"></a>  <span class="kw">&lt;span</span><span class="ot"> class=</span><span class="st">"css-property"</span><span class="kw">&gt;</span>border-radius<span class="kw">&lt;/span&gt;</span>
<a id="cb3-7" class="sourceLine" data-line-number="7"></a>  without having introduced it before.
<a id="cb3-8" class="sourceLine" data-line-number="8"></a><span class="kw">&lt;/p&gt;</span></code></pre>
</div>
<p>Results in the following output:</p>
<div style="background: white; padding: 0.5em; border: 1px solid black;">
The paragraph is a common HTML element, it is written <span style="background: #FCFCFC; border: 1px solid black; border-radius: 5px; padding: 0 3px;">&lt;p&gt;</span>.<br />
The eagle eyed will notice I use the CSS property <span style="font-size: 18px; font-weight: bold; font-family: monospace; color: blue; margin: 0 3px;">border-radius</span> without having introduced it before.
</div>
<p>By default it is an <strong>inline</strong> element, although you can change this with the <span class="css-property">display</span> property. You might change it to <strong>inline-block</strong> if you need to set its <span class="css-property">width</span> or <span class="css-property">height</span>. There is no need to change it to <strong>block</strong> because that is what <span class="html-tag">div</span> is for.</p>
<h2 id="div"><span class="html-tag">div</span></h2>
<p>The <span class="html-tag">div</span> element is similar the <span class="html-tag">span</span> element, except that it is a <strong>block</strong> display element. Like the <span class="html-tag">span</span> element, it has no semantic meaning. It is widely used for grouping things together.<a id="fnref2" class="footnote-ref" href="#fn2"><sup>2</sup></a><br />
Consider the HTML code used to display the output results above:</p>
<div id="cb4" class="sourceCode">
<pre class="sourceCode html"><code class="sourceCode html"><a id="cb4-1" class="sourceLine" data-line-number="1"></a><span class="kw">&lt;div</span><span class="ot"> class=</span><span class="st">"output"</span><span class="kw">&gt;</span>
<a id="cb4-2" class="sourceLine" data-line-number="2"></a>  <span class="kw">&lt;p&gt;</span>The paragraph is a common HTML element, it is
<a id="cb4-3" class="sourceLine" data-line-number="3"></a>    written <span class="kw">&lt;span</span><span class="ot"> class=</span><span class="st">"html-tag"</span><span class="kw">&gt;</span><span class="dv">&amp;lt;</span>p<span class="dv">&amp;gt;</span><span class="kw">&lt;/span&gt;</span>.
<a id="cb4-4" class="sourceLine" data-line-number="4"></a>  <span class="kw">&lt;/p&gt;</span>
<a id="cb4-5" class="sourceLine" data-line-number="5"></a>
<a id="cb4-6" class="sourceLine" data-line-number="6"></a>  <span class="kw">&lt;p&gt;</span>The eagle eyed will notice I use the CSS property
<a id="cb4-7" class="sourceLine" data-line-number="7"></a>    <span class="kw">&lt;span</span><span class="ot"> class=</span><span class="st">"css-property"</span><span class="kw">&gt;</span>border-radius<span class="kw">&lt;/span&gt;</span>
<a id="cb4-8" class="sourceLine" data-line-number="8"></a>    without having introduced it before.
<a id="cb4-9" class="sourceLine" data-line-number="9"></a>  <span class="kw">&lt;/p&gt;</span>
<a id="cb4-10" class="sourceLine" data-line-number="10"></a><span class="kw">&lt;/div&gt;</span></code></pre>
</div>
<p>The styled paragraphs are contained inside a <span class="html-tag">div</span> block styled with the <span class="css-class">.output</span> class.<br />
Having a <span class="html-tag">div</span> as the first element inside the <span class="html-tag">body</span> is a very common programming pattern:</p>
<div id="cb5" class="sourceCode">
<pre class="sourceCode html"><code class="sourceCode html"><a id="cb5-1" class="sourceLine" data-line-number="1"></a><span class="kw">&lt;body&gt;</span>
<a id="cb5-2" class="sourceLine" data-line-number="2"></a>  <span class="kw">&lt;div</span><span class="ot"> class=</span><span class="st">"main"</span><span class="kw">&gt;</span>
<a id="cb5-3" class="sourceLine" data-line-number="3"></a>    A whole bunch of html
<a id="cb5-4" class="sourceLine" data-line-number="4"></a>  <span class="kw">&lt;/div&gt;</span>
<a id="cb5-5" class="sourceLine" data-line-number="5"></a><span class="kw">&lt;/body&gt;</span></code></pre>
</div>
<p>It should be obvious how this can be applied to the previous coding exercise &#8211; instead of styling the <span class="html-tag">body</span> element, you would style the <span class="css-class">.main</span> class.<br />
Before HTML5, many websites had the following basic structure (actually, many websites still use this basic structure):</p>
<div id="cb6" class="sourceCode">
<pre class="sourceCode html"><code class="sourceCode html"><a id="cb6-1" class="sourceLine" data-line-number="1"></a><span class="kw">&lt;body&gt;</span>
<a id="cb6-2" class="sourceLine" data-line-number="2"></a>  <span class="kw">&lt;div</span><span class="ot"> class=</span><span class="st">"main"</span><span class="kw">&gt;</span>
<a id="cb6-3" class="sourceLine" data-line-number="3"></a>
<a id="cb6-4" class="sourceLine" data-line-number="4"></a>    <span class="kw">&lt;div</span><span class="ot"> class=</span><span class="st">"header"</span><span class="kw">&gt;</span>
<a id="cb6-5" class="sourceLine" data-line-number="5"></a>      This section contains the common information
<a id="cb6-6" class="sourceLine" data-line-number="6"></a>      found at the top of the every webpage.
<a id="cb6-7" class="sourceLine" data-line-number="7"></a>
<a id="cb6-8" class="sourceLine" data-line-number="8"></a>      Stuff like the site name and logo.
<a id="cb6-9" class="sourceLine" data-line-number="9"></a>    <span class="kw">&lt;/div&gt;</span>
<a id="cb6-10" class="sourceLine" data-line-number="10"></a>
<a id="cb6-11" class="sourceLine" data-line-number="11"></a>    <span class="kw">&lt;div</span><span class="ot"> class=</span><span class="st">"navigation"</span><span class="kw">&gt;</span>
<a id="cb6-12" class="sourceLine" data-line-number="12"></a>      This is the navigation bar. Sometimes is may
<a id="cb6-13" class="sourceLine" data-line-number="13"></a>      be included in the "header", other times it
<a id="cb6-14" class="sourceLine" data-line-number="14"></a>      is on its own.
<a id="cb6-15" class="sourceLine" data-line-number="15"></a>
<a id="cb6-16" class="sourceLine" data-line-number="16"></a>      If the navigation is common to all pages, then
<a id="cb6-17" class="sourceLine" data-line-number="17"></a>      it should go inside the "header".
<a id="cb6-18" class="sourceLine" data-line-number="18"></a>    <span class="kw">&lt;/div&gt;</span>
<a id="cb6-19" class="sourceLine" data-line-number="19"></a>
<a id="cb6-20" class="sourceLine" data-line-number="20"></a>    <span class="kw">&lt;div</span><span class="ot"> class=</span><span class="st">"content"</span><span class="kw">&gt;</span>
<a id="cb6-21" class="sourceLine" data-line-number="21"></a>      There are, typically, a lot of <span class="kw">&lt;div&gt;</span>s in this
<a id="cb6-22" class="sourceLine" data-line-number="22"></a>      section and quite a lot of complicated structuring
<a id="cb6-23" class="sourceLine" data-line-number="23"></a>      code.
<a id="cb6-24" class="sourceLine" data-line-number="24"></a>    <span class="kw">&lt;/div&gt;</span>
<a id="cb6-25" class="sourceLine" data-line-number="25"></a>
<a id="cb6-26" class="sourceLine" data-line-number="26"></a>    <span class="kw">&lt;div</span><span class="ot"> class=</span><span class="st">"footer"</span><span class="kw">&gt;</span>
<a id="cb6-27" class="sourceLine" data-line-number="27"></a>      This section contains the common information
<a id="cb6-28" class="sourceLine" data-line-number="28"></a>      found at the bottom of the every webpage.
<a id="cb6-29" class="sourceLine" data-line-number="29"></a>
<a id="cb6-30" class="sourceLine" data-line-number="30"></a>      Stuff like the copyright, privacy, contact,
<a id="cb6-31" class="sourceLine" data-line-number="31"></a>      legal terms, small print, etc.
<a id="cb6-32" class="sourceLine" data-line-number="32"></a>  <span class="kw">&lt;/div&gt;</span>
<a id="cb6-33" class="sourceLine" data-line-number="33"></a><span class="kw">&lt;/body&gt;</span></code></pre>
</div>
<p>Using colourful visual styling, it looks something like this:</p>
<div style="background: turquoise; padding: 1em 1em;">
<span style="font-weight: bold;">&lt;body&gt;</span></p>
<div style="background: yellow; padding: 1em 1em;">
<span style="font-weight: bold;">&lt;div class=“main;”&gt;</span><br />
This acts as the outer container for all of the content.</p>
<div style="background: lightblue; padding: 1em 1em;">
<span style="font-weight: bold;">&lt;div class=“header;”&gt;</span><br />
This section contains the common information found at the top of the every webpage.<br />
Stuff like the site name and logo.<br />
<span style="font-weight: bold;">&lt;/div&gt;</span>
</div>
<div style="background: orange; padding: 1em 1em;">
<span style="font-weight: bold;">&lt;div class=“navigation;”&gt;</span><br />
This is the navigation bar. Sometimes is may be included in the “header”, other times it is on its own.<br />
If the navigation is common to all pages, then it should go inside the “header”.<br />
<span style="font-weight: bold;">&lt;/div&gt;</span>
</div>
<div style="background: lightgreen; padding: 1em 1em;">
<span style="font-weight: bold;">&lt;div class=“content;”&gt;</span><br />
There are, typically, a lot of &lt;div&gt;s in this section and quite a lot of complicated structuring code.<br />
<span style="font-weight: bold;">&lt;/div&gt;</span>
</div>
<div style="background: pink; padding: 1em 1em;">
<span style="font-weight: bold;">&lt;div class=“footer;”&gt;</span><br />
This section contains the common information found at the bottom of the every webpage.<br />
Stuff like the copyright, privacy, contact, legal terms, small print, etc.<br />
<span style="font-weight: bold;">&lt;/div&gt;</span>
</div>
<p><span style="font-weight: bold;">&lt;/div&gt;</span>
</div>
<p><span style="font-weight: bold;">&lt;/div&gt;</span>
</div>
<p>By default it is a <strong>block</strong> element, although you can change this with the <span class="css-property">display</span> property. With dynamic pages (using JavaScript), you might toggle the property between <strong>none</strong> and <strong>block</strong> to hide / reveal content. There is no need to change it to <strong>inline</strong> or <strong>inline-block</strong> because that is what <span class="html-tag">span</span> is for.</p>
<h2 id="centering-blocks-using-margin-auto">Centering Blocks Using <span class="css-property">margin: auto;</span></h2>
<p>The easiest way to centre a block element is:</p>
<ul>
<li>give it a width and</li>
<li>set the <span class="css-property">margin</span> to <strong>auto</strong>.</li>
</ul>
<p>This will cause the User Agent (browser) to calculate appropriate margins for the HTML element.<br />
In general, the rules governing <strong>auto</strong> work like this:</p>
<ol type="1">
<li>For inline items, the calculated <strong>auto</strong> margin is always 0px.</li>
<li>For block items, the calculated top and bottom <strong>auto</strong> margin is always 0px.</li>
<li>For block items with a <span class="css-property">box-sizing</span> value of <span class="css-value">content-box</span> with a specified <span class="css-property">width</span>: if the total width of the <em>content + padding + border</em> is less than the width of the container it is in, then equal left and right margins will be applied. Otherwise the margins will be 0px.</li>
<li>For block items with a <span class="css-property">box-sizing</span> value of <span class="css-value">border-box</span> with a specified <span class="css-property">width</span>: if the total width of the element is less than the width of the container it is in, then equal left and right margins will be applied. Otherwise the margins will be 0px.</li>
</ol>
<p>It is most commonly written as:</p>
<div id="cb7" class="sourceCode">
<pre class="sourceCode css"><code class="sourceCode css"><a id="cb7-1" class="sourceLine" data-line-number="1"></a><span class="fu">.centre</span> {
<a id="cb7-2" class="sourceLine" data-line-number="2"></a>  <span class="kw">margin</span>: <span class="dv">auto</span>;
<a id="cb7-3" class="sourceLine" data-line-number="3"></a>}</code></pre>
</div>
<p>Some consider it better to use the 2 parameter version (the order is top and bottom, left and right):</p>
<div id="cb8" class="sourceCode">
<pre class="sourceCode css"><code class="sourceCode css"><a id="cb8-1" class="sourceLine" data-line-number="1"></a><span class="fu">.centre</span> {
<a id="cb8-2" class="sourceLine" data-line-number="2"></a>  <span class="kw">margin</span>: <span class="dv">0</span> <span class="dv">auto</span>;
<a id="cb8-3" class="sourceLine" data-line-number="3"></a>}</code></pre>
</div>
<p>You can also use it in the 4 parameter version (the order is top, right, bottom, left):</p>
<div id="cb9" class="sourceCode">
<pre class="sourceCode css"><code class="sourceCode css"><a id="cb9-1" class="sourceLine" data-line-number="1"></a><span class="fu">.centre</span> {
<a id="cb9-2" class="sourceLine" data-line-number="2"></a>  <span class="kw">margin</span>: <span class="dv">0</span> <span class="dv">auto</span> <span class="dv">0</span> <span class="dv">auto</span>;
<a id="cb9-3" class="sourceLine" data-line-number="3"></a>}</code></pre>
</div>
<p>You can always apply top and bottom margins &#8211; if you like.<br />
If a margin value is 0, it does not need the px suffix. This is true for all measurement units because: <strong>zero means zero.</strong><br />
Applying any of the above styles to a 200px by 200px <span class="html-tag">div</span> element (also styled with a green background), results in:</p>
<div style="background: green; width: 200px; height: 200px; margin: auto;"></div>
<p>Vertical centering is more difficult because HTML elements automatically expand vertically to accommodate content. So, technically, there is no vertical centre of a block element. In future tutorials, we will look at vertically centering content.</p>
<h2 id="summary">Summary</h2>
<ol type="1">
<li><span class="html-tag">span</span> is an <strong>inline</strong> HTML element you can use to style content without giving the content any semantic meaning.</li>
<li><span class="html-tag">div</span> is a <strong>block</strong> HTML element that is used to group together other elements. It has no semantic meaning.</li>
<li>When laying out your HTML document, you should use a <strong><span class="html-tag">div</span>ide and conquer</strong> approach.</li>
<li>Many HTML documents are <span class="html-tag">div</span>ided into <strong>header</strong>, <strong>navigation</strong>, <strong>content</strong>, and <strong>footer</strong> sections.</li>
<li>Applying the <span class="css-property">margin: auto</span> style to a block element will cause it to be horizontally centred inside whatever container it is located &#8211; provided it is smaller than the container.</li>
</ol>
<h2 id="playing-around">Playing Around</h2>
<p>The best way to learn is to play around with what you have learned.<br />
Take the webpage you wrote in the previous exercise and revise it so it uses <span class="html-tag">div</span> elements to structure and contain the content. Also apply the <span class="css-property">margin: auto</span> style to the main container to centre the content. You should notice that when you resize the browser window, the document content remains centred (of course, if you make your browser window smaller than the content width it won’t remain centred).<br />
Knowing about the <span class="html-tag">span</span> element, create a few custom styles and apply it to parts of your document. Experiment with different font size, weights, style, colours, borders, etc.<br />
How would you create the following styles:</p>
<div style="background: white; border: 1px solid black; padding: 0.5em;">
Underline a <span style="border-bottom: 2px solid red;">mistake</span> in red?</p>
<p>Create a space for people to <span style="border-bottom:2px solid black;width:64px;display:inline-block;"> </span> in?</p>
</div>
<h2 id="references">References</h2>
<ul>
<li><a href="https://www.w3.org/TR/html50/text-level-semantics.html#the-span-element">span</a></li>
<li><a href="https://www.w3.org/TR/html50/grouping-content.html#the-div-element">div</a></li>
<li><a href="https://www.w3.org/TR/CSS2/visudet.html#Computing_widths_and_margins">margin: auto</a></li>
</ul>
<div class="prev">
<a href="https://complete-concrete-concise.com/tutorials/webdev/front-end-basics/example-page-where-the-content-is-not-flush-with-the-left-side">Prev</a>
</div>
<div class="next">
<a href="https://complete-concrete-concise.com/tutorials/webdev/front-end-basics/a-page-divided">Next</a>
</div>
<div class="clear"></div>
<section class="footnotes">
<hr />
<ol>
<li id="fn1">You may have noticed I wrote <strong>&amp;lt;p&amp;gt;</strong> as the content inside the <span class="html-tag">span</span>. This is because in HTML, the angle brackets &lt;&gt; are used to identify HTML tags. This means that any time one appears, it is considered to be part of an HTML tag. It can never appear as text or content. To get around this limitation, there are a number of special HTML codes that can be used replace them.All HTML codes begin with an ampersand (<strong>&amp;</strong>) and end with a semicolon (<strong>;</strong>). In between them is a short mnemonic. In this case <strong>lt</strong> and <strong>gt</strong> standing for <strong>less than</strong> and <strong>greater than</strong>.There are lots of codes, although most people only use a handful with <strong>&amp;lt;</strong> and <strong>&amp;gt;</strong> being the most common since they are they only way you can get the angle brackets to display in your content.You can see the whole list <a href="http://w3c.github.io/html/syntax.html#named-character-references">here</a>. Note, the font used for the table is absurdly small.Another common code is &amp; for ampersand (<strong>&amp;</strong>).<a class="footnote-back" href="#fnref1">↩</a></li>
<li id="fn2">Don’t be shy about using the <span class="html-tag">div</span> element. As you will see, it is essential to <strong><span class="html-tag">div</span>ide and conquer!</strong><a class="footnote-back" href="#fnref2">↩</a></li>
</ol>
</section>
<p>The post <a href="https://complete-concrete-concise.com/tutorials/webdev/front-end-basics/sectioning-using-html-and-auto-centering-content/">Sectioning Using HTML and Auto Centering Content</a> appeared first on <a href="https://complete-concrete-concise.com">Complete, Concrete, Concise</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
