Simple HTML Code Examples you can learn in 10 Minutes
- Always save file with (.) extension
- ex. filename.html
Exercise:- (With internal CSS)
Example 1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Basic_Tags</title> </head> <body> <!------Heading Tags-------> <h1>Hello World</h1> <h2>Hello World</h2> <h3>Hello World</h3> <h4>Hello World</h4> <h5>Hello World</h5> <h6>Hello World</h6> <!-------Paragraph Tag----> <p align="center"><b>This course is specially designed for students who are keen on landing a job as developer</b></p> <!----------Horizontal Line-------> <hr /> <!---------- Center Content Tag---------> <center> <p><b>This course is specially designed for students who are keen on landing a job as developer</b></p> </center> <!----------Line Break Tag----------> <p align="justify"><b>This course is specially designed for students who are keen on landing a job as a developer. This course is specially designed for students who are keen on landing a job as a developer this course is specially designed for students who are keen on landing a job as a developer this course is specially designed for students who are keen on landing a job as a developer. <br /><br />This course is specially designed for students who are keen on landing a job as a developer this course is specially designed for students who are keen on landing a job as a developer this course is specially designed for students who are keen on landing a job as a developer this course is specially designed for students who are keen on landing a job as a developer this course is specially designed for students who are keen on landing a job as developer</b></p> <br/> </body> </html>
Here <!————–XYZ———————-> is used as a comment and browser doesn’t read the line that has been commented.
Output 1:-
<!doctype html> <html> <head> <meta charset="utf-8"> <title>HTML Attributes</title> <style type="text/css"> #font_color { color:#009; font-size:50px; } </style> </head> <body bgcolor="#99FF99"> <b><i><u>With so many IT companies siting on the market.</u></i></b> <br/><br/> 2<sup>nd</sup> Generation <br/><br/> (28)<sub>10</sub>=()<sub>2</sub> <p style="color:#9FC; font-family:Arial, Helvetica, sans-serif; font-size:50px; height:100px; background-color:#00F"></p> <h1 id="font_color">Surabhi Singh</h1> </body> </html>
Output 2:-
[…] Also read, Here’s a basic HTML Code to start practicing as a beginner […]
[…] CSS to an HTML code can be performed in three […]