Erik W
Erik W

Reputation: 2628

HTML - Why doesn't my title show?

Im trying to make a small website, but when i try my HTML file, the title doesnt show up at all.

Code:

<html>
<head>
    <title>My Games: <br></title>
</head>

<body>
    <a href="http://erikwallstrom.16mb.com/AdventureGame.swf.swf">My Epic Game</a> 
    <a href="http://erikwallstrom.16mb.com/Main.swf"><br> My Other Epic Game</a> 
</body>
</html>

Does someone know why the title doesn't show up? If yes, please tell me why! :)

Upvotes: 3

Views: 18785

Answers (3)

Shomz
Shomz

Reputation: 37701

<title>, the HTML tag is used to denote the title of the webpage and it usually appears in the browser window header (just like this window says HTML - Why doesn't my..., that's the title of this window), then also when you bookmark it, etc. But it's doesn't appear anywhere in the body (that's why it's in the head part of the HTML).

To set titles, as in the book titles, use heading tags: h1, h2, h3, h4, h5 and h6.


Here is the info about the title element:

The HTML element (HTML Title Element) defines the title of the document, shown in a browser's title bar or on the page's tab. It can only contain text and any contained tags are not interpreted.

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/title


And here is some info about the heading elements:

Heading elements implement six levels of document headings, is the most important and is the least. A heading element briefly describes the topic of the section it introduces. Heading information may be used by user agents, for example, to construct a table of contents for a document automatically.

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements


This is probably what you want to achieve:

<h1>My Games: </h1>
<a href="http://erikwallstrom.16mb.com/AdventureGame.swf.swf">My Epic Game</a> 
<a href="http://erikwallstrom.16mb.com/Main.swf"><br> My Other Epic Game</a> 

Upvotes: 5

Javier Bouclier
Javier Bouclier

Reputation: 1

Use the tag H1 inside the body tag if you want to see the title in the page.

<html>
<head>

</head>
<body>
    <h1>My Games:</h1>   <br>  
    <a href="http://erikwallstrom.16mb.com/AdventureGame.swf.swf">My Epic Game</a> 
    <a href="http://erikwallstrom.16mb.com/Main.swf"><br> My Other Epic Game</a> 
</body>
</html>

The title tag is used to show a name for the page in the browser title.

Upvotes: -1

Reza Aria
Reza Aria

Reputation: 157

You cant write br between title tag if you want write title for a tag you should use p or h1 h2 h3 h4

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title> this tag use for title in browser bar </title>
</head>
<body>
    <h1>write your title here</h1>
	<a href="http://erikwallstrom.16mb.com/AdventureGame.swf.swf">My Epic Game</a> 
    <a href="http://erikwallstrom.16mb.com/Main.swf"><br> My Other Epic Game</a> 
</body>
</html>

Upvotes: 0

Related Questions