html set title code example

Example 1: html change name in tab

<html>
  <head>
    <title>Insert title here</title>
  </head>
</html>

Example 2: title tag html

<title>Title to appear in the browsers tab of the page</title>

Example 3: COOL css html title tag

h1 { 
  text-align: center;
  color: white;
  text-transform: uppercase;
  padding: 1px;
  font-family: 'Raleway', cursive;
  font-weight: 100;
  position: relative;
  background: -webkit-linear-gradient(left, black, #eee, black);
  background: -moz-linear-gradient(left, black, #eee, black);
  background: -ms-linear-gradient(left, black, #eee, black);
  background: -o-linear-gradient(left, black, #eee, black);
}
h1:before {
  content: "";
  position: absolute;
  left: 50%;
  top: -50px;
  width: 600px;
  margin-left: -300px;
  margin-top: -220px;
  height: 600px;
  background: -webkit-radial-gradient(50% 50%, ellipse closest-side, #444, black);
  background: -moz-radial-gradient(50% 50%, ellipse closest-side, #444, black);
  background: -ms-radial-gradient(50% 50%, ellipse closest-side, #444, black);
  background: -o-radial-gradient(50% 50%, ellipse closest-side, #444, black);
  z-index: -1;
}
h1 a {
  background: black;
  display: block;
  padding: 20px;
  text-decoration: none;
  letter-spacing: 30px;
  color: white;
}

Example 4: how to add a title in html

<!DOCKTYPE html>
<html>
  <head>
    <title>This Is A Website Title...</title>
  </head>
  <body>
    <p>How to add a Title to a HTML website...</p>
  </body>
</html>

Example 5: change the title in html using

document.title = "My New Page Title";