Using Attributes in HTML Element
Home Courses Community Support
Using Attributes in HTML Element

As you have learned how to create a simple HTML page and how to use <P> tag within HTML. Further we can add attributes in HTML elements to provide more information about element.

See below code to use attribute with in <p> tag -

<!DOCTYPE html>
    	<title>My HTML Page</title>
		<p align="center">This is my first webpage.</p>


enlightenedAttributes are written in Start Tag only.


In above code we have used align attribute. Align attribute have four properties i.e. left, right, center and justify which start to display the content from left, right, center and in full length respectively. So the above code will print the paragraph in the center of webpage.



← Preview

Creating First HTML Page

Next →

Formatting Text in html


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.


  • 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