CSC336-WT Lec3 Slides
CSC336-WT Lec3 Slides
Markup Language: A markup language is a computer language that uses tags to define elements within a document.
1993 1997
<!DOCTYPE html>
<html lang="en">
<head>
<title>Hello!</title>
<meta charset="utf-8">
</head>
<body>
Hello, world!
</body>
</html>
Document Object Model
An HTML element is a
combination of a tag, its
attributes, and the content inside.
What are
Example: <h1>Heading</h1> is an
HTML HTML element.
Elements?
The opening tag (<h1>) and the
closing tag (</h1>) define the
element, with content inside.
Headings: <h1> to <h6> (For defining
headings)
Paragraph: <p> (For paragraphs of text)
Attributes provide
additional information Common attributes:
about HTML elements.
• Example: <img • src (source for images),
src="image.jpg" alt="An • href (link for anchor tags),
image"> • id and class (for styling
and scripting).
Block Level Elements
<div>, <p>,
<h1>, <ul>,
<table>
Inline Elements
Block Elements:
Inline Elements:
HTML Validator is a
Ensures your HTML Tools: W3C Markup
tool used to check
follows W3C Validator, Nu
the syntax of HTML
standards. HTML Checker.
documents.
Importance of Validation
Ensures your
Helps to find
code works
errors and fix
across
them early.
browsers.
Provides
Guarantees
accessibility
proper
compliance
structure and
(important for
better SEO
users with
ranking.
disabilities).
How to Use a Validator