Firefox, create a web page

Joined
Mar 17, 2011
Messages
1
Reaction score
0
Points
1
Hi,
First time trying to make a web page. Here the content of my index.html file. When I open the file with firefox, the content of the file is displayed as a text file instead of a nice web page. Thank you for any tip. Michel

<html>
<head>
<title>My personal website</title>
</head>
<body>
<h1>My personal website</h1>
<h2>Startpage</h2>
<h3>Welcome</h3>
</body>
</html>
 
Joined
Oct 22, 2007
Messages
8,967
Reaction score
287
Points
83
Location
London
Your Mac's Specs
Mac Mini Core i7 2012 | White 2009 MacBook 2 Ghz | 733 Mhz G4 Quicksilver
Try giving it a doc type

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
It's good form to have a DOCTYPE declared (more here) so take louishen's advice but know that it's not necessary for the page to work. Simple question: did you save the page with the htm or html extension? If not, Firefox is probably reading it as plain text and is thus just presenting it.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top