Lab4 - HTML - CSS - JS
Lab4 - HTML - CSS - JS
Engineering
Implementing a Web App Using Git
and GitHub for version control
(HTML - CSS - JAVASCRIPT)
Introduction
• HTML to create the
document structure and
content
• CSS to control is visual
aspect
• Javascript for interactivity
Introduction
In this presentation, we’ll explore the three core technologies that power the
web:
Together, these technologies form the foundation for creating engaging and
responsive web experiences. Let’s dive in!
Objectives
1. Understand the Basics of HTML
2. Explore CSS Fundamentals
3. Grasp the Essentials of JavaScript
4. Integrate HTML, CSS, and JavaScript
HTML
HTML stands for Hyper Text Markup Language,
consists of a series of elements that tell the
browser how to display the content.
HTML
• An HTML element is defined by a start tag,
some content, and an end tag:
1. <form>: This tag defines the beginning and end of the form.
Attributes
action: The URL where the form data will be sent (e.g., /submit).
method: The HTTP method for sending the data (usually GET or
POST).
Types:
text: For single-line input like name.
email: For email input with basic validation.
password: For masked password input.
submit: Creates a submit button, The submit button sends the
form data to the server.
<input type="text" id="name" name="name">
<input type="submit">
CSS
CSS stands for Cascading Style Sheets, describes
how HTML elements are going to be displayed
on the screen.
CSS
How to Insert CSS with HTML ?
1. External CSS
With an external style sheet, you can change the look of an entire website by
changing just one file, each HTML page must include a reference to the
external style sheet file inside the <link> element, inside the head section.
The internal style is defined inside the <style> element, inside the head
section.
CSS
How to Insert CSS with HTML ?
3. Inline CSS
An inline style may be used to apply a unique style for a single element.
To use inline styles, add the style attribute to the relevant element. The style
attribute can contain any CSS property.
CSS
CSS Syntax
Selector : The selector points to the HTML element you want to style, can be
tagname as mentioned h1 tag in the above image and can be another pointer
to the html elements (#id, .class).
Declaration : The declaration block contains one or more declarations
separated by semicolons, Each declaration includes a CSS property name and
a value, separated by a colon.
CSS
Some CSS attributes with their possible values
Attribute name Usage Possible values
background-col Sets the background color of an Named colors: red, green, blue
or element etc.
RGB values: rgb(255, 0, 0)
// Strings:
let color = "Yellow";
let lastName = "Johnson";
JavaScript
// Booleans
let x = true;
let y = false;
// Object:
const person = {firstName:"John", lastName:"Doe"};
// Array object:
const cars = ["Saab", "Volvo", "BMW"];
JavaScript
// I won’t be executed
/*
Me too -_-
*/
JavaScript
Example :
function sum(number1, number2) {
let sum = number1 + number2;
return sum;
}
console.log(sum(1,2));
JavaScript
JavaScript output
Example :
<button onclick="window.alert(Date())">The time is?</button>