/    Sign up×
Community /Pin to ProfileBookmark

HTML code displaying instead of webpage

Hi,

Am trying to learn HTML, but my first page hit a brickwall when it displays the code instead of the webpage. Anyone know why? Page was created using textedit on a mac.

G

to post a comment
HTML

6 Comments(s)

Copy linkTweet thisAlerts:
@ChipzzzSep 13.2010 — Did you give it a htm or html extension and publish it to a web server?
Copy linkTweet thisAlerts:
@GodmanauthorSep 13.2010 — Yes i did... but did not publish it to any webserver as I m testing it in my own machine.

I tried saving it as both .htm and .html, and both dont work!
Copy linkTweet thisAlerts:
@ChipzzzSep 13.2010 — Try copying this into an html file and open it with your browser:

<i>
</i>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en"&gt;
&lt;head&gt;
&lt;/head&gt;
&lt;body&gt;
Hello universe! (I'm mega-HelloWorld!)
&lt;/body&gt;
&lt;/html&gt;
Copy linkTweet thisAlerts:
@diyakapoorSep 13.2010 — check your all opening and closing tags in body section. there might be some problem in that.
Copy linkTweet thisAlerts:
@d4t4ch17dSep 13.2010 — Hi,

Am trying to learn HTML, but my first page hit a brickwall when it displays the code instead of the webpage. Anyone know why? Page was created using textedit on a mac.

G[/QUOTE]


Besides the closing tags in your document, I also noticed that you are using Textedit, did you make all the proper changes within the program to type in plaintext instead of rich-type, also did you select the HTML box within those settings?
Copy linkTweet thisAlerts:
@handcraftedwebSep 13.2010 — My guess too is that you saved as HTML, in which case TextEdit will produce HTML code to render the contents of the editor (which in this case is HTML code). You can tell for sure by opening your page in a browser and select View>Page Source. If you see much more HTML than you typed in TextEdit, then that's what's happening.

You can probably use TextEdit to save as plain text, but you might as well get a decent editor. TextWrangler is a pretty good free editor for Macs.

...Mike
×

Success!

Help @Godman spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...