Adding New Element to HTML
×
Home Courses Community Support
Adding New Element to HTML

HTML5 allow you to add new custom element. You can add any element of your choice. For example we will add a tag <centerCode> in html.

See below code-

<!DOCTYPE html>
<html>
<head>
  <title>Add New Element</title>
  <style>
	  centerCode {
		  display:block;
		  background-color:#CCCCCC;
		  margin: 20px;
		  padding:50px 10px;
		  width:300px;
		  font-size: 20px;
	  }  
  </style>
</head>
<body>

<h1>Add new element</h1>
<p>Below paragraph is created using <mark>non-html tag</mark>.</p>
    <centerCode>
    Hurre!!
    I have added custom tag to webpage.
    </centercode>
</body>
</html>

 

In the above code we have used new tag <centerCode>. To add new element we just need to write CSS for that in <style>. Above code will create a webpage like below image-

 

 

enlightenedWhile adding new element to your webpage, set the display property to block. It will help the tag to work proper in all browser versions.

 

← Preview

Design a Contact Form using HTML5 Element

Next →

Convert a HTML4 Page into HTML5

NOTES

Our mission is to provide highly effective and quality education via innovative solutions. Geeksdemy look forward to bridge the gap between in-demand technology and academics in order to deliver innovative, easy, interesting and affordable learning across the Globe.

Courses

  • Python
  • Game Development with Unity 3D
  • Arduino
  • PCB & Circuit Designing
  • Robotics and Embedded C
  • 8051/8052 Embedded Systems
  • QuadCopter & UAV
  • MATLAB with Robotics
  • Raspberry Pi
Learn On the Go!
Get the Android App
Get the iOS App