HTML Notes
HTML Notes
To create an HTML page, all you need is a simple text editor like Notepad (Windows) or TextEdit (Mac).
Open your text editor, and save your file with a .html extension. This tells the computer that it's an
HTML file.
Document Structure:
Every HTML page begins with a document type declaration and an <html> tag. Inside the <html> tag,
there are two main sections: <head> and <body>. The <head> section contains meta-information about
the page, while the <body> section holds the visible content.
html
<!DOCTYPE html>
<html>
<head>
<title>My Webpage</title>
</head>
<body>
</body>
</html>
Adding Headings:
Headings help to structure your content. There are six levels of headings, from <h1> (the main heading)
to <h6> (the smallest subheading).
html
<h2>This is a Subheading</h2>
To write regular text, you simply use <p> tags for paragraphs.
html
Inserting Images:
You can add images using the <img> tag. Remember to provide the src attribute with the image file's
location.
html
Creating Links:
Hyperlinks connect different web pages. Use the <a> tag with the href attribute to specify the link's URL.
html
Making Lists:
Lists organize information in an ordered or unordered format. Use <ul> for unordered lists and <ol> for
ordered lists, with <li> for each list item.
html
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
<ol>
<li>First</li>
<li>Second</li>
</ol>
Using Tables:
Tables help you display data in rows and columns. Use <table> to create the table, <tr> for table rows,
and <td> for table cells (data).
html
<table>
<tr>
</tr>
<tr>
</tr>
</table>
Remember to close all tags you open. For example, <p> needs a </p> to close it. Also, make sure to
practice and experiment with these elements to become more comfortable with HTML.
Formatting:
HTML allows you to control how your text appears on the webpage. You can use the following tags for
basic text formatting:
While it's not recommended to use the <font> tag for modern web development, you can use it
to set the font, size, and color of your text.
<p><font face="Arial" size="4" color="blue">This text is in Arial font, size 4, and blue
color.</font></p>
Text:
<blockquote>
<p>"The only way to do great work is to love what you do." - Steve Jobs</p>
</blockquote>
<p>If you want to display a code snippet, use the <code><html></code> tag.</p>
Graphics:
HTML allows you to add images to your webpage using the <img> tag.