Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Why Is HTML Not Working?


  • Please log in to reply
3 replies to this topic

#1 ComputerNoob2

ComputerNoob2

  • Members
  • 1 posts
  • OFFLINE
  •  
  • Local time:12:35 AM

Posted 07 January 2017 - 08:52 PM

I typed the following HTML into textedit on mac:

 

 

<!DOCTYPE html>

<html>

<body>

<title>Hello World<title/>

<body/>

<html/>

 

I saved it as an HTML file, yet it didn't work right.  It simply saved it in this format rather than simply reading hello world, as I had expected.  Why is this?



BC AdBot (Login to Remove)

 


#2 RolandJS

RolandJS

  • Members
  • 4,533 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Austin TX metro area
  • Local time:12:35 AM

Posted 07 January 2017 - 09:20 PM

Ok, I'm still working on why it does not feed back "Hello World" -- however, the following is a little more what has been the standard html coding since Windows 3.11 and Netscape:

 

<!DOCTYPE html PUBLIC "-//IETF//DTD html 3.2//EN">

or <!DOCTYPE html>

<html>

<title>Hello World</title>

<body>

<h1>Hello World</h1>

</body>

</html>

 

I corrected what I should have remembered from all those years, and, added sasschary's H1 stuff.


Edited by RolandJS, 08 January 2017 - 10:07 AM.

"Take care of thy backups and thy restores shall take care of thee."  -- Ben Franklin revisited.

http://collegecafe.fr.yuku.com/forums/45/Computer-Technologies/

Backup, backup, backup! -- Lady Fitzgerald (w7forums)

Clone or Image often! Backup... -- RockE (WSL)


#3 sasschary

sasschary

  • Malware Study Hall Senior
  • 852 posts
  • ONLINE
  •  
  • Gender:Male
  • Location:A galaxy far, far away...
  • Local time:01:35 AM

Posted 07 January 2017 - 09:34 PM

Hello, and welcome to the forum!

 

The reason that this isn't returning anything is because the title tag should go in the head section of an HTML document, not the body. The title is the text you'd see on a page's tab or when you look at a window's title. This page's title is "Why is HTML Not Working? - Programming". In addition, the slashes in your closing tags should be before the tag name, like </body> rather than <body/>.

 

If you want the text to appear on the page, you should use an h1, for heading 1, tag instead of a title. That would look like this:

<!DOCTYPE html>
<html>
<body>
<h1>Hello World</h1>
</body>
</html>

If you did mean to use the title tag, then you should be putting it in the head section of the document, as I did here:

<!DOCTYPE html>
<html>
<head>
<title>Hello World</title>
</head>
<body>
</body>
</html>

Hopefully this helps, and I can definitely help you more if this didn't make sense!

 

sasschary



#4 RolandJS

RolandJS

  • Members
  • 4,533 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Austin TX metro area
  • Local time:12:35 AM

Posted 08 January 2017 - 10:05 AM

sasschary - you are absolutely right!  I missed that about the TITLE -- I have edited my earlier post to correct, again thanks!


"Take care of thy backups and thy restores shall take care of thee."  -- Ben Franklin revisited.

http://collegecafe.fr.yuku.com/forums/45/Computer-Technologies/

Backup, backup, backup! -- Lady Fitzgerald (w7forums)

Clone or Image often! Backup... -- RockE (WSL)





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users