HyperText Markup Language

html icon

What is HTML?

* * *

  • It's a Markup Language
  • Not a programming Language
  • It is the language used to create webpages
  • It uses "tags" to label the different parts of the text,
    think of how you format text in a Word Document.
  • Tags or elements are enclosed in angle brackets (<>) to define the structure and formatting of content
  • Defines the structure of webpages
  • It can be used by itself or combined with programming languages.
binary code image

Markup Langage

  • Presentational Language
  • No logic or algorithm
  • Used to define the structure of data
  • Use tags or elements enclosed in angle brackets (<>)
  • The tags describe the content
  • HTML, XML, Markdown, BBCode

Scripting Language

  • Scripting languages enable the creation of dynamic and interactive content.
  • They usually integrate and communicate with other languages
  • They are used to write smaller tasks within a larger system
  • They can be used to build web applications, perform calculations, manipulate data, and control the flow of program execution.
  • They are executed directly by another program (like a web browser) rather than being compiled into machine code
  • JavaScript, PHP, Python, Ruby

Programming Language

  • used to create standalone software applications, perform complex calculations, implement algorithms, manage memory, and interact with external hardware.
  • They have rich and complex syntax.
  • Used for software, drivers, etc.
  • They often have to be compiled into machine langage to be executed directlyby the computer
  • C, C++, C#, Java, Swift, Rust, PHP, Python, Ruby

HTML History

* * *

  • The first web page went live on August 6, 1991 and it was made by Tim Berners-Lee, considered the inventor of the www.
  • The first webpage
  • The first official version of HTML was released in 1993.
  • HTML 2.0, released in 1995
  • HTML 3.0, released in 1996
  • HTML 4.0, released in 1997
  • HTML 5.0, released in 2008, and it's the current verison.

Who decides which version do we use?

The World Wide Web Consortium (W3C) is an international community where Member organizations, a full-time staff, and the public work together to develop Web standards.

Led by Web inventor Tim Berners-Lee and CEO Jeffrey Jaffe, W3C's mission is to lead the Web to its full potential.

Evolution of the Web

Web 1.0

  • Around 1991
  • Static Pages
  • Web applications were written using markup languages only
  • Content was positioned and aligned using frames and tables. table positioned website.

Web 2.0

  • Around 1999
  • Rich User experiences. Highly interactive websites.
  • User participation, and user generated content:
    • Blogging
    • YouTube
    • Wikipedia
    • Social Networks
  • Use of back-end languages: (PHP, PERL, Ruby, Phyton etc).

Web 3.0

  • Called the decentralized web, aims to make the web more intelligent, secure and user focused
  • Semantic web.
  • Artificial Intelligence and Machine Learning.
  • 3D Graphics for AR and VR
  • Everything will be interconnected.
  • Blockchain, Cryptocurrency.
  • More user controlled experience.

Where do I write HTML?

HTML can be written in a simple text editor, or using a more specialized application that gives you syntax highlighting and many other tools. The end result is the same.

There are several online and offline code editors to choose from. We will work with Visual Studio Code, which allows you to create and test HTML code in your computer.

HTML Tags

Every element in HTML is surrounded by tags

Opening Tag

<p>

  • All tags start with a left angle bracket <
  • Followed by the element it represents (p=paragraph, h=heading, a=link)
  • And a right angle bracket >

Content goes here

<p>Gallia est omnis divisa in partes tres, quarum. At nos hinc posthac, sitientis piros Afros.

Paullum deliquit, ponderibus modulisque suis ratio utitur. Salutantibus vitae elit libero, a pharetra augue. Quae vero auctorem tractata ab fiducia dicuntur.<p>

Closing Tag

</p>

  • The / indicates that is the end of the tag
  • It is important to close the tags specially for stuctural elements. The closing tag indicates that an element type ends and a different one can start.

HTML is all about containers

illustration of recyclin bins

Every tag has a purpose

illustration of recyclin bins

HTML Structure

Head Tags

Head tags contains the metadata about the HTML document.

  • Title

    Contains the Title of the website on the browser toolbar, your bookmarks and is used as a page title in search results.

  • Head Links

    Indicates the location of external files associated with the html document.

    <link rel="stylesheet" href="mystyle.css">
  • meta keywords

    Define keywords for search engines.

    <meta name="keywords" content="HTML, CSS, XML, XHTML, JavaScript">
  • meta description

    Define a description of your web page.

    <meta name="description" content="Free Web tutorials on HTML and CSS">
  • meta author

    Define the author of a page.

    <meta name="author" content="John Doe">
  • meta viewport

    Sets the viewport to make your website look good on all devices:.

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

Head Tags

metatags in code and search engines

Anatomy of an HTML page

  • DDOCTYPE: Tells the browser the file type
  • html: Indicates that anything between them is html 5 code, language and reading direction.
  • head: Contains page information (title, links to external files etc.) to be used by the browser. This area is not displayed on the browser.
  • title: on the head tag is not visible on the page but at the top bar on the browser.
  • body: Main content of the webpage. Contains all the other html tags and is what you see on your browser.

Simple Page Structure

<!DOCTYPE html>
<html lang="en" dir="ltr">
    <head>
      <!-- Here there is page information for the browser, links to external files needed. Not visible on the actual webpage.-->
      <meta charset="utf-8">
        <title>
        This is the page Title on the top of the browser
        </title>
    </head>

      <!-- This is what's visible on the website -->
      <body>
        <section class="bg-primary">
            <div class="wrap">
                <h2> This is a Heading</h2>
            </div>
        </section>
      </body>
  </html>
    

