Web Design Complete Lecture Notes
Web Design Complete Lecture Notes
Web Design
+232 76 342693
tjamesbernard01@gmail.com
INSTITUTE OF PUBLIC ADMINISTRATION AND MANAGEMENT
(University of Sierra Leone)
Table of Content
Contents
Table of Content..............................................................................................................................1
PART 1. Introduction to Web Design.............................................................................................4
What is Web Design?..................................................................................................................4
Importance of Web Design..........................................................................................................4
Key Components of Web Design................................................................................................4
Web Design Tools & Technologies.............................................................................................4
Internet, Web, Browser, and Web Pages.....................................................................................4
PART 2: Hypertext Markup Language............................................................................................6
What is HTML?...........................................................................................................................6
Importance of HTML..................................................................................................................6
History of HTML.........................................................................................................................6
Basic Structure of an HTML Document......................................................................................6
.....................................................................................................................................................6
Explanation of Elements..............................................................................................................6
HTML Elements and Tags...........................................................................................................7
Basic Tags................................................................................................................................7
HTML Attributes.........................................................................................................................8
Common Attributes.................................................................................................................8
Global Attributes.....................................................................................................................8
Semantic HTML..........................................................................................................................8
What is Semantic HTML?.......................................................................................................8
Examples of Semantic Tags.....................................................................................................8
Multimedia in HTML..................................................................................................................9
Adding Images.........................................................................................................................9
Embedding Videos...................................................................................................................9
Embedding Audio....................................................................................................................9
HTML Forms and User Input......................................................................................................9
Form Elements........................................................................................................................9
Input Types..............................................................................................................................9
HTML5 New Features.............................................................................................................9
1
ICT1: FOS114 Lecture 1: Introduction to ICT
INSTITUTE OF PUBLIC ADMINISTRATION AND MANAGEMENT
(University of Sierra Leone)
HTML5 Features.....................................................................................................................9
Best Practices in HTML..............................................................................................................9
PART 3: CSS (Cascading Style Sheets)........................................................................................11
1. Introduction to CSS...............................................................................................................11
1.1 What is CSS?...................................................................................................................11
1.2 Importance of CSS...........................................................................................................11
1.3 History of CSS.................................................................................................................11
2. CSS Syntax and Selectors......................................................................................................11
2.1 Basic CSS Syntax............................................................................................................11
2.2 Types of Selectors............................................................................................................11
3. Types of CSS.........................................................................................................................12
3.1 Inline CSS........................................................................................................................12
3.2 Internal CSS.....................................................................................................................12
3.3 External CSS....................................................................................................................12
4. CSS Box Model.....................................................................................................................12
5. CSS Positioning and Layouts................................................................................................12
5.1 Positioning Properties......................................................................................................12
5.2 Display Properties............................................................................................................13
5.3 Flexbox Layout................................................................................................................13
5.4 Grid Layout......................................................................................................................13
6. Responsive Web Design........................................................................................................13
6.1 Media Queries..................................................................................................................13
6.2 Units in CSS....................................................................................................................13
7. CSS Animations and Transitions...........................................................................................14
7.1 Transitions.......................................................................................................................14
7.2 Keyframe Animations......................................................................................................14
8. Advanced CSS Techniques....................................................................................................14
8.1 CSS Variables..................................................................................................................14
8.2 CSS Preprocessors (SCSS, LESS)...................................................................................14
8.3 CSS Frameworks.............................................................................................................14
9. Best Practices in CSS.............................................................................................................15
PART 4: JavaScript.......................................................................................................................16
1. Introduction to JavaScript......................................................................................................16
1.1 What is JavaScript?..........................................................................................................16
2
ICT1: FOS114 Lecture 1: Introduction to ICT
INSTITUTE OF PUBLIC ADMINISTRATION AND MANAGEMENT
(University of Sierra Leone)
3
ICT1: FOS114 Lecture 1: Introduction to ICT
INSTITUTE OF PUBLIC ADMINISTRATION AND MANAGEMENT
(University of Sierra Leone)
JavaScript – Interactivity
4
ICT1: FOS114 Lecture 1: Introduction to ICT
INSTITUTE OF PUBLIC ADMINISTRATION AND MANAGEMENT
(University of Sierra Leone)
2. Web (World Wide Web - WWW): The Web is a service that runs on the Internet.
It consists of websites and web applications that users access through browsers. It uses
protocols like HTTP/HTTPS to retrieve and display content.
3. Web Browser: A web browser (e.g., Chrome, Firefox, Edge) is software that allows
users to access and interact with web pages. It retrieves HTML documents from web
servers, interprets them, and renders them visually for users.
4. Web Pages: A web page is a document on the Web, typically written in HTML, styled
with CSS, and made interactive with JavaScript. Web pages are hosted on web servers
and accessed via browsers using URLs.
5
ICT1: FOS114 Lecture 1: Introduction to ICT
INSTITUTE OF PUBLIC ADMINISTRATION AND MANAGEMENT
(University of Sierra Leone)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My First Web Page</title>
</head>
<body>
<h1>Welcome to HTML</h1>
<p>This is a simple webpage.</p>
</body>
</html>
Explanation of Elements
<!DOCTYPE html> – Declares the document type
<html> – Root element
6
ICT1: FOS114 Lecture 1: Introduction to ICT
INSTITUTE OF PUBLIC ADMINISTRATION AND MANAGEMENT
(University of Sierra Leone)
Paragraphs: <p>
Links: <a href="URL">Click Here</a>
Images: <img src="image.jpg" alt="Description">
Lists:
Unordered List:
<ul>
<li>Item</li>
</ul>
Ordered List:
<ol>
<li>Item</li>
</ol>
Tables:
<table>
<tr>
<th>Header</th>
<th>Header</th>
</tr>
<tr>
<td>Data</td>
<td>Data</td>
</tr>
</table>
7
ICT1: FOS114 Lecture 1: Introduction to ICT
INSTITUTE OF PUBLIC ADMINISTRATION AND MANAGEMENT
(University of Sierra Leone)
Forms:
HTML Attributes
Common Attributes
id – Unique identifier
Semantic HTML
What is Semantic HTML?
Semantic HTML uses meaningful tags to improve accessibility and SEO.
Examples of Semantic Tags
<header> – Defines introductory content
8
ICT1: FOS114 Lecture 1: Introduction to ICT
INSTITUTE OF PUBLIC ADMINISTRATION AND MANAGEMENT
(University of Sierra Leone)
Multimedia in HTML
Adding Images
<img src="image.jpg" alt="Description">
Embedding Videos
<video controls>
<source src="video.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
Embedding Audio
<audio controls>
<source src="audio.mp3" type="audio/mpeg">
Your browser does not support the audio tag.
</audio>
HTML Forms and User Input
Form Elements
9
ICT1: FOS114 Lecture 1: Introduction to ICT
INSTITUTE OF PUBLIC ADMINISTRATION AND MANAGEMENT
(University of Sierra Leone)
10
ICT1: FOS114 Lecture 1: Introduction to ICT
INSTITUTE OF PUBLIC ADMINISTRATION AND MANAGEMENT
(University of Sierra Leone)
h1 {
color: blue;
font-size: 24px;
}
11
ICT1: FOS114 Lecture 1: Introduction to ICT
INSTITUTE OF PUBLIC ADMINISTRATION AND MANAGEMENT
(University of Sierra Leone)
3. Types of CSS
3.1 Inline CSS
<style>
p{
color: blue;
}
</style>
3.3 External CSS
<link rel="stylesheet" href="styles.css">
External CSS example:
body {
background-color: lightgray;
}
4. CSS Box Model
The Box Model consists of:
1. Content – The actual text or image inside an element.
2. Padding – Space around the content.
3. Border – Surrounds padding and content.
4. Margin – Space outside the border.
Example: div {
5. CSS width: 200px;
padding: 20px;
border: 5px solid black;
margin: 10px;
}
Positioning and Layouts
5.1 Positioning Properties
Static (default) – Elements are positioned normally.
12
ICT1: FOS114 Lecture 1: Introduction to ICT
INSTITUTE OF PUBLIC ADMINISTRATION AND MANAGEMENT
(University of Sierra Leone)
.container {
display: flex;
justify-content: center;
align-items: center;
}
5.4 Grid Layout
.container {
display: grid;
grid-template-columns: 1fr 1fr;
}
6. Responsive Web Design
6.1 Media Queries
6.2 Units(max-width:
@media in CSS 600px) {
body { – Pixels (fixed size)
px
background-color: lightblue;
% – Percentage relative to parent
}
} em – Relative to the element’s font size
rem – Relative to the root font size
vh/vw – Viewport height/width
7. CSS Animations and Transitions
13
ICT1: FOS114 Lecture 1: Introduction to ICT
INSTITUTE OF PUBLIC ADMINISTRATION AND MANAGEMENT
(University of Sierra Leone)
7.1 Transitions
div {
transition: background-color 0.5s;
}
div:hover {
background-color: yellow;
}
7.2 Keyframe Animations
@keyframes example {
from { background-color: red; }
to { background-color: yellow; }
}
div {
animation: example 3s infinite;
}
:root {
--main-color: blue;
}
h1 {
color: var(--main-color);
}
8.2 CSS Preprocessors (SCSS, LESS)
SCSS Example:
$main-color: blue;
h1 {
color: $main-color;
}
8.3 CSS Frameworks
Bootstrap
Tailwind CSS
Materialize
14
ICT1: FOS114 Lecture 1: Introduction to ICT
INSTITUTE OF PUBLIC ADMINISTRATION AND MANAGEMENT
(University of Sierra Leone)
15
ICT1: FOS114 Lecture 1: Introduction to ICT
INSTITUTE OF PUBLIC ADMINISTRATION AND MANAGEMENT
(University of Sierra Leone)
PART 4: JavaScript
1. Introduction to JavaScript
1.1 What is JavaScript?
JavaScript is a lightweight, interpreted, or just-in-time compiled programming language with
first-class functions. It is primarily used for creating dynamic and interactive web content.
1.2 Importance of JavaScript
Enables interactivity in web applications.
2. JavaScript Basics
2.1 JavaScript Syntax
console.log("Hello, World!");
Case-sensitive.
16
ICT1: FOS114 Lecture 1: Introduction to ICT
INSTITUTE OF PUBLIC ADMINISTRATION AND MANAGEMENT
(University of Sierra Leone)
3. Control Structures
3.1 Conditional Statements
switch(day) {
case "Monday":
console.log("Start of the week");
break;
case "Friday":
console.log("Weekend is near");
break;
default:
console.log("Regular day");
}
17
ICT1: FOS114 Lecture 1: Introduction to ICT
INSTITUTE OF PUBLIC ADMINISTRATION AND MANAGEMENT
(University of Sierra Leone)
3.3 Loops
4. Functions
4.1 Function Declaration
function greet(name) {
return "Hello, " + name;
}
console.log(greet("Alice"));
4.2 Arrow Functions
5.1 Objects
let person = {
name: "John",
age: 30,
5.2 Arrays
greet: function() {
6. DOM Manipulation
return "Hello " + this.name;
}
};
console.log(person.greet());
18
ICT1: FOS114 Lecture 1: Introduction to ICT
INSTITUTE OF PUBLIC ADMINISTRATION AND MANAGEMENT
(University of Sierra Leone)
7.2 Destructuring
let [a, b] = [10, 20];
console.log(a);
19
ICT1: FOS114 Lecture 1: Introduction to ICT
INSTITUTE OF PUBLIC ADMINISTRATION AND MANAGEMENT
(University of Sierra Leone)
8.3 Async/Await
9. JavaScript Frameworks and Libraries
React.js – UI library for building single-page applications.
20
ICT1: FOS114 Lecture 1: Introduction to ICT
INSTITUTE OF PUBLIC ADMINISTRATION AND MANAGEMENT
(University of Sierra Leone)
21
ICT1: FOS114 Lecture 1: Introduction to ICT
INSTITUTE OF PUBLIC ADMINISTRATION AND MANAGEMENT
(University of Sierra Leone)
22
ICT1: FOS114 Lecture 1: Introduction to ICT