<!DOCTYPE html>
<html>
  <head>
    <title>Hello, World!</title>
    <link rel="stylesheet" href="styles.css" />
  </head>
  <body>
      <h1 class="title">Hello World! </h1>
      <p id="currentTime"></p>
      <script src="script.js"></script>
  </body>
</html> yoohoo <bdo>
</html> Lesson 3: Quotation
and Citation Elements

Computer Science

Lesson Objectives

By the end of the lesson, you will:
Understand the different types of Formatting

Analyse HTML code to identify the purpose of different tags
<b>,<strong>, <i>, <em>, <small>, <mark>, <del>, <ins>, <sub>, and
<sup>

And the use of Comments in HTML

HTML Formatting Elements

HTML - OneCompiler

www.onecompiler.com/html

HTML <b> and <strong> Elements
The HTML <b> element defines bold text, without any extra importance.

<!DOCTYPE html>
<html>
<body>
<p>This text is normal.</p>
<p><b>This text is bold.</b></p>
</body>
</html>

HTML <b> and <strong> Elements

<!DOCTYPE html>
<html>
<body>
<p>This text is normal.</p>

<p><strong>This text is
important!</strong></p>
</body>
</html>
The HTML <strong> element defines text with strong importance.
The content inside is typically displayed in bold.

HTML <i> and <em> Elements

<!DOCTYPE html>
<html>
<body>

<p>This text is normal.</p>
<p><i>This text is italic.</i></p>
</body>
</html>
The HTML <i> element defines a part of text in an alternate voice or mood. The
content inside is typically displayed in italic.

HTML <i> and <em> Elements

<!DOCTYPE html>
<html>
<body>
<p>This text is normal.</p>
<p><em>This text is
emphasized.</em></p>
</body>
</html>
The HTML <em> element defines emphasized text. The content inside is typically
displayed in italic.

HTML <small> Element

<!DOCTYPE html>
<html>
<body>
<p>This is some normal text.</p>
<p><small>This is some smaller text.</small></p>
</body>
</html>
The HTML <small> element defines smaller text:

HTML <mark> Element

<!DOCTYPE html>
<html>
<body>
<p>Do not forget to buy <mark>milk</mark> today.</p>
</body>
</html>
The HTML <mark> element defines text that should be marked or highlighted:

HTML <del> Element

<!DOCTYPE html>
<html>
<body>
<p>My favorite color is <del>blue</del> red.</p>
</body>
</html>
The HTML <del> element defines text that has been deleted from a document.
Browsers will usually strike a line through deleted text:

HTML <ins> Element

<!DOCTYPE html>
<html>
<body>
<p>My favorite color is <del>blue</del>
<ins>red</ins>.</p>
</body>
</html>
The HTML <ins> element defines a text that has been inserted into a document.
Browsers will usually underline inserted text:

HTML <sub> Element

<!DOCTYPE html>
<html>
<body>
<p>This is <sub>subscripted</sub> text.</p>
</body>
</html>
The HTML <sub> element defines subscript text. Subscript text appears half a
character below the normal line, and is sometimes rendered in a smaller font.
Subscript text can be used for chemical formulas, like H2O:

HTML <sup> Element

<!DOCTYPE html>
<html>
<body>
<p>This is <sup>superscripted</sup> text.</p>
</body>
</html>
The HTML <sup> element defines superscript text. Superscript text appears half a
character above the normal line, and is sometimes rendered in a smaller font.
Superscript text can be used for footnotes, like WWW[1]:

HTML Comments

Add Comments
HTML comments are not displayed in the browser, but they can help document your
HTML source code.
Notice that there is an exclamation point (!) in the start tag, but not in the end tag.
With comments you can place notifications and reminders in your HTML code:
<!DOCTYPE html>
<html>
<body>

<!-- This is a comment -->
<p>This is a paragraph.</p>
<!-- Comments are not displayed in the browser -->
</body>
</html>

HTML Comments

Hide Comments
Comments can be used to hide content.
This can be helpful if you hide content temporarily:

<!DOCTYPE html>
<html>
<body>
<p>This is a paragraph.</p>
<!-- <p>This is another paragraph </p> -->
<p>This is a paragraph too.</p>
</body>
</html>

HTML Comments

Hide Inline Content
Comments can be used to hide parts in the middle of the HTML code.

<!DOCTYPE html>
<html>
<body>
<p>This <!-- great text --> is a paragraph.</p>
</body>
</html>

Today you have learnt:

The use of the following Tags

18

In the next class, we will be looking at HTML Links
 

HTML Online Editor & Compiler

Write, Run & Share HTML code online using OneCompiler's HTML online Code editor for free. It's one of the robust, feature-rich online Code editor for HTML language, running on the latest version HTML5. Getting started with the OneCompiler's HTML compiler is simple and pretty fast. The editor shows sample boilerplate code when you choose language as HTML. You can also specify the stylesheet information in styles.css tab and scripts information in scripts.js tab and start coding.

About HTML

HTML(Hyper Text Markup language) is the standard markup language for Web pages, was created by Berners-Lee in the year 1991. Almost every web page over internet might be using HTML.

Syntax help

Fundamentals

  • Any HTML document must start with document declaration <!DOCTYPE html>
  • HTML documents begin with <html> and ends with </html>
  • Headings are defined with <h1> to <h6> where <h1> is the highest important heading and <h6> is the least important sub-heading.
  • Paragrahs are defined in <p>..</p> tag.
  • Links are defined in <a> tag.

    Example:

    <a href="https://onecompiler.com/html">HTML online compiler</a>
    
  • Images are defined in <img> tag, where src attribute consists of image name.
  • Buttons are defined in <button>..</button> tag
  • Lists are defined in <ul> for unordered/bullet list and <ol> for ordered/number list, and the list items are defined in <li>.

HTML Elements and Attributes

  • HTML element is everything present from start tag to end tag.
  • The text present between start and end tag is called HTML element content.
  • Anything can be a tagname but it's preferred to put the meaningful title to the content present as tag name.
  • Do not forget the end tag.
  • Elements with no content are called empty elements.
  • Elements can have attributes which provides additional information about the element.
  • In the below example, href is an attribute and a is the tag name.

    Example:

    <a href="https://onecompiler.com/html">HTML online compiler</a>
    

CSS

CSS(cascading style sheets) describes how HTML elements will look on the web page like color, font-style, font-size, background color etc.

Example:

Below is a sample style sheet which displays heading in green and in Candara font with padding space of 25px.

body{
  padding: 25px;
}
.title {
	color: #228B22;
	font-family: Candara;
}

HTML Tables

  • HTML Tables are defined in <table> tag.
  • Table row should be defined in <tr> tag
  • Table header should be defined in <th> tag
  • Table data should be defined in <td> tag
  • Table caption should be defined in <caption> tag

HTML-Javascript

  • Javascript is used in HTML pages to make them more interactive.
  • <script> is the tag used to write scripts in HTML
  • You can either reference a external script or write script code in this tag.

Example

<script src="script.js"></script>