Anatomy of a WEBPAGE

  • Header: Not to be confused with the head html section. The header usually contains the Page Title, the logo, main navigation. It is used as an introduction to the page.
  • Main:Is where the main content of the page is. It can contain sections, articles and any type of content.
  • Footer: Used as a closing for the page, usually contains, copyright information, secondary menus, contact information.
diagram of a website and its parts

HTML Tags (Body)

  • Headings

    There are 6 levels of headings

    h1

    h2

    h3

    h4

    h5
    h6
  • Paragraphs

    <p> One or more sentences that make part of the content on a webpage </p>

    You can have as many paragraphs as you need

  • Bold or Strong?

    Use <b> when you want to give <b>visual</b> contrast

    University of Miami colors are green and orange


    Use <strong> when you want to give <strong>importance</strong> to part of the paragraph

    If someone rings the doorbell do not open the door

  • Italic or Emphasis?

    Use <i> when you want to give an <i>alternate voice or mood</i>

    The words in italic are usually represented with cursive fonts.


    Use <em> when you want to give <em>emphasis</em> to a word

    Turn off your phone NOW.

  • Blockquote / Cite

    Blockquote Defines a section that is quoted from another source

    Cite describes a reference to a cited creative work, and must include the title of that work

    To be, or not to be, that is the question

    from Hamlet, spoken by Hamlet
  • Hyperlinks

    Are used to link to other pages inside or outside your website.

    <a href="http://google.com"> Go to Google</a>


    Go to Google

Web links

  • Links to other pages or files on your website
  • <a href="myPage.html">
  • Links to other websites
  • <a href="http://otherPage.html">

Anchor Links

  • Links to other sections of the same page
  • identify the link using the #
  • <a href="#newSection">
  • And the target section
  • <p id="newSection">

Email & Phone Links

  • Opens your default email client
  • myEmail@email.com
  • <a href="mailto:myEmail@email.com">
  • Vulnerable to spam bots getting your email address unless you use some scripting to encript the address.
  • Call me at 305-123-4567
  • <a href="tel:3051234567">

Anatomy of a link

<a href="http://www.miami.edu/about/index.html">

  • href: is an attribute of the a tag that specifies the link destination
  • http:// is the protocol used
  • www.miami.edu: website URL
  • about: one section of the website where the page is located
  • index.html: files being displayed

More HTML Tags (Body)

  • Bulleted lists

    They are calle Unordered Lists and have 2 elements:

    • • The List Container
    • • The list items

    Lists can be nested by creating another ul tag inside a li

    <ul> <li> Item 1 </li> <li> Item 2 </li> </ul>

  • Numbered List

    They are calle Ordered Lists and have 2 elements:

    1. 1. The List Container
    2. 2. The list items

    Lists can be nested by creating another ul tag inside a li

    <ol> <li> Item 1 </li> <li> Item 2 </li> </ol>

  • Address

    Use <adress> when you want to give contact information
    <address>
    Your Name
    Your Address
    Phone Number
    Email
    </address>


  • Line Breaks

    Sometimes you just need a break...


    Your Name <br>
    Your Address <br>
    Phone Number <br>
    Email <br>

  • Code Comments

    Comments are not displayed in the browser but you can see them on the source code


    It starts with <! –– and the comment closes with -->

  • Horizontal Ruler

    Sometimes you need a line to separate content


    Use <hr> to add a break between sections

  • Images

    empty chair on a beach

    <img src="images/myImage.png" alt="add description here" width="50" height="50"/>

    The image size can be given here or in the css. If you give the width only, the height will be calculated proportionally.


    You can add links to images wrapping them with an "a" tag

  • Figure / Figcaption

    Use <figure> to represent self-contained content with an optional caption. This content can be moved away without affecting the content's meaning.
    Commonly used for images.


    Use <figcaption> to add a caption to the image or figure content.


    empty chair on a beach
    This is a chair on the beach
  • iframe

    Use <iframe> when you want to embed external content into your website</iframe>


  • iframe

    Use <iframe> when you want to embed external videos into your website</iframe>


  • Video

    Are used to embed locally hosted videos.

    <video width="320" controls> <source src="../static/video/hd0992.mp4" type="video/mp4"> Sorry, your browser doesn't support embedded videos. </video>
  • Audio

    The audio tag is used to embed sound content in websites.

    <audio controls src="../static/audio/Visionary-WVM011601.mp3"> Your browser does not support the <code>audio</code> element.

Last One..

  • Tables

    Are used to display tabular data. Do not use for display. They have three main elements: Table Headings, Table Rows and Table Data.

    This is a Table Heading
    Table Cell Another table cell
    Table Cell Another table cell
    Table Cell Another table cell
    Table Cell Another table cell

    <table> <tr> <th> table heading </th> </tr> <tr> <td> Table Cell </td> <td> Another table cell </td> </tr> <tr> <td> Table Cell </td> <td> Another table cell </td> </tr> </table>

More on Tables

tables

Column modifications

  • Table headers: th
  • Table Head: thead
  • Table Body: tbody
  • Table Footer: tfoot
  • Span cells across columns: colspan="2"
  • Span rows: rowspan="2"
--> -->