How to Add a title to your HTML document?

Started by peterwiter, 12-02-2015, 02:38:14

Previous topic - Next topic

peterwiterTopic starter

The next step is to add a title to your document. This title will be used in the browser window, allowing your visitors to identify your site, and it will also be used in the search results pages on search engines like Google. Without it, people won't know what your page is about.
We'll also add a header to your page which is visible by your visitors. This is often the same as the page title, but they can be different depending on how you want to structure them.
Inside the <html> tags, add the following lines:
<head>
<title>This is an awesome site! | ncentrictech.com</title>
</head>
Now we can go ahead and create a header for your page to tell people about the site. This is done using the <h1> tag. You can also use h2, h3, h4, h5 or h6 depending on what the title is and how important it is.
Here's what you need to do:
<body>
<h1>Welcome to my awesome website!!</h1>
</body>
The <body> tags signal to the browser that this section is the main body of the page and it is required on all web pages for them to function correctly.
Inside this, we've put the H1 heading to welcome people to the site.
http://www.ncentrictech.com/seo-services.html
  •  


Ajinkya Samark

Hi,
1. Position the insertion point where you want the title to appear.
2. Display the Insert tab of the ribbon.
3. Click the Quick Parts tool in the Text group and then choose Field. Word displays the Field dialog box.
4. In the Categories list, choose Document Information. Word updates the choices in the Field Names list (right side of the dialog box).
5. In the Field Names list choose Title.
6. Click on OK to close the dialog box and insert your field.


sanjaysing373

By using Title Tag, you can add title for your HTML Document

<head>
<title>According to your Website</title>
</head>
  •  

pablohunt2812

HTML: <a href="test.html" data-title="A new page" target="_blank">open me</a> JavaScript:

window.addEventListener("load", function() {

// does the actual opening
function openWindow(event) {
event = event || window.event;

// find the url and title to set
var href = this.getAttribute("href");
var newTitle = this.getAttribute("data-title");
// or if you work the title out some other way...
// var newTitle = "Some constant string";

// open the window
var newWin = window.open(href, "_blank");

// add a load listener to the window so that the title gets changed on page load
newWin.addEventListener("load", function() {
newWin.document.title = newTitle;
});

// stop the default `a` link or you will get 2 new windows!
event.returnValue = false;
}

// find all a tags opening in a new window
var links = document.querySelectorAll("a[target=_blank][data-title]");
// or this if you don't want to store custom titles with each link
//var links = document.querySelectorAll("a[target=_blank]");

// add a click event for each so we can do our own thing
for(var i = 0; i < links.length; i++) {
links.addEventListener("click", openWindow.bind(links));
}

});

ORLOVA

The HTML <title> tag is used for declaring the title, or name, of the HTML document.