{"id":31396,"date":"2017-07-13T03:01:46","date_gmt":"2017-07-12T17:01:46","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=31396"},"modified":"2017-07-12T11:57:54","modified_gmt":"2017-07-12T01:57:54","slug":"html-nested-centering-via-css-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/html-nested-centering-via-css-primer-tutorial\/","title":{"rendered":"HTML Nested Centering via CSS Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/the_vh_explore.html\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"HTML Nested Centering via CSS Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/the_vh_explore.jpg\" title=\"HTML Nested Centering via CSS Primer Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">HTML Nested Centering via CSS Primer Tutorial<\/p><\/div>\n<p>We&#8217;ve talked before about why with our HTML webpage design we so often turn to the HTML <a target=_blank title='HTML table information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_table.asp'><i>table<\/i><\/a> element when it comes to &#8220;precision&#8221; alignment requirements.  We find the HTML table element &#8220;gels&#8221; well with what we grew up to be comfortable with &#8220;geometry wise&#8221;.  Nevertheless, what must be said, is that as you read about the &#8220;net&#8221; regarding webpage design, you will be pointed towards using HTML <a target=_blank title='HTML div information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_div.asp'><i>div<\/i><\/a> elements ahead of the HTML table element, and so we want to dedicate some &#8220;centering&#8221; alignment blog postings that at their &#8220;heart&#8221; use HTML div elements as their centerpiece (<font size=1>boom, boom<\/font>) rather than our &#8220;comfort zone&#8221; tables.<\/p>\n<p>Perhaps a good first read here regarding alignment, as far as inhouse blog postings go, would be to read <a title='HTML\/Javascript\/CSS Reveal Top Left to Bottom Right Tutorial' href='#htmljcssrtlbrt'>HTML\/Javascript\/CSS Reveal Top Left to Bottom Right Tutorial<\/a> below.<\/p>\n<p>Now thinking about this topic, one quite dear to us, as we always go around adjusting mal-aligned pictures on walls, we were encouraged by a recent &#8220;reading something while surfing the net&#8221;, the discovery of which we also used in <a target=_blank href='https:\/\/www.rjmprogramming.com.au\/ITblog\/textarea-width-and-height-control-primer-tutorial\/' title='Textarea Width and Height Control Primer Tutorial'>Textarea Width and Height Control Primer Tutorial<\/a>, about the CSS <a target=_blank href='https:\/\/stackoverflow.com\/questions\/1575141\/make-div-100-height-of-browser-window' title='Useful link'>&#8220;vh&#8221; vertical units<\/a> syntax, that we are keen to &#8220;harness&#8221; because we think we might be able to build a mobile-friendly web application that does not need an &#8220;explicit&#8221; <a target=_blank title='HTML meta tag information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_meta.asp'><i>meta<\/i><\/a> tag <a target=_blank title='Viewport information from w3schools' href='http:\/\/www.w3schools.com\/css\/css_rwd_viewport.asp'>&#8220;viewport&#8221;<\/a> setting.  It&#8217;s not for us any &#8220;war&#8221; against the <i>meta<\/i> &#8220;viewport&#8221; tag as such, but it is just that am a little skeptical of concepts not needed before a certain point of time, and if you tell me of one, I&#8217;d prefer the more &#8220;fundamental&#8221; original approach where this is possible and feasible and sensible &#8230; and just for the purposes of finding out &#8220;if&#8221; something can be done, and that help finding out &#8220;how&#8221; things work.<\/p>\n<p>In this first &#8220;Primer&#8221; (CSS and HTML only) web application blog posting &#8230;<\/li>\n<ul>\n<li>we only use CSS to style nested HTML div elements, along with one &#8220;content&#8221; nested HTML table featuring the colours of the rainbow &#8230; meaning &#8230;<\/li>\n<li>the only properties used within the HTML are <i>id<\/i> properties<\/li>\n<\/ul>\n<p> &#8230; so that the look of the left side of today&#8217;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/the_vh_explore.jpg\" title=\"Tutorial picture\">tutorial picture<\/a> is created via the <b><i>inline CSS<\/i><\/b> (ie. CSS within HTML) &#8230;<\/p>\n<p><code><br \/>\n&lt;!doctype html&gt;<br \/>\n&lt;html&gt;<br \/>\n&lt;head&gt;<br \/>\n&lt;title&gt;The vh Explore - RJM Programming - July, 2017&lt;\/title&gt;<br \/>\n<b>&lt;style&gt;<br \/>\nbody {<br \/>\n  overflow: hidden;<br \/>\n  position: relative;<br \/>\n  margin: 0 0 0 0;<br \/>\n  padding: 0 0 0 0;<br \/>\n  text-align: center;<br \/>\n  vertical-align: middle;<br \/>\n  width: 100%;<br \/>\n  height: 100vh;<br \/>\n  background-color: red;<br \/>\n}<br \/>\n#orange {<br \/>\n  position: relative;<br \/>\n  margin: auto;<br \/>\n  top: 2vh;<br \/>\n  text-align: center;<br \/>\n  vertical-align: middle;<br \/>\n  width: 96%;<br \/>\n  height: 96vh;<br \/>\n  background-color: orange;<br \/>\n}<br \/>\n#yellow {<br \/>\n  margin: auto;<br \/>\n  position: relative;<br \/>\n  text-align: center;<br \/>\n  vertical-align: middle;<br \/>\n  top: 2vh;<br \/>\n  width: 92%;<br \/>\n  height: 92vh;<br \/>\n  background-color: yellow;<br \/>\n}<br \/>\n#green {<br \/>\n  margin: auto;<br \/>\n  position: relative;<br \/>\n  left: 0.5%;<br \/>\n  text-align: center;<br \/>\n  vertical-align: middle;<br \/>\n  top: 2vh;<br \/>\n  width: 88%;<br \/>\n  height: 88vh;<br \/>\n  background-color: green;<br \/>\n}<br \/>\n#blue {<br \/>\n  margin: auto;<br \/>\n  position: relative;<br \/>\n  text-align: center;<br \/>\n  vertical-align: middle;<br \/>\n  top: 2vh;<br \/>\n  width: 84%;<br \/>\n  height: 84vh;<br \/>\n  background-color: blue;<br \/>\n}<br \/>\n#indigo {<br \/>\n  margin: auto;<br \/>\n  position: relative;<br \/>\n  text-align: center;<br \/>\n  vertical-align: middle;<br \/>\n  top: 2vh;<br \/>\n  width: 80%;<br \/>\n  height: 80vh;<br \/>\n  background-color: indigo;<br \/>\n}<br \/>\n#violet {<br \/>\n  margin: auto;<br \/>\n  position: relative;<br \/>\n  text-align: center;<br \/>\n  vertical-align: middle;<br \/>\n  top: 2vh;<br \/>\n  width: 76%;<br \/>\n  height: 76vh;<br \/>\n  background-color: violet;<br \/>\n}<br \/>\n#themiddle {<br \/>\n  position:relative;<br \/>\n  top: 0%;<br \/>\n  text-align: center;<br \/>\n  vertical-align: middle;<br \/>\n  display: table-cell;<br \/>\n}<br \/>\ntable { width:100%; height:100%; }<br \/>\n&lt;\/style&gt;<\/b><br \/>\n&lt;\/head&gt;<br \/>\n&lt;body&gt;<br \/>\n&lt;div id='orange'&gt;<br \/>\n&lt;div id='yellow'&gt;<br \/>\n&lt;div id='green'&gt;<br \/>\n&lt;div id='blue'&gt;<br \/>\n&lt;div id='indigo'&gt;<br \/>\n&lt;div id='violet'&gt;<br \/>\n&lt;table&gt;&lt;tr&gt;&lt;td id='themiddle'&gt;Rainbow Central&lt;\/td&gt;&lt;\/tr&gt;&lt;\/table&gt;<br \/>\n&lt;\/div&gt;<br \/>\n&lt;\/div&gt;<br \/>\n&lt;\/div&gt;<br \/>\n&lt;\/div&gt;<br \/>\n&lt;\/div&gt;<br \/>\n&lt;\/div&gt;<br \/>\n&lt;\/body&gt;<br \/>\n&lt;\/html&gt;<br \/>\n<\/code><\/p>\n<p>Now with styling it is incredibly important to start out correctly, because CSS inherits a lot, so let&#8217;s look at &#8230;<\/p>\n<p><code><br \/>\nbody {<br \/>\n  overflow: hidden;<br \/>\n  position: relative;<br \/>\n  margin: 0 0 0 0;<br \/>\n  padding: 0 0 0 0;<br \/>\n  text-align: center;<br \/>\n  vertical-align: middle;<br \/>\n  width: 100%;<br \/>\n  height: 100vh;<br \/>\n  background-color: red;<br \/>\n}<br \/>\n<\/code><\/p>\n<p> &#8230; and as you can see the <i>height<\/i> &#8220;vh&#8221; is syntax akin to &#8220;%&#8221; is for <i>width<\/i>, as a general principle.  What else is going on here, in layman&#8217;s terms?<\/p>\n<ul>\n<li><i>overflow: hidden;<\/i> is there to see, and it is not immediately obvious with such a simple web application, yet, that scrolling is not necessary<\/li>\n<li><i>position: relative;<\/i> says to position according to HTML elements already &#8220;rendered&#8221; in place<\/li>\n<li><i>margin: 0 0 0 0;<\/i> and <i>padding: 0 0 0 0;<\/i> get rid of any element dimensions not to do with the actual &#8220;rendering&#8221; of the actual &#8220;element&#8221;<\/li>\n<li><i>width: 100%;<\/i> and <i>height: 100vh;<\/i> are the statements to say the document.body (<font size=1>sorry about the Javascript DOM reference, in this CSS only blog posting<\/font>) element show cover the whole web browser window (or screen)<\/li>\n<li><i>text-align: center;<\/i> and <i>vertical-align: middle;<\/i> are the &#8220;centrists&#8221; here, and in what follows, but be warned that the nub of the issue of &#8220;vertical centering&#8221; (of &#8220;content within&#8221; those HTML div elements, in today&#8217;s case) and the use of the CSS property &#8220;vertical-align&#8221; is that many other HTML element types ignore these settings (as far as the &#8220;content within&#8221; goes) &#8230; not so HTML tabular ones!<\/li>\n<\/ul>\n<p>The nested div elements that follow (as colours of the rainbow) all follow a pattern (hint for the Javascript DOM &#8220;sequel&#8221;), so let&#8217;s look at one, and discuss anything new &#8230;<\/p>\n<p><code><br \/>\n#orange {<br \/>\n  position: relative;<br \/>\n  margin: auto;<br \/>\n  top: 2vh;<br \/>\n  text-align: center;<br \/>\n  vertical-align: middle;<br \/>\n  width: 96%;<br \/>\n  height: 96vh;<br \/>\n  background-color: orange;<br \/>\n}<br \/>\n<\/code><\/p>\n<p> &#8230; and guess the first thing to note is the CSS # syntax to flag elements by property <i>id<\/i> so that <i>#orange<\/i> CSS syntax is saying &#8220;match this CSS styling to any HTML element with id=&#8217;orange'&#8221;.  As far as <i>margin: auto;<\/i> goes, <a target=_blank href='https:\/\/stackoverflow.com\/questions\/3170772\/what-does-auto-do-in-margin0-auto' title='Useful link'>this useful webpage<\/a>, thanks, says &#8230;<\/p>\n<blockquote cite='https:\/\/stackoverflow.com\/questions\/3170772\/what-does-auto-do-in-margin0-auto'><p>\nmargin:0 auto;<br \/>\n<b><\/b><br \/>\n0 is for top-bottom and auto for left-right. It means that left and right margin will take auto margin according to the width of the element and the width of the container.<br \/>\n<b><\/b><br \/>\nGenerally if you want to put any element at center position then margin:auto works perfectly. But it only works in block elements.\n<\/p><\/blockquote>\n<p> &#8230; and though we say nothing about &#8220;left&#8221; we do say in all &#8220;nested&#8221; HTML div elements, &#8220;top: 2vh;&#8221; as the &#8220;rainbow colour&#8221; stepping (&#8220;into the nest&#8221;) is 2% (horizontal) and 2vh (vertical) (so far hardcoded &#8230; and hint for the Javascript DOM &#8220;sequel&#8221;).<\/p>\n<p>Which brings us to that little bit of &#8220;Rainbow Central&#8221; text, and it is where that &#8220;vertical-align&#8221; concern mentioned above comes into play.  In practice, we tried HTML <a target=_blank title='HTML span information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_span.asp'><i>span<\/i><\/a> and div elements before settling on &#8230;<\/p>\n<p><code><br \/>\n&lt;table&gt;&lt;tr&gt;&lt;td id='themiddle'&gt;Rainbow Central&lt;\/td&gt;&lt;\/tr&gt;&lt;\/table&gt;<br \/>\n<\/code><\/p>\n<p> &#8230; with its associated CSS styling (note, here, no need for vertical &#8220;vh&#8221; units (in favour of &#8220;%&#8221; everywhere now) any more) &#8230;<\/p>\n<p><code><br \/>\n#themiddle {<br \/>\n  position:relative;<br \/>\n  top: 0%;<br \/>\n  text-align: center;<br \/>\n  vertical-align: middle;<br \/>\n  display: table-cell;<br \/>\n}<br \/>\ntable { width:100%; height:100%; }<br \/>\n<\/code><\/p>\n<p> &#8230; because it appears to us to be very difficult to vertically center &#8220;content within&#8221; elements (within parents defined with CSS styling &#8220;vertical-align: middle;&#8221;) that are not HTML tabular by nature, though we readily admit we may have lots more to learn here.<\/p>\n<p>Anyway, if you want to &#8220;see&#8221; this in action &#8230; and that&#8217;s all you can do, so far &#8230; hint for the Javascript DOM &#8220;sequel&#8221; &#8230; try the HTML\/CSS <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/the_vh_explore.html_GETME\">the_vh_explore.html<\/a> source code&#8217;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/the_vh_explore.html\" title='Click picture'>live run<\/a> link.<\/p>\n<hr>\n<p id='htmljcssrtlbrt'>Previous relevant <a target=_blank title='HTML\/Javascript\/CSS Reveal Top Left to Bottom Right Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/html\/javascript\/css-reveal-top-left-to-bottom-right-tutorial\/'>HTML\/Javascript\/CSS Reveal Top Left to Bottom Right Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/Reveal\/reveal_lefttoright_toptobottom.html\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"HTML\/Javascript\/CSS Reveal Top Left to Bottom Right Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/Reveal\/lrtb_surprise.jpg\" title=\"HTML\/Javascript\/CSS Reveal Top Left to Bottom Right Tutorial\" \/><\/a><p class=\"wp-caption-text\">HTML\/Javascript\/CSS Reveal Top Left to Bottom Right Tutorial<\/p><\/div>\n<p>We need to revisit the <a target=_blank title='Reveal tutorials here' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/reveal'>&#8220;Reveal&#8221;<\/a> series of blog postings, and elaborate a bit.  The reason is that something we were doing yesterday with presenting the top left &#8220;subset&#8221; picture (of the main tutorial picture at the top) you can see at <a target=_blank title='Trip Mobile Device Usage Clock Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/trip-mobile-device-usage-clock-tutorial\/#subsetdiv'>Trip Mobile Device Usage Clock Tutorial<\/a> reminded us of the powerful HTML <a target=_blank title='HTML div element information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_div.asp'>div<\/a> element CSS <a target=_blank title=\"CSS overflow:hidden idea information from w3schools ... thanks\" href=\"http:\/\/www.w3schools.com\/cssref\/pr_pos_overflow.asp\">overflow: hidden;<\/a> style property&#8217;s usefulness.  Hence the reference to a &#8220;Reveal&#8221; tutorial of relevance below called <a title='HTML\/Javascript\/CSS Reveal Top to Bottom Primer Tutorial' href='#hjcrttbpt'>HTML\/Javascript\/CSS Reveal Top to Bottom Primer Tutorial<\/a> as shown below, which is built upon, with its top to bottom revealing talents, to present, today, a reveal from top to bottom and left to right.  You will find with writing this code that all of the previous tutorial&#8217;s &#8230;<\/p>\n<ul>\n<li>CSS <a target=_blank title=\"CSS overflow:hidden idea information from w3schools ... thanks\" href=\"http:\/\/www.w3schools.com\/cssref\/pr_pos_overflow.asp\">overflow: hidden;<\/a> style property<\/li>\n<li>Encasing working visible HTML elements within <a target=_blank title='HTML div information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_div.asp'><i>div<\/i><\/a> element for ease of:\n<ol>\n<li>positioning<\/li>\n<li>scrolling, or not<\/li>\n<li>visibility control<\/li>\n<\/ol>\n<\/li>\n<li>Javascript <a target=_blank href='http:\/\/www.w3schools.com\/jsref\/met_win_setinterval.asp' title='setInterval'>setInterval<\/a> and <a target=_blank href='http:\/\/www.w3schools.com\/jsref\/met_win_clearinterval.asp' title='clearInterval'>clearInterval<\/a> timer functionality<\/li>\n<li>Javascript <a target=_blank href='http:\/\/www.w3schools.com\/js\/js_htmldom.asp' title='Javascript DOM'>DOM<\/a> methods to dynamically change HTML (over time)<\/li>\n<li>HTML\/CSS body element <a target=_blank title='Background information at w3schools ... thanks' href='http:\/\/www.w3schools.com\/css\/css_background.asp'>background<\/a> URL (with fallback background colour) and the Javascript control of its <a target=_blank title='Body backgroundImage URL nullified advice from w3schools ... thanks' href='http:\/\/www.w3schools.com\/jsref\/prop_style_backgroundimage.asp'>fallback<\/a> to just the background colour and that it is Clickable<\/li>\n<\/ul>\n<p> &#8230; remain relevant, and some additional ideas as below &#8230;<\/p>\n<ul>\n<li>There were a lot of those old &#8220;sinful&#8221; <i>align=&#8217;center&#8217;<\/i> usage we talked about at <a target=_blank title='W3C XHTML Nu Checker Validation Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/w3c-xhtml-nu-checker-validation-primer-tutorial\/'>W3C XHTML Nu Checker Validation Primer Tutorial<\/a> going on which we diligently changed to <i>style=&#8221; width:100%;text-align:center; &#8220;<\/i> for most HTML elements, in order to preserve horizontal centering, which meant that &#8230;<\/li>\n<li>Window.<a target=_blank title='Information about Window.getComputedStyle' href='https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Window\/getComputedStyle'>getComputedStyle<\/a> Javascript functionality that is needed to combine with &#8230;<\/li>\n<li>CSS <a target=_blank title=\"CSS overflow:hidden idea information from w3schools ... thanks\" href=\"http:\/\/www.w3schools.com\/cssref\/pr_margin-left.asp\">margin-left<\/a> style property<\/li>\n<li>Events <a target=_blank title='Javascript event onload information from w3schools' href='http:\/\/www.w3schools.com\/tags\/ev_onload.asp'>onload<\/a> helps us out initially and <a target=_blank title='Javascript event onresize information from w3schools' href='http:\/\/www.w3schools.com\/tags\/ev_onresize.asp'>onresize<\/a> helps us out should the window size change to contribute to the document.body width calculation required to derive a good margin-left value to use<\/li>\n<\/ul>\n<p> &#8230; are needed to make the whole thing work.<\/p>\n<p>We hope this is food for thought for you, and we&#8217;ll leave you with &#8230;<\/p>\n<ul>\n<li><a target=_blank href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/Reveal\/reveal_lefttoright_toptobottom.html' title='Click picture'>Live Run<\/a><\/li>\n<li>HTML programming source code you could call <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/Reveal\/reveal_lefttoright_toptobottom.html-GETME' title='reveal_lefttoright_toptobottom.html'>reveal_lefttoright_toptobottom.html<\/a><\/li>\n<li>How we got there from the top to bottom logic of tutorial below can be seen <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/Reveal\/reveal_lefttoright_toptobottom.html-GETME' title='reveal_lefttoright_toptobottom.html'>here<\/a><\/li>\n<\/ul>\n<hr>\n<p id='hjcrttbpt'>Previous relevant <a target=_blank title='HTML\/Javascript\/CSS Reveal Top to Bottom Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/htmljavascriptcss-reveal-top-to-bottom-primer-tutorial\/'>HTML\/Javascript\/CSS Reveal Top to Bottom Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/Reveal\/reveal_fromtoptobottom.html\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"HTML\/Javascript\/CSS Reveal Top to Bottom Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/Reveal\/surprise.jpg\" title=\"HTML\/Javascript\/CSS Reveal Top to Bottom Primer Tutorial\" \/><\/a><p class=\"wp-caption-text\">HTML\/Javascript\/CSS Reveal Top to Bottom Primer Tutorial<\/p><\/div>\n<p>Welcome to a new discussion regarding HTML, Javascript and CSS on the theme of &#8220;reveal&#8221;.  We&#8217;ll be doing several postings on this theme, and today we have the first.<\/p>\n<p>Do you often wish to make webpages that hide things until the user interacts with the webpage or some time period has expired, so that there is some sort of element of surprise?   <\/p>\n<p align='center'>No?<\/p>\n<p>Do you sometimes wish to make webpages that hide things until the user interacts with the webpage or some time period has expired, so that there is some sort of element of surprise?  <\/p>\n<p align='center'>Still no, huh?  (<i>Aside:<\/i> two can play this <font size=1>little<\/font> game)<\/p>\n<p>Do you occasionally wish to make webpages that hide things until the user interacts with the webpage or some time period has expired, so that there is some sort of element of surprise &#8230; OR &#8230; <br \/>will allow those who have <i>never<\/i> had this thought in their life on Earth?  <\/p>\n<p align='center'>No again, huh?  (<i>Aside:<\/i> two planets can play this puerile <font size=1>little<\/font> game!)<\/p>\n<p>Do you ever wish to make webpages that hide things until the user interacts with the webpage or some time period has expired, so that there is some sort of element of surprise &#8230; OR &#8230; <br \/>will allow those who have <i>never<\/i> had this thought in their life on Earth, nor Mars?  <\/p>\n<p align='center'>Non? Nicht?  Good nicht! (chortle, chortle)<\/p>\n<p align='center'>Well, that&#8217;s fixed their <font size=1>little<\/font> <span style='color:red;'>red<\/span> wagon.<\/p>\n<p>Here is a tutorial that &#8220;reveals&#8221; a surprise from top to bottom using HTML, Javascript and CSS, featuring:<\/p>\n<ul>\n<li>CSS <a target=_blank title=\"CSS overflow:hidden idea information from w3schools ... thanks\" href=\"http:\/\/www.w3schools.com\/cssref\/pr_pos_overflow.asp\">overflow: hidden;<\/a> style property<\/li>\n<li>Encasing working visible HTML elements within <a target=_blank title='HTML div information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_div.asp'><i>div<\/i><\/a> element for ease of:\n<ol>\n<li>positioning<\/li>\n<li>scrolling, or not<\/li>\n<li>visibility control<\/li>\n<\/ol>\n<\/li>\n<li>Javascript <a target=_blank href='http:\/\/www.w3schools.com\/jsref\/met_win_setinterval.asp' title='setInterval'>setInterval<\/a> and <a target=_blank href='http:\/\/www.w3schools.com\/jsref\/met_win_clearinterval.asp' title='clearInterval'>clearInterval<\/a> timer functionality<\/li>\n<li>Javascript <a target=_blank href='http:\/\/www.w3schools.com\/js\/js_htmldom.asp' title='Javascript DOM'>DOM<\/a> methods to dynamically change HTML (over time)<\/li>\n<li>HTML\/CSS body element <a target=_blank title='Background information at w3schools ... thanks' href='http:\/\/www.w3schools.com\/css\/css_background.asp'>background<\/a> URL (with fallback background colour) and the Javascript control of its <a target=_blank title='Body backgroundImage URL nullified advice from w3schools ... thanks' href='http:\/\/www.w3schools.com\/jsref\/prop_style_backgroundimage.asp'>fallback<\/a> to just the background colour and that it is Clickable<\/li>\n<\/ul>\n<p>So here is today&#8217;s tutorial&#8217;s <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/Reveal\/reveal_fromtoptobottom.html' title='Click picture'>live run<\/a>, and here is the HTML programming source code you could call <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/Reveal\/reveal_fromtoptobottom.html_GETME' title='reveal_fromtoptobottom.html'>reveal_fromtoptobottom.html<\/a> which called on the content of this <a href='#' onclick=' var huh=prompt(\"Hit OK to open new webpage showing this tutorial.  Am asking because you may not want to reveal this yet (it would give away the secret to the surprise, perhaps?), and if not hit Cancel or wipe out URL and hit OK.\", \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=9389\");  if (huh.indexOf(\"http\") != -1) { window.open(huh,\"_blank\"); } '>tutorial<\/a>.<\/p>\n<p>Chow for now, <font size=1>brown cow (she&#8217;s always on(line), you know &#8230; <b><i>but is anything sinking in?!<\/i><\/b> &#8230; I haven&#8217;t been able to moo respectfully in public after 63.5 lessons?! &#8230; she still owes me that half lesson when she didn&#8217;t get up in time for milking)<\/font>.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d9389' onclick='var dv=document.getElementById(\"d9389\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=DOM\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d9389' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d23394' onclick='var dv=document.getElementById(\"d23394\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/reveal\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d23394' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d31396' onclick='var dv=document.getElementById(\"d31396\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/alignment\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d31396' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>We&#8217;ve talked before about why with our HTML webpage design we so often turn to the HTML table element when it comes to &#8220;precision&#8221; alignment requirements. We find the HTML table element &#8220;gels&#8221; well with what we grew up to &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/html-nested-centering-via-css-primer-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,37],"tags":[72,2073,2262,281,342,1549,576,608,2233,1546,1988,997,2264,2263,1212,1238,1319,1802],"class_list":["post-31396","post","type-post","status-publish","format-standard","hentry","category-elearning","category-tutorials","tag-align","tag-alignment","tag-center","tag-css","tag-div","tag-element","tag-html","tag-inheritance","tag-inline-css","tag-nested","tag-position","tag-programming","tag-rainbow","tag-span","tag-styling","tag-table","tag-tutorial","tag-vertical-align"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/31396"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=31396"}],"version-history":[{"count":10,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/31396\/revisions"}],"predecessor-version":[{"id":31406,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/31396\/revisions\/31406"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=31396"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=31396"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=31396"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}