My html code won't display anything in my web browser



  • I wrote my html code on notepad++ and saved it with an .html extention but when I try to open it with google chrome nothing shows up just an empty page. Here is the code I wrote:

    <!DOCTYPE html>

    <html>

    <head>
    
    <!-- Math High: Leonhard Euler
     Author: Elie Abboud
     Date: September 13th, 2020
     
     -->
    <meta charset="UTF-8">
    
    	<title> Math High Leonhard Euler </title>
    
    <script src="modernizr-1.5.js" </script>
    <link href="mhstyles.css" rel="stylesheet" type="text/css">
    
    </head>
    
    <body>
    
    <header>
    <img src="mhlogo.jpg" alt="Math High">
    
    </header>
    <mark>
    <h1> Leonhard Euler (1707-1783) </h1>
    
    <!DOCTYPE html>
    <p>The greatest mathematician of the eighteenth century, <strong> Leonhard Euler </strong> was 
    born in Basel, Switzerland. There, he studied under another giant of 
    mathematics, <strong> Jean Bernoulli </strong>. In 1731 Euler became a professor of physics 
    and mathematics at St. Petersburg Academy of Sciences. Euler was the most 
    prolific mathematician of all time, publishing over <em> 800 different books and 
    papers </em>. His influence was felt in physics and astronomy as well.
    
    He is perhaps best known for his research into mathematical analysis. Euler's 
    work, <cite> Introductio in analysin infinitorum (1748) </cite>, remained a standard textbook in the field for 
    well over a century. For the princess of Anhalt-Dessau he wrote 
    Lettres &agrave; <cite> une princesse d'Allemagne (1768-1772) </cite>, giving a clear 
    non-technical outline of the main physical theories of the time.
    
    One can hardly write a mathematical equation without copying Euler. 
    Notations still in use today, such as <var> e </var> and &Pi;, were introduced 
    in Euler's writings. Leonhard Euler died in 1783, leaving behind 
    a legacy perhaps unmatched, and certainly unsurpassed, in the annals 
    of mathematics.</p>
    
    
    <aside>
    <h1> The Most Beautiful Theorem? </h1>
    
    <p> Euler's Equation </p>
    
    <p> cos <var> (x) </var> + <var> i </var>sin <var>(x) </var> = <var> e </var> <sup>(ix) </sup> </p>
    
    <p> demonstrates the relationship between algebra, complex analysis, 
    and trigonometry. From this equation, it's easy to derive
    the identity </p>
    
    <p> <var> e </var> <sup>(&Pi; <var> i </var>) </sup> + 1 = 0 </p>
    
    <p> which relates the fundamental constants: 0, 1, &Pi;,  <var> e </var>, and <var> i </var> in
    a single beautiful and elegant statement. A poll of readers 
    conducted by <cite> The Mathematical Intelligencer </cite> magazine named 
    Euler's Identity as </mark> The most beautiful theorem in the history of mathematics.</aside>
     </p>
    
    
    
     <footer> Math High: A Site for Educators and Researchers </footer>
    
    </body>
    

    </html>



  • @Elie-Abboud said in My html code won't display anything in my web browser:

    I try to open it with google chrome nothing shows up just an empty page.

    My initial guess is that you have a file called somefilename.html.txt, the .txt extension will be added by Notepad++ if you type a filename without changing the save as type also.

    You can easily check this by finding the file using windows explorer and double clicking to open it. I bet it opens in windows notepad (that’s the default application). Windows by default hides the extensions of registered file types of which ,txt is one. The icon attached to the file when seen in explorer is also an indicator. If truly an html file it will have an IE or Chrome icon.

    This issue has occured before so if you want to use the forum search function type in html browser and have a look at some of the previous instances where posters had a similar problem to yours. There may be a solution within those if my description is not the problem you have.

    Terry



  • @Terry-R

    Good thought, but wouldn’t that require, when a file gets saved as somefilename.xxx.txt, that xxx is a type unknown to Windows?

    In this case, one can hardly believe that an extension such as html is an unknown to any possible configuration of Windows a user might have.



  • @Alan-Kilborn said in My html code won't display anything in my web browser:

    that xxx is a type unknown to Windows?

    In this situation the ,xxx is just a part of the filename. Only the last , and following characters are the true extension and what Windows uses to determine the default application to open with.

    Terry



  • @Terry-R

    I’m getting more confused now.

    Didn’t you mean to say .xxx and not ,xxx ?
    I don’t see a comma in anything the OP might have been trying to do.

    So, if you really meant:

    In this situation the .xxx is just a part of the filename. Only the last . and following characters are the true extension and what Windows uses to determine the default application to open with.

    That is absolutely correct.
    But what I thought you were getting at with your earlier post was that probably the user typed somefilename.html at the save prompt and pressed Enter. Then Notepad++ appended .txt to arrive at somefilename.html.txt
    Is that not what you were getting at?

    My contention is that if user does this, they will end up with somefilename.html, because .html is a known type to Windows.
    Indeed, if I try it, I get exactly that.

    However, if I try to make it “fail”, I can, with this example:
    If I tell it somefilename.htmlzz then I end up with somefilename.htmlzz.txt, because, .htmlzz is not a known thing, to Windows.

    But really, it feels like I have a “disconnect” with what is being discussed.



  • @Alan-Kilborn said in My html code won't display anything in my web browser:

    Didn’t you mean to say .xxx and not ,xxx ?

    Sorry that was a typo that got through. I’m posting using the small phone screen whilst on holiday.

    NPP has 2 settings for how it saves a file I believe one will allow you to type what you believe to be an extension but in fact will then apply a further extension based on the setting in the next field save as type. Your typed extension now becomes just a part of the filename.

    This is how malware gets to run, someone sees .html in a file explorer window, forgets that registered extensions don’t show and double clicks on it. Windows then uses the hidden extension say .exeand the malware executed.

    Terry



  • @Terry-R

    Enjoy the holiday, forget about the forum for a while! :-)

    Okay. But, and it is a big BUT, people don’t want to type a filename AND select a dropdown in N++.

    Or maybe they do, because we used to have huge noise about how N++ wouldn’t autoappend the extension based upon what they chose in the dropdown.


Log in to reply