Important HTML elements | Nilead (2024)

Inline vs Block Elements

Important HTML elements | Nilead (1)

Important HTML elements | Nilead (2)

Basic Elements

  • A text header, denoted using the<h1>,<h2>,<h3>,<h4>,<h5>,<h6>tags.

  • A paragraph, denoted using the<p>tag.

  • A horizontal ruler, denoted using the<hr>tag.

  • A link, denoted using the<a>(anchor) tag.

  • A list, denoted using the<ul>(unordered list),<ol>(ordered list) and<li>(list element) tags.

  • An image, denoted using the<img>tag

  • A divider, denoted using the<div>tag

  • A text span, denoted using the<span>tag

Text headers and paragraphs

There are 6 different types of text header you can choose from h1, h2, h3, h4, h5, h6 with h1 being the topmost heading with the largest text.

Best SEO practices indicate that there should be only ONE h1 tag per page

<!DOCTYPE html><html> <head> </head> <body> <h1>My First Page</h1> <p>This is my first page.</p> <h2>A secondary header.</h2> <p>Some more text.</p> </body></html>

Links

A link ("anchor") is a small span of text that will direct you to a different section on the page, or to a different page.

<a href="[<https://www.google.com>](<https://www.google.com/>)">A link to Google</a>

Link can also point to email, phone number

<a [href="<mailto:[emailprotected]>](mailto:href=%22mailto:[emailprotected])">Jon Doe</a><a href="tel:5551234567">Call (555)123-4567</a>

Link can also point to any element on the same page (HTML document)

<!-- <a> element links to the section below --><p><a href="#Section_further_down"> Jump to the heading below</a></p><!-- Heading to link to --><h2 id="Section_further_down">Section further down</h2>

Lists

HTML provides a way to create both an ordered list (with elements counting up, 1, 2, 3...) and an unordered list with bullets instead of numbers.

Order list:

<p>Here is a list of ordered items:</p><ol> <li>First item</li> <li>Second item</li> <li>Third item</li></ol>

Un-ordered list:

<p>Here is a list of unordered items:</p> <ul style="list-style-type: disc"> <li>First item</li> <li>Second item</li> <li>Third item</li></ul>

List can be nested inside each other:

<ul> <li>Coffee</li> <li>Tea <ol> <li>Black tea</li> <li>Green tea</li> </ol> </li> <li>Milk</li></ul>

Images

Images in HTML are inline elements that can be placed within a paragraph.

<img src="/static/img/code.jpg" width="100"><img src="/static/img/code.jpg" style="width: 100px">

(There is also the picture element but we will not discuss it here)

Videos

Videos in HTML are inline elements that can be placed within a paragraph.

<video width="320" height="240" controls> <source src="movie.mp4" type="video/mp4"> <source src="movie.ogg" type="video/ogg">Your browser does not support the video tag.</video>

Note The video element is new, some older browsers may not support it.

Divs

The<div>tag defines a division or a section in an HTML document. Div is a block element.

The<div>tag is used as a container for HTML elements - which are then styled with CSS or manipulated with JavaScript.

The<div>tag is easily styled by using the class or id attribute.

Any sort of content can be put inside the<div>tag!

Spans

The<span>tag is an inline container used to mark up a part of a text, or a part of a document.

The<span>tag is easily styled by CSS or manipulated with JavaScript using the class or id attribute.

The<span>tag is much like the<div>element, but <div> is a block-level element and<span>is an inline element.

Tables

The HTML <table> element represents tabular data — that is, the information presented in a two-dimensional table comprised of rows and columns of cells containing data.

<table> <thead> <tr> <th colspan="2">The table header</th> </tr> </thead> <tbody> <tr> <td>The table body</td> <td>with two columns</td> </tr> </tbody></table>


The table element can be easily abused for layout purposes!!!

In version 5 of HTML (the latest version), some new elements are introduced. These new elements can be used to describe the purpose of the data/content the element holds.

Important HTML elements | Nilead (3)

Some important elements

  • <article>: Defines an article

  • <aside>: Defines content aside from the page content

  • <details>: Defines additional details that the user can view or hide

  • <figcaption>: Defines a caption for a <figure> element

  • <figure>: Specifies self-contained content, like illustrations, diagrams, photos, code listings, etc.

  • <footer>: Defines a footer for a document or section

  • <header>: Specifies a header for a document or section

  • <main>: Specifies the main content of a document

  • <mark>: Defines marked/highlighted text

  • <nav>: Defines navigation links

  • <section>: Defines a section in a document

  • <summary>: Defines a visible heading for a <details> element

  • <time>: Defines a date/time

Important HTML elements | Nilead (2024)
Top Articles
Yarn
Three Reasons to Use Yarn in 2020 (and Beyond)
Use Copilot in Microsoft Teams meetings
Printable Whoville Houses Clipart
Design215 Word Pattern Finder
Urist Mcenforcer
Fat People Falling Gif
Vanadium Conan Exiles
Student Rating Of Teaching Umn
Camstreams Download
Globe Position Fault Litter Robot
Jscc Jweb
Connect U Of M Dearborn
Daily Voice Tarrytown
Sam's Club La Habra Gas Prices
Google Flights Missoula
Jinx Chapter 24: Release Date, Spoilers & Where To Read - OtakuKart
Convert 2024.33 Usd
Www Craigslist Milwaukee Wi
Lakers Game Summary
Gazette Obituary Colorado Springs
Seeking Arrangements Boston
Engineering Beauties Chapter 1
Inbanithi Age
1145 Barnett Drive
Busted Mugshots Paducah Ky
As families searched, a Texas medical school cut up their loved ones
Proto Ultima Exoplating
How to Draw a Bubble Letter M in 5 Easy Steps
Solve 100000div3= | Microsoft Math Solver
Gideon Nicole Riddley Read Online Free
Weekly Math Review Q4 3
Carespot Ocoee Photos
Telegram update adds quote formatting and new linking options
The Minneapolis Journal from Minneapolis, Minnesota
Orion Nebula: Facts about Earth’s nearest stellar nursery
Kerry Cassidy Portal
Topos De Bolos Engraçados
Electronic Music Duo Daft Punk Announces Split After Nearly 3 Decades
Mid America Irish Dance Voy
Join MileSplit to get access to the latest news, films, and events!
Craigslist Pets Plattsburgh Ny
Emily Tosta Butt
Rs3 Nature Spirit Quick Guide
Expendables 4 Showtimes Near Malco Tupelo Commons Cinema Grill
Love Words Starting with P (With Definition)
Swsnj Warehousing Inc
6463896344
The Plug Las Vegas Dispensary
How To Find Reliable Health Information Online
La Fitness Oxford Valley Class Schedule
Latest Posts
Article information

Author: Kieth Sipes

Last Updated:

Views: 6202

Rating: 4.7 / 5 (67 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Kieth Sipes

Birthday: 2001-04-14

Address: Suite 492 62479 Champlin Loop, South Catrice, MS 57271

Phone: +9663362133320

Job: District Sales Analyst

Hobby: Digital arts, Dance, Ghost hunting, Worldbuilding, Kayaking, Table tennis, 3D printing

Introduction: My name is Kieth Sipes, I am a zany, rich, courageous, powerful, faithful, jolly, excited person who loves writing and wants to share my knowledge and understanding with you.