{"id":53614,"date":"2021-10-13T03:01:51","date_gmt":"2021-10-12T17:01:51","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=53614"},"modified":"2021-10-13T16:54:42","modified_gmt":"2021-10-13T06:54:42","slug":"html-button-element-whitespace-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/html-button-element-whitespace-primer-tutorial\/","title":{"rendered":"HTML Button Element Whitespace Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/button_element_linefeed_whitespace.html\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"HTML Button Element Whitespace Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/button_element_linefeed_whitespace.jpg\" title=\"HTML Button Element Whitespace Primer Tutorial\"    \/><\/a><p class=\"wp-caption-text\">HTML Button Element Whitespace Primer Tutorial<\/p><\/div>\n<p>The topic of &#8220;whitespace&#8221; in webpages is a very big subject for something a lot of us may think of as &#8220;the things that aren&#8217;t the things&#8221;, if you know what I mean?  We talked about it a little with <a title='HTML Whitespace Primer Tutorial' href='#htmlwpt'>HTML Whitespace Primer Tutorial<\/a>, in the past.<\/p>\n<p>Those HTML elements that have a defined &#8220;innerHTML&#8221; attribute, rather than a defined &#8220;value&#8221; attribute or no content type of attribute, are more interesting to us regarding whitespace usage <font size=1>(and yes, the considered usage of whitespace can &#8220;save the aesthetics day&#8221;)<\/font>, and the best element type we can think of in this respect is the HTML button element, because it is interesting to compare (and\/or contrast) it to the HTML input type=button element, as we did at <a target=_blank href='https:\/\/www.rjmprogramming.com.au\/ITblog\/button-versus-input-type-equals-button-primer-tutorial\/' title='Button Versus Input Type Equals Button Primer Tutorial'>Button Versus Input Type Equals Button Primer Tutorial<\/a>.<\/p>\n<p>It is interesting to &#8220;fuse&#8221; the CSS &#8220;white-space&#8221; property with various ways to define &#8220;vertical whitespace&#8221; and even (tab) &#8220;horizontal whitespace&#8221; regarding the &#8220;button&#8221; element &#8220;look&#8221;.  Thanks to some ideas here from <a target=_blank href='https:\/\/www.xul.fr\/en\/css\/white-space.php' title='The white-space CSS property'>The white-space CSS property<\/a>.<\/p>\n<p>And so we are here presenting a proof of concept (<a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/button_element_linefeed_whitespace.html_GETME\" title=\"button_element_linefeed_whitespace.html\">button_element_linefeed_whitespace.html<\/a>) &#8220;button element whitespace&#8221; <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/button_element_linefeed_whitespace.html\" title=\"Click picture\">web application<\/a> for you to peruse, below &#8230;<\/p>\n<p><iframe src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/button_element_linefeed_whitespace.html\" style=\"width:100%;height:900px;\"><\/iframe><\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/html-button-element-whitespace-primer-tutorial\/'>HTML Button Element Whitespace Primer Tutorial<\/a>.<\/p-->\n<hr>\n<p id='htmlwpt'>Previous relevant <a target=_blank title='HTML Whitespace Primer Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/html-whitespace-primer-tutorial\/'>HTML Whitespace 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\/Whitespace.jpg\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"HTML Whitespace Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/Whitespace.jpg\" title=\"HTML Whitespace Primer Tutorial\"    \/><\/a><p class=\"wp-caption-text\">HTML Whitespace Primer Tutorial<\/p><\/div>\n<p>Whitespace in HTML can be a very confusing area for web developers, especially when HTML elements <a target=_blank title='Float CSS information from w3schools' href='http:\/\/www.w3schools.com\/css\/css_float.asp'><i>float<\/i><\/a>.  Even though there are lots of facilities in CSS to overcome the whitespace issues to do with <a target=_blank title='Margin CSS information from w3schools' href='http:\/\/www.w3schools.com\/css\/css_margin.asp'><i>margin<\/i><\/a>, <a target=_blank title='Padding CSS information from w3schools' href='http:\/\/www.w3schools.com\/css\/css_padding.asp'><i>padding<\/i><\/a> and even <a target=_blank title='Border CSS information from w3schools' href='http:\/\/www.w3schools.com\/css\/css_border.asp'><i>border<\/i><\/a> (in a less direct way), lots of times we like the more direct ideas of <a target=_blank href='http:\/\/en.wikipedia.org\/wiki\/WYSIWYG' title='What you see is what you get information from Wikipedia ... thanks'>WYSIWYG<\/a> and try to fix issues just using HTML methods, and this sounds fair enough to me &#8230; but consider the Good Look Vs Bad Look (of <a target=_blank title='HTML Canvas Golf Accuracy Game Primer Tutorial' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=13308'>HTML Canvas Golf Accuracy Game Primer Tutorial<\/a>) below &#8230;<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- Good Look below &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>The HTML <a target=_blank title='HTML Canvas element information from w3schools' href='http:\/\/www.w3schools.com\/tags\/ref_canvas.asp'>Canvas<\/a> element is great for games where you draw your own graphics based on interaction from the user &#8230; a great tool to have in your GUI toolbox &#8230;  <\/p>\n<blockquote class=\"rightbq\"><p>\nyou download an app and start playing.\n<\/p><\/blockquote>\n<p><\/p>\n<p>A lot of the logic of these games stem from when a user clicks on the <i>canvas<\/i> element &#8230; translation:<br \/>\n&nbsp;<\/p>\n<blockquote class=\"rightbq\"><p>\ndon&#8217;t read any rules of the game and just start clicking away <strike>man<\/strike> &#8230; person.\n<\/p><\/blockquote>\n<p><\/p>\n<p>Lots of these games are based on sport  &#8230; translation:<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<\/p>\n<blockquote class=\"rightbq\"><p>\ndoh!  show me the ball!  show me the ball!\n<\/p><\/blockquote>\n<p><\/p>\n<p>And quite often that sport is golf  &#8230; translation:<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<\/p>\n<blockquote class=\"rightbq\"><p>\npass me the plus fours <strike>man<\/strike> &#8230; person &#8230; and forget the rules &#8230; show me the ball!  show me the ball!\n<\/p><\/blockquote>\n<p><\/p>\n<p>Today, if you&#8217;d like to <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/golfshotcanvas.html\">play<\/a>, we get the user to click twice to simulate the start and end position of their golf shot, the direction and size of which is predetermined, and shown to them &#8230; translation:<br \/>\n&nbsp;<\/p>\n<blockquote class=\"rightbq\"><p>\nwhat?!  no ball &#8230; well then, show me the wrestler.\n<\/p><\/blockquote>\n<p><\/p>\n<p>Today we don&#8217;t show a ball, as such &#8230; it&#8217;s too small &#8230; translation:<br \/>\n&nbsp;<br \/>\n&nbsp;<\/p>\n<blockquote class=\"rightbq\"><p>\nwe need this room for another meeting.<br \/>\n&nbsp;\n<\/p><\/blockquote>\n<p><\/p>\n<p>Hope you enjoy playing the game derived from <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/golfshotcanvas.html_GETME\" totle=\"golfshotcanvas.html\">golfshotcanvas.html<\/a> &#8230; you start with score of 3000 and excel by how many goes you survive with a score &#8230; translation: <\/p>\n<blockquote class=\"rightbq\"><p>\nbye.<br \/>\n&nbsp;<br \/>\nturn out the lights as you go.\n<\/p><\/blockquote>\n<p><\/p>\n<p>If you&#8217;re looking for <a target=_blank title='?' href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/faint_grass_pattern_204850.jpg'>grass<\/a> <strike>man<\/strike> &#8230; person &#8230; the free background image came from <a target=_blank href=\"http:\/\/all-free-download.com\/free-photos\/ ... thanks\" title=\"Grass courtesy of http:\/\/all-free-download.com\/free-photos\/ ... thanks\">http:\/\/all-free-download.com\/free-photos\/<\/a> and then was modified for use here via Gimp (good old Gimp &#8230; reduction in Opacity to 40%) &#8230; thanks &#8230; translation:\n<\/p>\n<p><\/p>\n<p>There are night golf ranges you know!!!!<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- Bad Look below &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>The HTML <a target=_blank title='HTML Canvas element information from w3schools' href='http:\/\/www.w3schools.com\/tags\/ref_canvas.asp'>Canvas<\/a> element is great for games where you draw your own graphics based on interaction from the user &#8230; a great tool to have in your GUI toolbox &#8230;  <\/p>\n<blockquote class=\"rightbq\"><p>\nyou download an app and start playing.\n<\/p><\/blockquote>\n<p><\/p>\n<p>A lot of the logic of these games stem from when a user clicks on the <i>canvas<\/i> element &#8230; translation: <\/p>\n<blockquote class=\"rightbq\"><p>\ndon&#8217;t read any rules of the game and just start clicking away <strike>man<\/strike> &#8230; person.\n<\/p><\/blockquote>\n<p><\/p>\n<p>Lots of these games are based on sport  &#8230; translation: <\/p>\n<blockquote class=\"rightbq\"><p>\ndoh!  show me the ball!  show me the ball!\n<\/p><\/blockquote>\n<p><\/p>\n<p>And quite often that sport is golf  &#8230; translation: <\/p>\n<blockquote class=\"rightbq\"><p>\npass me the plus fours <strike>man<\/strike> &#8230; person &#8230; and forget the rules &#8230; show me the ball!  show me the ball!\n<\/p><\/blockquote>\n<p><\/p>\n<p>Today, if you&#8217;d like to <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/golfshotcanvas.html\">play<\/a>, we get the user to click twice to simulate the start and end position of their golf shot, the direction and size of which is predetermined, and shown to them &#8230; translation: <\/p>\n<blockquote class=\"rightbq\"><p>\nwhat?!  no ball &#8230; well then, show me the wrestler.\n<\/p><\/blockquote>\n<p><\/p>\n<p>Today we don&#8217;t show a ball, as such &#8230; it&#8217;s too small &#8230; translation: <\/p>\n<blockquote class=\"rightbq\"><p>\nwe need this room for another meeting.<\/p>\n<\/blockquote>\n<p><\/p>\n<p>Hope you enjoy playing the game derived from <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/golfshotcanvas.html_GETME\" totle=\"golfshotcanvas.html\">golfshotcanvas.html<\/a> &#8230; you start with score of 3000 and excel by how many goes you survive with a score &#8230; translation: <\/p>\n<blockquote class=\"rightbq\"><p>\nbye.<\/p>\n<p>turn out the lights as you go.\n<\/p><\/blockquote>\n<p><\/p>\n<p>If you&#8217;re looking for <a target=_blank title='?' href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/faint_grass_pattern_204850.jpg'>grass<\/a> <strike>man<\/strike> &#8230; person &#8230; the free background image came from <a target=_blank href=\"http:\/\/all-free-download.com\/free-photos\/ ... thanks\" title=\"Grass courtesy of http:\/\/all-free-download.com\/free-photos\/ ... thanks\">http:\/\/all-free-download.com\/free-photos\/<\/a> and then was modified for use here via Gimp (good old Gimp &#8230; reduction in Opacity to 40%) &#8230; thanks &#8230; translation:\n<\/p>\n<p><\/p>\n<p>There are night golf ranges you know!!!!<\/p>\n<p>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; HTML Code Looks Like &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<table>\n<tr>\n<th>Good Look of Code<\/th>\n<th>Bad Look of Code<\/th>\n<\/tr>\n<tr>\n<td>\n<code><br \/>\n&lt;p&gt;Lots of these games are based on sport  ... translation:<br \/>\n&amp;nbsp;<br \/>\n&amp;nbsp;<br \/>\n&amp;nbsp;<br \/>\n&amp;nbsp;<br \/>\n&lt;blockquote class=\"rightbq\"&gt;<br \/>\ndoh!  show me the ball!  show me the ball!<br \/>\n&lt;\/blockquote&gt;<br \/>\n&lt;\/p&gt;<br \/>\n<\/code>\n<\/td>\n<td>\n<code><br \/>\n&lt;p&gt;Lots of these games are based on sport  ... translation:<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&lt;blockquote class=\"rightbq\"&gt;<br \/>\ndoh!  show me the ball!  show me the ball!<br \/>\n&lt;\/blockquote&gt;<br \/>\n&lt;\/p&gt;<br \/>\n<\/code>\n<\/td>\n<\/tr>\n<\/table>\n<p>The only difference between these looks is to do with the use (or not) of <a target=_blank title='Non-breaking space information from Wikipedia ... thanks' href='http:\/\/en.wikipedia.org\/wiki\/Non-breaking_space'><i>non-breaking space<\/i><\/a> (functionality) via the (use of) <a target=_blank href='http:\/\/en.wikipedia.org\/wiki\/Character_encodings_in_HTML' title='HTML entity information from Wikipedia ... thanks'>HTML entity<\/a> <i>&amp;nbsp;<\/i> in the &#8220;Good Look&#8221; version, only &#8230; without resorting to CSS (and only using HTML) and coming across the need to insert a blank line (that takes up space), with the current rendering rules of the web browsers, this is the solution to the problem of lack of whitespace when you need it &#8230; and you guess that if <i>&amp;nbsp;<\/i> has been used a lot and you want less whitespace about, it may be that to substitute the &#8220;<i>&amp;nbsp;<\/i>&#8221; for &#8220;&#8221; solves your problem.<\/p>\n<p>Here is a Wikipedia <a target=_blank title='List of XML and HTML entities at Wikipedia ... thanks' href='http:\/\/en.wikipedia.org\/wiki\/List_of_XML_and_HTML_character_entity_references'>list<\/a> of XML and HTML entities, and we talked a bit about all this with <a target=_blank title='HTML Entities Primer Tutorial' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=6311'>HTML Entities Primer Tutorial<\/a>.<\/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='#d13412' onclick='var dv=document.getElementById(\"d13412\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=html\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d13412' 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='#d53614' onclick='var dv=document.getElementById(\"d53614\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/whitespace\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d53614' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>The topic of &#8220;whitespace&#8221; in webpages is a very big subject for something a lot of us may think of as &#8220;the things that aren&#8217;t the things&#8221;, if you know what I mean? We talked about it a little with &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/html-button-element-whitespace-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":[174,281,576,1525,997,1319,3823,1425],"class_list":["post-53614","post","type-post","status-publish","format-standard","hentry","category-elearning","category-tutorials","tag-button","tag-css","tag-html","tag-innerhtml","tag-programming","tag-tutorial","tag-white-space","tag-whitespace"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/53614"}],"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=53614"}],"version-history":[{"count":8,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/53614\/revisions"}],"predecessor-version":[{"id":53631,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/53614\/revisions\/53631"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=53614"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=53614"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=53614"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}