{"id":68745,"date":"2025-06-20T03:01:00","date_gmt":"2025-06-19T17:01:00","guid":{"rendered":"https:\/\/www.rjmprogramming.com.au\/ITblog\/?p=68745"},"modified":"2025-06-21T14:41:38","modified_gmt":"2025-06-21T04:41:38","slug":"css-background-position-revisit-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/css-background-position-revisit-tutorial\/","title":{"rendered":"CSS Background Position Revisit Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/background_position_various.html\" rel=\"noopener\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"CSS Background Position Revisit Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/background_position_various.png\" title=\"CSS Background Position Revisit Tutorial\" \/><\/a><p class=\"wp-caption-text\">CSS Background Position Revisit Tutorial<\/p><\/div>\n<p>We are great admirers of HTML and CSS regarding the way multiple background images are possible behind an HTML element.<\/p>\n<p>To get to a multiple background image scenario (or even single ones regarding the basis for this blog posting&#8217;s creation), the &#8220;Making Of&#8221; yesterday&#8217;s <a title='AlmaLinux Astronomy via PHP and Python PyEphem Revisit Tutorial' href='#alaphpppert'>AlmaLinux Astronomy via PHP and Python PyEphem Revisit Tutorial<\/a> we thought needed further scrutiny.<\/p>\n<p>It&#8217;s the HTML <a href='#thebq'>blockquote background image<\/a> of <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/Android\/NalaLuna.jpg\" rel=\"noopener\">Nala and Luna<\/a> of most interest, at least to us.  It involved the use of CSS &#8230;<\/p>\n<p><code><br \/>\n<a target=\"_blank\" title='CSS background-position-x property information from W3schools' href='https:\/\/www.w3schools.com\/cssref\/css_pr_background-position-x.php' rel=\"noopener\">background-position-x<\/a>:right;<br \/>\n<\/code><\/p>\n<p> &#8230; property, for our first time, that we can remember <a target=\"_blank\" title='?' href='https:\/\/www.youtube.com\/watch?v=PtR4cWb4HNg' rel=\"noopener\">that is<\/a>.<\/p>\n<p>The blockquote styling did something to our &#8230;<\/p>\n<ol>\n<li>background-size:contain;<\/li>\n<li>background-repeat:no-repeat;\n<\/ol>\n<p> &#8230; &#8220;dynamic duo&#8221;, <a target=\"_blank\" title=\"?\" href='https:\/\/www.youtube.com\/watch?v=e9_7GcQeiqw&#038;t=2m37s' rel=\"noopener\">again<\/a>, property combination, truncating imagery to the right (where Nala and Luna, the stars of the show, were) for the first time we&#8217;ve ever seen.  We were forced to relook at all the background-position type styling properties, and that&#8217;s when we came across background-position-x:right as a way to get &#8220;the stars&#8221; back into the picture.<\/p>\n<p>From there, we thought it might be good to write a proof of concept textarea based showing of the styling of that blockquote element involved, and allow the user to modify it either &#8230;<\/p>\n<ul>\n<li>within the textarea element, on tabbing out of it &#8230; or via &#8230;<\/li>\n<li>some set dropdown alternative CSS property suggestions &#8230; and in amongst those dropdown options, via &#8230;<\/li>\n<li>enter user CSS properties of interest<\/li>\n<\/ul>\n<p> &#8230; to see, dynamically, what happens to the WordPress styling conditioned blockquote rendition above the form, to confirm what your CSS would do, using <a target=\"_blank\" href='https:\/\/www.rjmprogramming.com.au\/HTMLCSS\/background_position_various.html_GETME' rel=\"noopener\">our &#8220;first draft&#8221;<\/a> <a target=\"_blank\" href='https:\/\/www.rjmprogramming.com.au\/HTMLCSS\/background_position_various.html' rel=\"noopener\">web application<\/a> also shown below &#8230;<\/p>\n<p><iframe src='\/\/www.rjmprogramming.com.au\/HTMLCSS\/background_position_various.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\/new-almalinux-astronomy-via-php-and-python-pyephem-revisit-tutorial\/' rel=\"noopener\">New AlmaLinux Astronomy via PHP and Python PyEphem Revisit Tutorial<\/a>.<\/p-->\n<hr>\n<p id='alaphpppert'>Previous relevant <a target=\"_blank\" title='AlmaLinux Astronomy via PHP and Python PyEphem Revisit Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/almalinux-astronomy-via-php-and-python-pyephem-revisit-tutorial\/' rel=\"noopener\">AlmaLinux Astronomy via PHP and Python PyEphem Revisit Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/ephem_astronomy.php\" rel=\"noopener\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"AlmaLinux Astronomy via PHP and Python PyEphem Revisit Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/almalinux_astronomy_revisit.gif\" title=\"AlmaLinux Astronomy via PHP and Python PyEphem Revisit Tutorial\" \/><\/a><p class=\"wp-caption-text\">AlmaLinux Astronomy via PHP and Python PyEphem Revisit Tutorial<\/p><\/div>\n<p>Further to <a title='AlmaLinux Astronomy via PHP and Python PyEphemx Tutorial' href='#alaphpppet'>AlmaLinux Astronomy via PHP and Python PyEphem Tutorial<\/a> &#8230;<\/p>\n<ul>\n<li>these days RJM Programming is still on AlmaLinux &#8230;<\/li>\n<li>but on a different IP address and web server to that previous blog posting &#8230;<\/li>\n<li>but PHP versions have not changed, or not enough to cause any consternation &#8230; hence the &#8220;relative silence&#8221; on our part about it all<\/li>\n<\/ul>\n<p> &#8230; but, even so, &#8220;things can go wrong&#8221;, and on a revisit to our <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/ephem_astronomy.php\" rel=\"noopener\">Astronomy<\/a> web application &#8220;things went wrong&#8221; &#8230;<\/p>\n<blockquote id=thebq style=\"background-image:linear-gradient(rgba(255,255,255,0.3),rgba(255,255,255,0.3)),url('\/Android\/NalaLuna.jpg');background-size:contain;background-repeat:no-repeat;background-position-x:right;\">\n<p>Who&#8217;d have thought it?!<\/p>\n<\/blockquote>\n<p>One of the potential issues was resolved with <a target=\"_blank\" href='https:\/\/www.rjmprogramming.com.au\/ITblog\/code-difference-almalinux-new-webserver-issue-tutorial\/' title='Code Difference AlmaLinux New Webserver Issue Tutorial' rel=\"noopener\">Code Difference AlmaLinux New Webserver Issue Tutorial<\/a> allowing for exec and shell_exec usage, for which we thank our web hosters, <a target=\"_blank\" title='Crazy Domains' href='http:\/\/www.crazydomains.com.au' rel=\"noopener\">Crazy Domains<\/a>.  There are other players in this astronomy web application though, they being &#8230;<\/p>\n<ul>\n<li>Python &#8230; called via PHP exec &#8230; calling &#8230;<\/li>\n<li><a target=\"_blank\" title='PyEphem ... thanks' href='\/\/rhodesmill.org\/pyephem\/' rel=\"noopener\">PyEphem<\/a> module <font size=1>(most importantly)<\/font><\/li>\n<\/ul>\n<p> &#8230; and the investigation should start at <i>Python<\/i> to our mind.  Our initial investigation into <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/ephem_astronomy.php---GETME\" rel=\"noopener\">ephem_astronomy.php<\/a> code first looking for a path through to Python at &#8230;<\/p>\n<p><code><br \/>\n\/usr\/bin\/python<br \/>\n<\/code><\/p>\n<p> &#8230; and we saw the difference in Terminal sessions asking three things of our two web servers &#8230;<\/p>\n<table style=vertical-align:top;>\n<tr>\n<th>Web server<\/th>\n<th>The ask &#8230;<\/th>\n<th>The result is &#8230;<\/th>\n<\/tr>\n<tr>\n<td style=vertical-align:top;>Old<\/td>\n<td style=vertical-align:top;>which python<\/td>\n<td>\/bin\/python<\/td>\n<\/tr>\n<tr>\n<td style=vertical-align:top;>New<\/td>\n<td style=vertical-align:top;>which python<\/td>\n<td>\/usr\/bin\/which: no python in ([new web server&#8217;s path for root account])<\/td>\n<\/tr>\n<tr>\n<td style=vertical-align:top;>Old<\/td>\n<td style=vertical-align:top;>which python3<\/td>\n<td>\/bin\/python3<\/td>\n<\/tr>\n<tr>\n<td style=vertical-align:top;>New<\/td>\n<td style=vertical-align:top;>which python3<\/td>\n<td>\/bin\/python3<\/td>\n<\/tr>\n<tr>\n<td style=vertical-align:top;>Old<\/td>\n<td style=vertical-align:top;>ls -la \/usr\/bin\/python*<\/td>\n<td>\n<code><br \/>\nlrwxrwxrwx 1 root root     9 Mar 12 03:06 \/usr\/bin\/python -&gt; .\/python3<br \/>\nlrwxrwxrwx 1 root root     9 Mar 12 03:00 \/usr\/bin\/python3 -&gt; python3.9<br \/>\n-rwxr-xr-x 1 root root 15624 Mar 12 03:00 \/usr\/bin\/python3.9<br \/>\n-rwxr-xr-x 1 root root    61 Mar 12 03:00 \/usr\/bin\/python3.9-config<br \/>\n-rwxr-xr-x 1 root root  3624 Mar 12 02:53 \/usr\/bin\/python3.9-x86_64-config<br \/>\nlrwxrwxrwx 1 root root    16 Mar 12 03:00 \/usr\/bin\/python3-config -&gt; python3.9-config<br \/>\n-rwxr-xr-x 1 root root   980 Mar 26  2022 \/usr\/bin\/python3-html2text<br \/>\nlrwxrwxrwx 1 root root    16 Mar 12 03:00 \/usr\/bin\/python-config -&gt; .\/python3-config<br \/>\nlrwxrwxrwx 1 root root    17 Mar 26  2022 \/usr\/bin\/python-html2text -&gt; python3-html2text<br \/>\n<\/code>\n<\/td>\n<\/tr>\n<tr>\n<td style=vertical-align:top;>New<\/td>\n<td style=vertical-align:top;>ls -la \/usr\/bin\/python*<\/td>\n<td>\n<code style=background-color:yellow;><br \/>\nlrwxrwxrwx 1 root root    16 Mar 12 03:00 \/usr\/bin\/python-config -&gt; .\/python3-config<br \/>\nlrwxrwxrwx 1 root root    17 Mar 26  2022 \/usr\/bin\/python-html2text -&gt; python3-html2text<br \/>\nlrwxrwxrwx 1 root root     9 Mar 12 03:00 \/usr\/bin\/python3 -&gt; python3.9<br \/>\nlrwxrwxrwx 1 root root    16 Mar 12 03:00 \/usr\/bin\/python3-config -&gt; python3.9-config<br \/>\n-rwxr-xr-x 1 root root   980 Mar 26  2022 \/usr\/bin\/python3-html2text<br \/>\n-rwxr-xr-x 1 root root 15624 Mar 12 03:00 \/usr\/bin\/python3.9<br \/>\n-rwxr-xr-x 1 root root    61 Mar 12 03:00 \/usr\/bin\/python3.9-config<br \/>\n-rwxr-xr-x 1 root root  3624 Mar 12 02:53 \/usr\/bin\/python3.9-x86_64-config<br \/>\n<\/code>\n<\/td>\n<\/tr>\n<\/table>\n<p> &#8230; and so, after doing the research regarding our question &#8230;<\/p>\n<blockquote><p>\n<a target=\"_blank\" title='On linux is there a better way out of alias versus soft link to solve a path based issue?' href='https:\/\/www.google.com\/search?q=On+linux+is+there+a+better+way+out+of+alias+versus+soft+link+to+solve+a+path+based+issue%3F&#038;oq=On+linux+is+there+a+better+way+out+of+alias+versus+soft+link+to+solve+a+path+based+issue%3F&#038;gs_lcrp=EgZjaHJvbWUyBggAEEUYOTIHCAEQIRiPAjIHCAIQIRiPAtIBCjQ1NzE3ajBqMTWoAgCwAgA&#038;sourceid=chrome&#038;ie=UTF-8#cobssid=s' rel=\"noopener\">On linux is there a better way out of alias versus soft link to solve a path based issue?<\/a>\n<\/p><\/blockquote>\n<p> &#8230; giving the <a target=\"_blank\" title='Google AI Overview information' href='https:\/\/search.google\/ways-to-search\/ai-overviews\/' rel=\"noopener\">Google AI Overview<\/a>, thanks, answer &#8230;<\/p>\n<blockquote><p>\nFor solving path-based issues in Linux, symbolic links are generally better than aliases. Aliases are shell-specific and don&#8217;t offer the same level of system-wide functionality as symbolic links. Symbolic links, or symlinks, act as references to files or directories within the file system, making them a more robust and versatile solution for path-related problems.\n<\/p><\/blockquote>\n<p> &#8230; we think points to <a target=\"_blank\" href='https:\/\/unix.stackexchange.com\/questions\/250034\/equivalent-of-alias-for-a-symbolic-link' title='Equivalent of alias for a symbolic link' rel=\"noopener\">Equivalent of alias for a symbolic link<\/a> and fitting in with our preferences, too, getting us in Terminal on the new web server to go &#8230;<\/p>\n<p><code><br \/>\n$ cd \/usr\/bin<br \/>\n$ ln -s .\/python3.9 .\/python<br \/>\n<\/code><\/p>\n<p> &#8230; to end up with &#8230;<\/p>\n<p><code style=background-color:lightgreen;><br \/>\n$ ls -la \/usr\/bin\/python*<br \/>\nlrwxrwxrwx 1 root root    11 Jun 18 07:54 \/usr\/bin\/python -> .\/python3.9<br \/>\nlrwxrwxrwx 1 root root    16 Mar 12 03:00 \/usr\/bin\/python-config -> .\/python3-config<br \/>\nlrwxrwxrwx 1 root root    17 Mar 26  2022 \/usr\/bin\/python-html2text -> python3-html2text<br \/>\nlrwxrwxrwx 1 root root     9 Mar 12 03:00 \/usr\/bin\/python3 -> python3.9<br \/>\nlrwxrwxrwx 1 root root    16 Mar 12 03:00 \/usr\/bin\/python3-config -> python3.9-config<br \/>\n-rwxr-xr-x 1 root root   980 Mar 26  2022 \/usr\/bin\/python3-html2text<br \/>\n-rwxr-xr-x 1 root root 15624 Mar 12 03:00 \/usr\/bin\/python3.9<br \/>\n-rwxr-xr-x 1 root root    61 Mar 12 03:00 \/usr\/bin\/python3.9-config<br \/>\n-rwxr-xr-x 1 root root  3624 Mar 12 02:53 \/usr\/bin\/python3.9-x86_64-config<br \/>\n$ which python<br \/>\n\/bin\/python<br \/>\n<\/code><\/p>\n<p> &#8230; and a better functioning <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/ephem_astronomy.php\" rel=\"noopener\">Astronomy<\/a> web application, as well as the chance other PHP calling Python scenarios being fixed, ahead of (web application and PHP and Python code) revisits, there and then.  However, if all this sounds trepidacious, or impossible (lots of web hosting would not allow you anywhere close to &#8220;underlying Operating System anything&#8221;), or your server does not support Soft (ie. Symbolic) Links (eg. Windows) you could <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/ephem_astronomy.php----GETME\" rel=\"noopener\">change this way<\/a> the <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/ephem_astronomy.php----GETME\" rel=\"noopener\">ephem_astronomy.php<\/a> PHP code to fit with the original environment ahead of creating that new Soft (ie. Symbolic) Link used in that inhouse <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/ephem_astronomy.php\" rel=\"noopener\">Astronomy<\/a> PHP calling Python module web application.<\/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\/almalinux-astronomy-via-php-and-python-pyephem-revisit-tutorial\/' rel=\"noopener\">AlmaLinux Astronomy via PHP and Python PyEphem Revisit Tutorial<\/a>.<\/p-->\n<hr>\n<p id='alaphpppet'>Previous relevant <a target=\"_blank\" title='AlmaLinux Astronomy via PHP and Python PyEphem Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/almalinux-astronomy-via-php-and-python-pyephem-tutorial\/' rel=\"noopener\">AlmaLinux Astronomy via PHP and Python PyEphem Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/ephem_astronomy.php\" rel=\"noopener\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"AlmaLinux Astronomy via PHP and Python PyEphem Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/almalinux_astronomy.gif\" title=\"AlmaLinux Astronomy via PHP and Python PyEphem Tutorial\" \/><\/a><p class=\"wp-caption-text\">AlmaLinux Astronomy via PHP and Python PyEphem Tutorial<\/p><\/div>\n<p>You might recall reading the previous <a title='PHP\/Javascript\/HTML and Python PyEphem Moon Angle Tutorial' href='#php\/j\/htmlppemat'>PHP\/Javascript\/HTML and Python PyEphem Moon Angle Tutorial<\/a> below how we got into some Astronomy via &#8230;<\/p>\n<ul>\n<li>PHP &#8230; calling, via <a target=\"_blank\" title='PHP exec() method information' href='http:\/\/php.net\/manual\/en\/function.exec.php' rel=\"noopener\">exec<\/a> &#8230;<\/li>\n<li>Python &#8230; (alas, no <a target=\"_blank\" title=\"The Three P's tutorials\" href='https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/the-three-ps\/' rel=\"noopener\">3P&#8217;s<\/a> Perl here) &#8230; and it&#8217;s &#8230;<\/li>\n<li><a target=\"_blank\" title='PyEphem ... thanks' href='\/\/rhodesmill.org\/pyephem\/' rel=\"noopener\">PyEphem<\/a> &#8230; module skilled at Astronomy &#8230; installed via &#8230;<\/li>\n<li><a target=\"_blank\" title='Pip package manager information from Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/Pip_(package_manager)' rel=\"noopener\">Pip<\/a> &#8230; (alas, no <a target=\"_blank\" title='?' href='https:\/\/en.wikipedia.org\/wiki\/Pip_(Great_Expectations)#:~:text=At%20around%20the%20age%20of,and%20his%20coarse%2Dseeming%20relatives.' rel=\"noopener\">Estella<\/a>)\n<\/ul>\n<p> &#8230; so from that &#8230; let&#8217;s see &#8230; we get The Four <strike style=color:red;><a target=\"_blank\" title='?' href='https:\/\/www.youtube.com\/watch?v=_d8eFTfGb00' rel=\"noopener\">Tops<\/a><\/strike><strike style=color:orange;><a target=\"_blank\" title='?' href='https:\/\/www.youtube.com\/watch?v=ABTPhL_Ys7Q' rel=\"noopener\">Pips<\/a><\/strike>P&#8217;s <font size=1>(in relation to <a target=\"_blank\" title='?' href='https:\/\/www.barossanursery.com.au\/gardening-old-wives-tales-fact-of-fiction\/#:~:text=%E2%80%9CPeeing%20on%20your%20lemon%20tree,A%20natural%20and%20cheap%20fertiliser!' rel=\"noopener\">lemon trees<\/a> &#8230; tee hee)<\/font>.<\/p>\n<p>Well, to make Moon Angles and Astronomy Helper web applications work on AlmaLinux we needed to attend to a couple of install matters &#8230;<\/p>\n<ul>\n<li>install the Python package manager <a target=\"_blank\" title='Pip package manager information from Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/Pip_(package_manager)' rel=\"noopener\">Pip<\/a> via (the AlmaLinux PHP <i>dnf<\/i> package manager) &#8230;<br \/>\n<code><br \/>\ndnf install python3-pip.noarch<br \/>\n<\/code>\n<\/li>\n<li>install the Python module, helping out with Astronomy matters, called <a target=\"_blank\" title='PyEphem ... thanks' href='\/\/rhodesmill.org\/pyephem\/' rel=\"noopener\">PyEphem<\/a> via &#8230;<br \/>\n<code><br \/>\nsudo pip install pyephem<br \/>\n<\/code>\n<\/li>\n<\/ul>\n<p> &#8230; to be in a position to progress, and then add a check for existence of \/usr\/bin\/python (for AlmaLinux) in preference to \/usr\/local\/bin\/python3.3 (for CentOS) as the final measure needed to start getting results back to any PHP overseers &#8230;<\/p>\n<ul>\n<li><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/MoonAngle\/moon_angle_now_at.php-------GETME\" title=\"Click picture\" rel=\"noopener\">a changed<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/MoonAngle\/moon_angle_now_at.php-------GETME\" title=\"Click picture\" rel=\"noopener\">moon_angle_now_at.php<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/MoonAngle\/moon_angle_now_at.php\" title=\"Click picture\" rel=\"noopener\">Moon Angle live run (old way)<\/a> or <a target=\"_blank\" href=\"https:\/\/65.254.95.247\/PHP\/MoonAngle\/moon_angle_now_at.php\" title=\"Click picture\" rel=\"noopener\">Moon Angle live run (new way)<\/a><\/li>\n<li><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/ephem_astronomy.php---GETME\" title=\"Click picture\" rel=\"noopener\">a changed<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/ephem_astronomy.php---GETME\" title=\"Click picture\" rel=\"noopener\">ephem_astronomy.php<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/ephem_astronomy.php\" title=\"Click picture\" rel=\"noopener\">Astronomy Helper live run (old way)<\/a> or <a target=\"_blank\" href=\"https:\/\/65.254.95.247\/PHP\/ephem_astronomy.php\" title=\"Click picture\" rel=\"noopener\">Astronomy Helper live run (new way)<\/a><\/li>\n<\/ul>\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\/almalinux-astronomy-via-php-and-python PyEphem-tutorial\/' rel=\"noopener\">AlmaLinux Astronomy via PHP and Python PyEphem Tutorial<\/a>.<\/p-->\n<hr>\n<p id='php\/j\/htmlppemat'>Previous relevant <a target=\"_blank\" title='PHP\/Javascript\/HTML and Python PyEphem Moon Angle Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/php\/javascript\/html-and-python-pyephem-moon-angle-tutorial\/' rel=\"noopener\">PHP\/Javascript\/HTML and Python PyEphem Moon Angle Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/MoonAngle\/moon_angle_now_at.php\" rel=\"noopener\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"PHP\/Javascript\/HTML and Python PyEphem Moon Angle Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/MoonAngle\/MoonAnglePython.jpg\" title=\"PHP\/Javascript\/HTML and Python PyEphem Moon Angle Tutorial\" \/><\/a><p class=\"wp-caption-text\">PHP\/Javascript\/HTML and Python PyEphem Moon Angle Tutorial<\/p><\/div>\n<p>A long time ago now we presented <a title='PHP\/Javascript\/HTML Moon Angle Tutorial' href='#phpjhtmlmat'>PHP\/Javascript\/HTML Moon Angle Tutorial<\/a> but now we feel is a good time for it to get a makeover.  Why is that?  Well, we have the relatively new discovery of the very useful Python <a target=\"_blank\" title='PyEphem ... thanks' href='\/\/rhodesmill.org\/pyephem\/' rel=\"noopener\">PyEphem<\/a> module to thank for that.<\/p>\n<p>As far as the new version goes we now offer a Moon Angle &#8220;time of transit (and relative to now)&#8221; calculation, which we think will be of more use to users.<\/p>\n<p>The Moon Angle at Transit calculations again involve the <a target=\"_blank\" title='Sublunary Point' href='http:\/\/translate.google.com.au\/translate?hl=en&#038;sl=de&#038;u=http:\/\/de.wikipedia.org\/wiki\/Sublunarer_Punkt&#038;prev=\/search%3Fq%3D%2522Sublunarer%2522%2Bwikipedia%26client%3Dfirefox-a%26hs%3D3co%26rls%3Dorg.mozilla:en-US:official%26biw%3D1213%26bih%3D619' rel=\"noopener\">Sublunary Point<\/a> as the position on Earth directly above which is Moon is located.  Add in the Python PyEphem work and some more terminology that may interest you could involve &#8230;<\/p>\n<ul>\n<li><a target=\"_blank\" title='Sidereal time information from Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/Sidereal_time' rel=\"noopener\">sidereal time<\/a><\/li>\n<li><a target=\"_blank\" title='UTC information from Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/Coordinated_Universal_Time' rel=\"noopener\">Coordinated Universal Time &#8230; or UTC<\/a><\/li>\n<li><a target=\"_blank\" title='Transit information from Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/Transit_(astronomy)' rel=\"noopener\">transit<\/a><\/li>\n<\/ul>\n<p> &#8230; within the Python of interest, a snapshot of which is shown below, but which changes each time somebody recreates this <a target=\"_blank\" title='sublunarx.py' href='http:\/\/www.rjmprogramming.com.au\/Python\/sublunarx.py' rel=\"noopener\">sublunarx.py<\/a> &#8230;<\/p>\n<p><code><br \/>\nimport ephem<br \/>\nimport math<br \/>\nimport time<br \/>\nfrom datetime import datetime, timedelta<br \/>\ngreenwich = ephem.Observer()<br \/>\ngreenwich.lat = \"0\"<br \/>\ngreenwich.lon = \"0\"<br \/>\ngreenwich.date = datetime.utcnow()<br \/>\nmoon = ephem.Moon(greenwich)<br \/>\nmoon.compute(greenwich.date)<br \/>\nmoon_lon = math.degrees(moon.ra - greenwich.sidereal_time() )<br \/>\nif moon_lon &lt; -180.0 :<br \/>\n  moon_lon = 360.0 + moon_lon<br \/>\nelif moon_lon &gt; 180.0 :<br \/>\n  moon_lon = moon_lon - 360.0<br \/>\nmoon_lat = math.degrees(moon.dec)<br \/>\nd1 = ephem.next_full_moon(greenwich.date)<br \/>\nd2 = ephem.next_new_moon(greenwich.date)<br \/>\ngreenwich.lat = \"151:10.586502000000001\"<br \/>\ngreenwich.lon = \"-33:54.445878\"<br \/>\ngreenwich.date = datetime.utcnow()<br \/>\nmoon = ephem.Moon(greenwich)<br \/>\nmoon.compute(greenwich.date)<br \/>\nbetw = (greenwich.next_transit(moon) - greenwich.date) * 86400.0 \/ 60.0 \/ 60.0<br \/>\ngnt = greenwich.next_transit(moon)<br \/>\ngreenwich.date = gnt<br \/>\nmoon = ephem.Moon(greenwich)<br \/>\nmoon.compute(gnt)<br \/>\nmoon_lon_x = math.degrees(moon.ra - greenwich.sidereal_time() )<br \/>\nif moon_lon_x &lt; -180.0 :<br \/>\n  moon_lon_x = 360.0 + moon_lon_x<br \/>\nelif moon_lon_x &gt; 180.0 :<br \/>\n  moon_lon_x = moon_lon_x - 360.0<br \/>\nmoon_lat_y = math.degrees(moon.dec)<br \/>\nprint('%s %s %s %s %s %s %s %f' % (moon_lon, moon_lat, d1, d2, gnt, moon_lon_x, moon_lat_y, betw))<br \/>\nquit()<br \/>\n<\/code><\/p>\n<p>The Moon Angle web application <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/MoonAngle\/moon_angle_now_at.php\" title=\"Click picture\" rel=\"noopener\">live run<\/a>, which we welcome you to try, has the underlying PHP <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/MoonAngle\/moon_angle_now_at.php------GETME\" itle=\"moon_angle_now_at.php\" rel=\"noopener\">moon_angle_now_at.php<\/a> that supervises the Python exemplied above, and which featured <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/MoonAngle\/moon_angle_now_at.php------GETME\" itle=\"moon_angle_now_at.php\" rel=\"noopener\">these changes<\/a> to make this happen.<\/p>\n<hr>\n<p id='phpjhtmlmat'>Previous relevant <a target=\"_blank\" title='PHP\/Javascript\/HTML Moon Angle Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/php\/javascript\/html-moon-angle-tutorial\/' rel=\"noopener\">PHP\/Javascript\/HTML Moon Angle Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/MoonAngle\/moon_angle_now_at.php\" rel=\"noopener\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"PHP\/Javascript\/HTML Moon Angle Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/MoonAngle\/MoonAngle.jpg\" title=\"PHP\/Javascript\/HTML Moon Angle Tutorial\" \/><\/a><p class=\"wp-caption-text\">PHP\/Javascript\/HTML Moon Angle Tutorial<\/p><\/div>\n<p>Here is a tutorial that calculates Noon Moon Angles from Earth via the entry of Latitude and Longitude.  The calculation of noon moon angles uses the concept of Sublunary Point, which is explained in the quote from Wikipedia below.<\/p>\n<blockquote><p>The sublunary point (Latin sub-lunar, under the moon &#8216;, from Latin) is the one place on earth where the moon in exactly the zenith is. He is the point where the line connecting the centers of the Earth and Moon intersects the Earth&#8217;s surface. The point is a common auxiliary point to observe the Moon in the celestial mechanics and astronomical phenomenology , and in particular the theory of the tides , as well as the theory of eclipses .<\/p>\n<p>The calculation of the point corresponding to the determination of the geocentric coordinates of the Moon, it has the same longitude and latitude , as the moon astronomical length and width has &#8211; both are denoted by \u03c6 and \u03b2. <\/p><\/blockquote>\n<p>The Javascript embellishments in this tutorial mainly revolve around:<\/p>\n<ul>\n<li><a target=\"_blank\" title='window.open' href='http:\/\/www.w3schools.com\/jsref\/met_win_open.asp' rel=\"noopener\">window.open<\/a><\/li>\n<\/ul>\n<p>The use of window.open can sometimes be blocked by web browsers depending on their settings and you can read a bit more about such issues <a target=\"_blank\" title='pop-up windows' href='http:\/\/en.wikipedia.org\/wiki\/Pop-up_ad' rel=\"noopener\">here<\/a>.<\/p>\n<p>Useful tutorials that helped, and we give thanks to, were:<\/p>\n<ul>\n<li><a target=\"_blank\" title='Sublunary Point' href='http:\/\/translate.google.com.au\/translate?hl=en&#038;sl=de&#038;u=http:\/\/de.wikipedia.org\/wiki\/Sublunarer_Punkt&#038;prev=\/search%3Fq%3D%2522Sublunarer%2522%2Bwikipedia%26client%3Dfirefox-a%26hs%3D3co%26rls%3Dorg.mozilla:en-US:official%26biw%3D1213%26bih%3D619' rel=\"noopener\">Sublunary Point<\/a> (information from Wikipedia, from where quote above comes)<\/li>\n<li><a target=\"_blank\" title='Sublunary Point calculator helper' href='http:\/\/www.timeanddate.com\/worldclock\/sunearth.html' rel=\"noopener\">Sublunary Point calculator helper<\/a> via <a target=\"_blank\" title='cURL in PHP and command line' href='http:\/\/php.net\/manual\/en\/book.curl.php' rel=\"noopener\">cURL<\/a><\/li>\n<li><a target=\"_blank\" title='Moon Phase calculator helper' href='http:\/\/www.zodiacarts.com\/Calendar.shtml' rel=\"noopener\">Moon Phase calculator helper<\/a> via <a target=\"_blank\" title='cURL in PHP and command line' href='http:\/\/php.net\/manual\/en\/book.curl.php' rel=\"noopener\">cURL<\/a><\/li>\n<li><a target=\"_blank\" title='Sun Angle formulae applied to the case of the Moon Sublunary Point' href='http:\/\/www.google.com.au\/url?sa=t&#038;rct=j&#038;q=&#038;esrc=s&#038;source=web&#038;cd=1&#038;ved=0CC8QFjAA&#038;url=http%3A%2F%2Fgeoalliance.asu.edu%2Fazga_site%2Fsites%2Fdefault%2Ffiles%2FLessonFiles%2FDorn%2FPulse%2FDornPulse.ppt&#038;ei=QTGRUuiXEcGtiAfwlIGICw&#038;usg=AFQjCNEYL6f1yBLg5hdC5qgYnnfWS00nOg&#038;sig2=2kQ25M8OoDltE6baNCRlnQ&#038;bvm=bv.56988011,d.aGc' rel=\"noopener\">Sun Angle formulae applied to the case of the Moon Sublunary Point<\/a><\/li>\n<li><a target=\"_blank\" title='Sydney positioning' href='http:\/\/stutzfamily.com\/mrstutz\/LatLong\/latlonglist.htm#AUSTRALIA' rel=\"noopener\">Sydney positioning<\/a><\/li>\n<li><a target=\"_blank\" title='CSS 2D Transformation Rotations' href='http:\/\/www.w3schools.com\/css\/css3_2dtransforms.asp' rel=\"noopener\">CSS 2D Transformation Rotations<\/a><\/li>\n<\/ul>\n<p>Here is a link to a <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/MoonAngle\/moon_angle_now_at.php\" title='Live run' rel=\"noopener\">live run<\/a>.  (The way it changed on 1\/12\/2013 to have a dropdown of placenames as extra functionality will be explained in a tutorial called PHP\/Javascript\/HTML Geographical Placename Integration Tutorial on 3\/12\/2013.)<\/p>\n<p>Here is a link to some downloadable PHP programming source code which you may want to rename to <a target=\"_blank\" title='sun_angle_now_at.php' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/MoonAngle\/moon_angle_now_at.php_GETME\" rel=\"noopener\">moon_angle_now_at.php<\/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='#d5383' onclick='var dv=document.getElementById(\"d5383\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?cat=59\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d5383' 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='#d41167' onclick='var dv=document.getElementById(\"d41167\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/pyephem\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d41167' 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='#d64558' onclick='var dv=document.getElementById(\"d64558\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/python\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d64558' 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='#d68735' onclick='var dv=document.getElementById(\"d68735\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/python\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d68735' 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='#d68745' onclick='var dv=document.getElementById(\"d68745\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/textarea\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d68745' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>We are great admirers of HTML and CSS regarding the way multiple background images are possible behind an HTML element. To get to a multiple background image scenario (or even single ones regarding the basis for this blog posting&#8217;s creation), &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/css-background-position-revisit-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,14,37],"tags":[126,127,2471,5218,150,281,367,1683,452,576,652,3965,2092,997,1761,1866,1262,1319],"class_list":["post-68745","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-tutorials","tag-background","tag-background-image","tag-background-position","tag-background-position-x","tag-blockquote","tag-css","tag-dropdown","tag-dynamic","tag-form","tag-html","tag-javascript","tag-justify","tag-multiple","tag-programming","tag-prompt","tag-select","tag-textarea","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/68745"}],"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=68745"}],"version-history":[{"count":16,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/68745\/revisions"}],"predecessor-version":[{"id":68781,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/68745\/revisions\/68781"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=68745"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=68745"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=68745"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}