CSC101 (1-6 Week)
CSC101 (1-6 Week)
Web Development
Olaniyan Deborah O. (Ph.D)
Principles of Lecture Etiquette
– Good luck
Introduction to Web Development
• Week 1
• What is Web Development?
Week1: Introduction to Web
Development
• Web Development: The process of creating websites
or web applications.
• Building Blocks:
– HTML (Structure)
– CSS (Presentation)
– JavaScript (Interactivity)
• Types:Static Websites: Fixed content (e.g., personal
blogs, portfolios).
• Dynamic Websites: Change content in response to
user input (e.g., e-commerce, social media).
• Web Applications: Functionality similar to desktop
apps but run in the browser (e.g., Google Docs,
Twitter).
Week1: Introduction to Web
Development
• Types of Web Development
• Front-End Development:
– Focuses on user interface and experience (UI/UX).
– Technologies: HTML, CSS, JavaScript frameworks like React, Angular.
– Tools: Visual Studio Code, Chrome DevTools.
• Back-End Development:
– Focuses on server logic, database management.
– Technologies: Node.js, Python, PHP, databases like MySQL or
MongoDB.
– Tools: Postman (for API testing), command-line interfaces.
• Full-Stack Development:
– Combines both front-end and back-end.
– Full-stack developers handle all aspects of a web project.
Week1: Introduction to Web
Development
• What are Traditional Applications?
• Definition: Software installed on a computer or device (e.g.,
desktop programs).
• Key Features:
– Runs locally, does not rely on internet connectivity.
– Requires installation (e.g., Microsoft Office, Photoshop).
– OS-specific (Windows, macOS).
– Updates need to be manually installed by the user.
• Examples:
– Microsoft Word (desktop version)
– Adobe Photoshop
– Standalone games like "The Sims."
Week1: Introduction to Web
Development
• Web Applications
• Title: What are Web Applications?
• Definition: Applications that run in a web browser, accessible over the
internet.
• Key Features:
– Accessible from any device with internet and a browser.
– No installation required, available immediately via URLs.
– Auto-updates—updates are deployed to the server and are instantly
available to users.
• Examples:
– Google Docs (online word processing)
– Facebook, Twitter (social media)
– Spotify Web Player (streaming music)
Week1: Introduction to Web
Development
Web vs. Traditional Applications
Client-Side Server-Side
Aspect
Programming Programming
Runs on the Runs on the web
Execution
user’s browser server
HTML, CSS, Node.js, PHP,
Languages
JavaScript Python, Ruby
User interface Business logic,
Role
and interaction data management
Depends on the Depends on
Performance
user's device server capacity
Vulnerable to Typically more
Security client-side secure, server-
attacks controlled
Form validation Database queries,
Examples
(JS), Animations user login
Week1: Introduction to Web
Development
• Summary
– Web development involves building applications
that run on browsers using technologies like
HTML, CSS, and JavaScript.
– Web Applications: Accessible anywhere, no
installation required, and automatically updated.
– Traditional Applications: Installed locally on a
device, require manual updates, and are OS-
specific.
– Modern Web Architecture: Client-server model
with APIs, cloud services, and scalable databases.
Week1: Introduction to Web
Development
• Why Web Applications?
• Advantages:
– Cross-Platform: Runs on any device with a browser.
– No Installation: Instant access via a URL, no setup
required.
– Centralized Updates: No need for users to install
updates.
– Cost-Effective: Lower development and distribution
costs.
– Real-Time Collaboration: Web apps often include
real-time features (e.g., Google Docs).
– Security: Centralized control allows developers to
enforce security updates more easily.
Week1: Introduction to Web
Development
• Questions and Discussion
– How does web development improve accessibility
compared to traditional applications?
– What are the key reasons businesses and developers
are shifting to web applications over traditional
software?
– Can you think of any hybrid applications that work
both offline and online?
• (Leave space for interactive discussion, and
encourage students to share examples or
thoughts.)
Overview of Web Programming
Languages
• Week 2
• Overview of Web Programming
Languages
Week 2 – Setting up a Development
Environment
• Setting Up a Web Development Environment
• Text Editors:
– Choose a powerful text editor to write and manage your code.
– Popular options:
• Visual Studio Code: Free and feature-rich with extensions.
• Sublime Text: Lightweight and customizable.
• Atom: Open-source with GitHub integration.
• Browsers for Testing:
– Use modern browsers for development:
• Google Chrome: Includes Chrome Developer Tools for debugging.
• Firefox: Developer-friendly features.
• Safari and Edge: Additional testing for compatibility.
Week 2 – Basic Structure of HTML,
CSS, JavaScript
• HTML (Hypertext Markup Language) is
used to structure content on the web. Explanation
• Basic Structure of an HTML Document:
• <!DOCTYPE html> <!DOCTYPE html>: Declares
<html>
<head>
the document type.
<title>My First Web Page</title>
<style></style>
<html>: Root element of the
<script></script> page.
</head>
<body> <head>: Contains meta-
<h1>Welcome to My Website</h1>
<p>This is my first paragraph.</p> information, such as the
</body> </html>
title.
<body>: Contains the visible
content (e.g., headings,
paragraphs).
Week 2 – Basic Structure of HTML,
CSS, JavaScript
Week 2 – Running Your HTML, CSS,
and JavaScript in Browsers
• How to Run HTML, CSS, and JavaScript:Create a New HTML
File:
– Save your HTML code with a .html extension (e.g., index.html).
• Open in a Web Browser:
– Open the .html file in your browser (double-click the file or right-click
and choose Open with).
• Link CSS and JavaScript:
– CSS: Add a <style> tag in the <head> section.
– JavaScript: Use a <script> tag at the bottom of the <body> section.
• Check the Results:
– Observe how HTML structures the content, CSS styles it, and
JavaScript adds interactivity.
Week 2 – Overview of Web
Programming Languages
• Core Web Programming Languages • Example
• HTML (Hypertext Markup
Language): • HTML: <h1>Welcome
– Structures the content of web pages. to My Website</h1>
– Defines elements like headings,
paragraphs, images, and links. • CSS: h1 { color: blue;
• CSS (Cascading Style Sheets):
– Adds styling and layout to HTML text-align: center;}
content.
– Controls colors, fonts, spacing, and • JAVASCRIPT:
positioning. document.getElementB
• JavaScript:
– Adds interactivity and dynamic
yId("demo").innerHTML
features to web pages. = "Hello World!";
– Manipulates HTML and CSS in real-
time.
Week 2 – Role of HTML in Web
Development
• HTML: The Structure of Web Pages
• Purpose:
– Defines the structure and content of web pages.
– HTML elements are the building blocks of web pages.
• Common HTML Elements:
Headings: <h1> to <h6>
Paragraphs: <p>
Images: <img>
Links: <a>
Lists: <ul>, <ol>, <li>
Tables: <table>
Forms: <form>
Week 2 – HTML, CSS, JavaScript,
Running and Testing Code in Browsers
• Writing Code in CSS Explanation;
• CSS (Cascading Style Sheets) is
used to style HTML content. • Selectors (e.g., h1, p):
• Basic CSS Example: Target HTML elements to
h1 {
color: blue; apply styles.
font-family: Arial, sans-serif;
text-align: center; • Properties (e.g., color, font-
} family, text-align): Specify
p{ the styles.
font-size: 16px;
line-height: 1.5; • Values (e.g., blue, Arial,
}
center): Define the specific
style settings.
Week 2 – Role of JavaScript in Web
Development
• JavaScript: Adding function validateForm() {
Interactivity to Web x=document.getElementById("
Pages fname").value;
• Purpose: if(x==""){
– JavaScript brings web
pages to life by adding alert("Name must not be
interactivity and dynamic empty!")
content.
– Can manipulate both }else{alert("You entered " + x)}
HTML and CSS using the
DOM (Document Object
Model). }
• Examples of JavaScript
Features:
– Real-time form validation
Week 2 – HTML, CSS, JavaScript,
Running and Testing Code in Browsers
• JavaScript adds Explanation;
interactivity and • document.getElementById():
dynamic behavior to Selects an HTML element by its
ID.
web pages.
• Event Listener (onclick): Detects
• Basic JavaScript when the button is clicked.
Example: • alert(): Displays a pop-up
document.getElementById("myButton").onclick = function() { message to the user.
alert("Button was clicked!");
}
• Week 3
• Anatomy of HTML
Week 3 – Anatomy of HTML
• DOCTYPE Declaration • What are Tags?
• What is DOCTYPE? • Tags are special keywords in HTML
– Declares the type of the that define how content should be
document, ensuring proper structured and displayed on a web
rendering by the browser. page. They are enclosed in angle
– For HTML5, it is declared as: brackets (< >).
<!DOCTYPE html> • Tags usually come in pairs:
• Purpose: – An opening tag (e.g., <p>) that
– Ensures the browser understands starts the content.
that the document is in HTML5 – A closing tag (e.g., </p>) that ends
format. the content.
– Helps browsers render the page – The closing tag has a slash (/)
consistently across different before the tag name to show
environments. where the element ends.
Week 3 – Anatomy of HTML
This is a tag
Week 3 – Anatomy of HTML
• What are Elements?
• An element consists of the
opening tag, the content,
and the closing tag (if there
is one).
• Elements can contain text,
images, or even other
elements.
• Example:
– <h1>Hello, World!</h1>
– <h1> is the opening tag.
– Hello, World! is the content.
– </h1> is the closing tag.
</html>
Week 3 – Anatomy of HTML(White-
Spacing)
• White Spacing <p>The moon is drifting away from
Earth.</p>
• When the browser comes <p>The moon is drifting away
across two or more spaces from Earth.</p>
next to each other, it only <p>The moon is drifting away from
displays one space. Similarly Earth.</p>
if it comes across a line • White Space (Preserving Spaces)
break, it treats that as a • To preserve white space, you can
use the <pre> tag, which displays
single space too. This is text exactly as it is written,
known as white space including spaces and line breaks:
collapsing. <pre> This is an example
of text with
• You will often see that web preserved white space. </pre>
page authors take
advantage of white space
collapsing to indent their
code in order to make it
easier to follow.
Week 3 – Anatomy of HTML(Empty
Element)
• Empty elements in HTML are elements that do not have any content between – 4. Input Field: <input>
an opening and a closing tag. They are self-closing and are used for specific
purposes. Here are some common examples:
– The <input> tag is used to create input fields in
forms (like textboxes, checkboxes, etc.).
• 1. Line Break: <br>
<input type="text" placeholder="Enter your name">
• The <br> tag is used to create a line break in the text.
– 6. Link to Stylesheet: <link>
<p>This is the first line.<br>This is the second line.</p>
– The <link> tag is used to link an external
• 2. Horizontal Rule: <hr>
stylesheet to the HTML document.
• The <hr> tag is used to insert a horizontal line, often to separate sections of <link rel="stylesheet" href="styles.css">
content.
– 7. Embed: <embed>
<p>Section 1</p>
– The <embed> tag is used to embed external
<hr> content, like a video or audio file.
<p>Section 2</p> <embed src="video.mp4" width="400" height="300">
• 3. Image: <img> • These are all empty elements because they do
• The <img> tag is used to display images. It does not have any content inside it. not have closing tags or any content between
<img src="image.jpg" alt="Sample Image"> them. They are self-contained and used to
• Note: The src attribute specifies the path to the image, and the alt attribute perform specific actions in an HTML document.
provides alternative text.
Week 3 – Anatomy of
HTML(Quotation)
• Inline Quotation: <q>
• The <q> tag is used for short, inline quotations. It automatically adds – 4. Changes to Content
quotation marks around the text. – Deleted Text: <del>
• <p>He said, <q>This is a wonderful day.</q></p>
– The <del> tag is used to show deleted text, often with a
• Blockquote: <blockquote>
strikethrough.
• The <blockquote> tag is used for longer quotations. It is usually displayed as a
block of text, indented from the rest of the content. – <p>This is <del>incorrect</del> correct information.</p>
<blockquote cite="https://www.example.com"> "The only limit to our realization of tomorrow is our doubts of
today." - Franklin D. Roosevelt </blockquote>
– Inserted Text: <ins>
• 2. Abbreviations and Acronyms – The <ins> tag is used to show inserted or added text,
• Abbreviation: <abbr> often underlined.
• The <abbr> tag is used to indicate abbreviations and acronyms. The title – <p>This is <ins>important</ins> information.</p>
attribute provides the full form when the user hovers over it.
<p>The <abbr title="World Health Organization">WHO</abbr> was established in 1948.</p> – Highlighted Text: <mark>
• 3. Address: <address> – The <mark> tag is used to highlight text, similar to using a
• The <address> tag is used to provide contact information or address details. It marker.
is usually displayed in italic by default.
• <address> Written by John Doe.<br> Email: <a
– <p>Please pay attention to the
href="mailto:[email protected]">[email protected]</a><br> <mark>highlighted</mark> words.</p>
Address: 123 Main Street, Springfield, USA </address> • These examples illustrate how to handle various types of text
formatting and content changes in HTML. Each tag provides a
way to present content meaningfully and accessibly.
Week 3 – Anatomy of HTML(LISTS)
• Here are examples of different types of • 2. Ordered List (<ol>)
lists in HTML, including ordered lists, • An ordered list is used when the order of the
unordered lists, and description lists:
items is important. Each item is marked with a
• 1. Unordered List (<ul>) number.
• An unordered list is used when the order <h2>Steps to Make a Sandwich</h2>
of the items does not matter. Each item is
marked with a bullet point. <ol>
<h2>Fruits</h2> <li>Gather all ingredients.</li> <li>Spread the
<ul> mayonnaise on one slice of bread.</li>
<li>Apple</li> <li>Add lettuce and tomato.</li>
<li>Banana</li> <li>Top with the second slice of bread.</li>
<li>Orange</li>
<li>Grapes</li> </ol>
</ul>
Week 3 – Anatomy of HTML(LISTS)
• 3. Description List (<dl>) • 4. Nested List (<ul>)
• A description list is used to define • In nested unordered lists, the browser will
terms and their descriptions. Each usually change the style of the bullet point too.
term is marked with <dt> and its <ul>
description with <dd>. <li>Mousses</li>
<h2>HTML Elements</h2> <li>Pastries
<ul>
<dl> <li>Croissant</li> <li>Mille-feuille</li> <li>Palmier</li>
<dt>Coffee</dt> <li>Profiterole</li>
</ul>
<dd>A brewed drink prepared from </li>
roasted coffee beans.</dd> <li>Tarts</li>
<dd>Can be served hot or cold.</dd> </ul>
<dt>Tea</dt>
<dd>Aromatic beverage commonly
prepared by pouring hot water over
cured or fresh tea leaves.</dd>
</dl>
Week 3 – Anatomy of HTML(Review
Questions)
• Write an explanation of how the following tags
enhance the accessibility and readability of web
content:
– <abbr> and <q>
– <blockquote> and <address>
– <del>, <ins>, and <mark>
• Instructions: For each tag or pair of tags, give a
brief description of how they work, including
scenarios where they would be particularly
useful. Explain why it's important for web
developers to use these tags correctly, focusing
on accessibility for users with disabilities (e.g.,
screen readers) and clarity for general users.
Week 4 – Creating an HTML Web Page
• Week 4
• Creating an HTML Web Page
Week 4 – Anatomy of HTML(list with
Roman numerals)
• To create a list with • Uppercase Roman Numerals
<ol type="I">
Roman numerals instead <li>First item</li>
<li>Second item</li>
of regular numbers or <li>Third item</li>
lowercase Roman
numerals.
Week 4 – Creating an HTML Web Page
• Week 5
• Semantic HTML
Week 5 – Semantic HTML
• Definition:
• Semantic HTML refers to the use of HTML5 elements that
clearly describe the content they contain.
• These tags give meaning to the structure of a web page, making
it easier for browsers, screen readers, and search engines to
understand the content.
• Example:
<article>
<h2>Latest News</h2>
<p>This is a self-contained section of news content.</p>
</article>
Week 5 – Semantic HTML
• Why Semantic HTML is Important
• Enhanced Readability:
– Semantic HTML makes web pages easier to read and understand for both humans and machines.
• Accessibility:
– Semantic tags help screen readers interpret content for users with disabilities, improving website
accessibility.
• Maintainability:
– Importance: Using semantic tags makes it easier for developers to understand, update, and maintain
the code, even when they’re not familiar with the project.
• Future-Proofing with Web Standards:
– Using semantic HTML ensures that the code is aligned with web standards, making it easier to adapt
and update as the web evolves.
• Faster Development Time:
– Semantic tags eliminate the need for extra classes or comments to explain the structure, which can
speed up the development process.
Week 5 – Semantic HTML
• Accessibility Considerations
• What is Web Accessibility?
– Web accessibility ensures that websites are usable by
people with various disabilities (e.g., vision
impairments).
• How Semantic HTML Helps:
– Tags like <nav>, <header>, and <footer> provide
better context for screen readers.
– Improves navigation and content comprehension for
all users.
Week 5 – Semantic HTML
• SEO Considerations
• What is SEO?
– Search Engine Optimization (SEO) is the practice of improving your
website to increase its visibility in search engine results.
• How Semantic HTML Helps SEO:
– Search engines give preference to clean, well-structured, and
meaningful HTML.
– Helps crawlers understand page layout, giving better ranking based
on relevancy.
• SEO Benefits:
– Search engines use semantic HTML to better index and rank your
site.
– Clean structure improves visibility in search results.
Week 5 – Semantic HTML
• Proper Use of <nav>
• What is the <nav> Element?
– The <nav> element defines a section of a page intended for navigation links.
• Proper Usage:
– Wrap menus or navigational elements in the <nav> tag.
– Helps users and search engines identify the navigation area.
• Example:
<nav>
<ul>
<li><a href="#home">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</nav>
Week 5 – Semantic HTML
• Proper Use of <aside>
• What is the <aside> Element?
– The <aside> element represents content that is indirectly related to
the main content, often used for sidebars or supplementary
information.
• Proper Usage:
– Use <aside> for content like related links, advertisements, or author
bios.
• Example:
<aside>
<h3>About the Author</h3>
<p>Jane Doe is a web developer specializing in accessibility.</p>
</aside>
Week 5 – Semantic HTML
• Proper Use of <section>
• What is the <section> Element?
– The <section> element defines a thematic grouping of content,
typically with a heading.
• Proper Usage:
– Use <section> to logically separate content on a page, such as
chapters, sections of an article, or other related content groups.
• Example:
<section>
<h2>Services We Offer</h2>
<p>We provide web development, SEO services, and more.</p>
</section>
Week 5 – Semantic HTML
• Proper Use of <figure>
• What is the <figure> Element?
– The <figure> element represents self-contained content, often used for
images, diagrams, or code snippets with captions.
• Proper Usage:
– Combine <figure> with the <figcaption> element to provide captions for
images or media.
• Example:
<figure>
<img src="example.jpg" alt="An example image">
<figcaption>Image of an example website layout.</figcaption>
</figure>
Week 5 – Semantic HTML
• Example of Semantic HTML <aside> <h3>Related Links</h3>
• Putting it All Together: <ul>
<header> <li><a
<h1>My Website</h1> href="#blog">Blog</a></li>
<nav> <li><a
<a href="#home">Home</a> href="#portfolio">Portfolio</a
<a href="#services">Services</a> ></li>
<a href="#contact">Contact</a>
</nav> </ul>
</header> </aside>
<section> <footer>
<h2>About Us</h2>
<p>We are a web development <p>© 2024 My
company...</p> Website</p>
</section> </footer>
Week 5 – Semantic HTML
• Week 6
• Anatomy of CSS
Week 6 – Anatomy of CSS
• What is CSS? • CSS allows you to create rules that control
the way that each individual box (and the
• Definition:
contents of that box) is presented.
– CSS (Cascading Style Sheets) is a • CSS Style
language used to style and – Boxes, text and specfic
layout web pages.
• BOXES: Width and height Borders (color,
– It allows control over the look width, and style) Background color and
and feel of an HTML document, images Position in the browser window.
including colors, fonts, spacing,
and layout. • TEXT: Typeface, Size, Color, Italics, bold,
uppercase, lowercase, small-caps
• Basic Example: • SPECIFIC: There are also specific ways in
body { which you can style certain elements such
background-color: lightblue; as lists, tables, and forms.
font-family: Arial, sans-serif;
}
Week 6 – Anatomy of CSS
• CSS Syntax
• CSS Syntax Components:
– Selector: Targets the HTML element
you want to style (e.g., h1, .class,
#id).
– Property: The specific aspect of the
element you want to change (e.g.,
color, font-size).
– Value: The setting you want to
apply to the property (e.g., red,
16px).
• Example:
h1 {
color: blue;
font-size: 24px;
}
Week 6 – Anatomy of CSS
• CSS Selectors
• Types of Selectors:
– Type Selector: Targets all instances of an HTML element
(e.g., p, h1).
– Class Selector: Targets elements with a specific class
attribute, using a dot (.) prefix (e.g., .my-class).
– ID Selector: Targets a unique element with a specific ID,
using a hash (#) prefix (e.g., #my-id).
• Example:
p{
color: gray;
}
.highlight {
background-color: yellow;
}
#main-title {
text-align: center;
}
Week 6 – Anatomy of CSS
Html Code CSS Code
*{
font-family: Arial, Verdana, sans-serif;}
h1 {
font-family: "Courier New", monospace;}
i{
<h1>Potatoes</h1> color: green;}
i{
color: red;}
<p id="intro">There are b{
color: pink;}
<i>dozens</i> pb{
color: blue !important;}
pb{
<b>potato</b> varieties.</p> p{
font-size: 75%;}
h1, h2 { a:active {
text-transform: uppercase; color: darkcyan;}
letter-spacing: 0.2em;
text-align: left;}
p.one {
background-color: #eeeeee;
color: #666666;
text-shadow: 1px 1px 0px #000000;}
Week 6: Anatomy of CSS
Understanding Font Format <body>
<h1>Briards</h1>
<h2>A Heart wrapped in fur</h2>
<p class="intro">The <a class="breed"
href="http://en.wikipedia.org/wikiBriard"> briard</a>, or berger
input { de brie, is a large breed of dog traditionally used as a
padding: 6px 12px 6px 12px; border: herder and guardian of sheep.</p>
1px solid #665544; <h3>Breed History</h3>
color: #ffffff;} <p>The briard, which is believed to have originated in France, has been
bred for
centuries to herd and to protect sheep. The breed was used by the
input.submit:hover { background-color: #665544;} French Army as sentries, messengers and to search for wounded
soldiers because of its fine sense of hearing. Briards were used
in the First World War almost to the point of
input.submit:active { background-color: chocolate;} extinction. Currently the population of briards is slowly recovering.
Charlemagne, Napoleon, Thomas Jefferson and Lafayette all
owned briards.</p>
input.text { <p class="credits">by Ivy Duckett</p><br><br>
color: #cccccc;} <input type=“text” name=“name”/>
<input type=”submit” class=“submit”/>
input.text:focus { </body>
</html>
color: #665544;}
Week 6 – Anatomy of CSS
• Understanding the CSS Box Model
• What is the Box Model?
– Every HTML element is considered as a rectangular box. The CSS Box
Model consists of margins, borders, padding, and the actual content.
• Components of the Box Model:
– Content: The actual content inside the element (e.g., text or image).
– Padding: Space between the content and the border.
– Border: A line surrounding the padding (optional).
– Margin: Space outside the border, separating the element from other
elements.
• Example:
• div {
width: 200px;
padding: 20px;
border: 2px solid black;
margin: 10px;
• }