Basics in HTML Writing

Introduction

HTML, or HyperText Markup Language, is the fundamental language used to create web pages.

  • It is a markup language, which means that it uses tags to describe the structure of a web page.

HTML Page Structure

NOTE: Every HTML document starts with a document type declaration: <!DOCTYPE html>. This declaration sets the document type and ensures proper rendering of the page.



HTML Elements

HTML elements are the building blocks of web pages. Each element is defined by a start tag, content and an end tag.

  • <tagname> ...Content... </tagname>

Here are some essential HTML elements to structure your web pages.

  • Headings
    • Use <h1> to <h6> tags for defining headings, with <h1> representing the most important heading.
  • Paragraphs
    • Create paragraphs of text using the <p> element.
  • Lists
    • Build lists of items using <ul> (unordered list), <ol> (ordered list), <dl> (definition list) elements.
    • Each list items is denoted by the <li> tag.
  • Styles
    • Enhance the appearance of elements by adding styles using the style attribute. You can specify properties like colour, font-family, font, size, text-align and more.
    • Example: <p style="color: red; font-family: verdana; font-size: 60px; text-align: center;">This is a red paragraph.</p>
  • Text Formatting
    • <b> - Bold text
    • <strong> - Important text, typically displayed in bold.
    • <i> - Italic text
    • <em> - Emphasized text, typicallyed displayed in italic.
    • <u> - Underlined text
    • <del> - Strike a line through deleted text.
    • <mark> - Highlighted text
    • <sub> - Subscript text
    • <sup> - Supercript text
  • Images
    • Add images to your web pages using the <img> tag. Specify the source file (src), alternative text (alt) and dimensions (width and height in pixels).
    • Example: <img src="/images/rxnote.jpg" alt="RxNote" width="500" height="600">
  • Tables
    • Create tabular data using the <table> element.
    • Rows are defined with <tr> tags, cells with <td> tags and table headers with <th> tags.
  • Links
    • Insert hyperlinks using the <a> tag. The destination URL is specified in the href attribute.
    • Example: <a href="https://mypharmacistnote.blogspot.com/">link text</a>

NOTE: Never skip the end tag, except for certain elements such as <br> (defines a line break) and <hr> (defines a horizontal line on a web page).



HTML Symbols

HTML symbols allow you to represent characters that are not present on a standard keyboard. Here are some commonly used symbols.

Mathematical Symbols

  • &lt; - <
  • &le; - ≤
  • &gt; - >
  • &ge; - ≥
  • &equiv; - ≡
  • &deg; - Degree (˚)
  • &alpha; - Alpha (α)
  • &beta; - Beta (β)
  • &gamma; - Gamma (γ)
  • &delta; - Delta (δ)
  • &mu; - Micro (µ)
  • &micro; - Micro (µ)
  • &pi; - π
  • &sup2; - ²
  • &sup3; - ³
  • 1&frasl;2 - ½
  • &frac12 - ½
  • 1&frasl;4 - ¼

Punctuation Symbols

  • &nbsp; - Non-breaking space
  • &amp; - Ampersand (&)
  • &lsquo; - Left single quotation mark (‘)
  • &rsquo; - Right single quotation mark (’)
  • &ldquo; - Left double quotation mark (“)
  • &rdquo; - Right double quotation mark (”)
  • &middot; - Middle dot (·)
Miscellaneous Symbols
  • &copy; - Copyright symbol (©)
  • &reg; - Registered Trademark symbol (®)
  • &trade; - Trademark symbol (™)



Example of A Web Page

HTML VIEW

<!DOCTYPE html>
<html>
<head>
<title>My First Web Page</title>
</head>
<body>
<h1>My First Web Page</h1>
<p>This is my first web page: <a href="https://mypharmacistnote.blogspot.com/">Rx Note</a>.</p>
<img src="/my_image.jpg" alt="My Image">
<p>Starting a list:</p>
<ul>
<li>This is a list.</li>
<li>This is another item in the list.</li>
</ul>
<table border=“2”>
<tr>
<th>Row 1, Column 1</th>
<th>Row 1, Column 2</th>
</tr>
<tr>
<td>Row 2, Column 1</td>
<td>Row 2, Column 2</td>
</tr>
<tr>
<td>Row 3, Column 1</td>
<td>Row 3, Column 2</td>
</tr>
</table>
</body>
</html>

COMPOSE VIEW

My First Web Page

This is my first web page: Rx Note.

My Image

Starting a list:

  • This is a list.
  • This is another item in the list.
Row 1, Column 1 Row 1, Column 2
Row 2, Column 1 Row 2, Column 2
Row 3, Column 1 Row 3, Column 2



Summary

While learning HTML scripting is not necessary for writing a blog, having a basic understanding can be helpful.



External Links

Comments