Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
52 views

HTML, CSS & JavaScript. Become A Front-End Developer 2023

Uploaded by

tonyseneia
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views

HTML, CSS & JavaScript. Become A Front-End Developer 2023

Uploaded by

tonyseneia
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 548

CONTENTS

Introduction to Front End Development


What is HTML, CSS and Javascript
Installation and configuration of the development
environment
Introduction to HTML: basic structure, tags and attributes
Introduction to HTML: basic structure, tags and attributes:
Introduction to HTML
Introduction to HTML: basic structure, tags and attributes:
Basic structure of HTML
Introduction to HTML: basic structure, tags and attributes:
Understanding HTML tags
Introduction to HTML: basic structure, tags and attributes:
Attributes in HTML
Introduction to HTML: Basic Structure, Tags and Attributes:
Heading Tags
Introduction to HTML: Basic Structure, Tags and Attributes:
Paragraph Tags
Introduction to HTML: basic structure, tags and attributes:
Link tags (a)
Chapter 4.7: Introduction to HTML: Basic structure, tags and
attributes: Link tags (a)
Introduction to HTML: basic structure, tags and attributes:
Image tags (img)
Introduction to HTML: basic structure, tags and attributes:
Lists in HTML
Introduction to HTML: basic structure, tags and attributes:
HTML Forms
Introduction to HTML: basic structure, tags and attributes:
Input tags
Introduction to HTML: basic structure, tags and attributes:
Button tags
Introduction to HTML: basic structure, tags and attributes:
Tables in HTML
Introduction to HTML: basic structure, tags and attributes:
Split and span tags
Introduction to HTML: Basic Structure, Tags and Attributes:
Semantic HTML
Introduction to HTML: basic structure, tags and attributes:
Introduction to CSS
Introduction to HTML: basic structure, tags and attributes:
CSS Selectors
Introduction to HTML: basic structure, tags and attributes:
CSS properties and values
Introduction to HTML: basic structure, tags and attributes:
Box Model
Introduction to HTML: basic structure, tags and attributes:
Positioning in CSS
Introduction to HTML: basic structure, tags and attributes:
Flexbox and Grid
Introduction to HTML: basic structure, tags and attributes:
Media Queries
Introduction to HTML: basic structure, tags and attributes:
Introduction to JavaScript
Introduction to HTML: basic structure, tags and attributes:
Variables and data types
Introduction to HTML: basic structure, tags and attributes:
JavaScript Operators
Introduction to HTML: basic structure, tags and attributes:
Control structures (if, switch, for, whi
Introduction to HTML: basic structure, tags and attributes:
Functions in JavaScript
Introduction to HTML: basic structure, tags and attributes:
Objects and arrays
Introduction to HTML: basic structure, tags and attributes:
DOM manipulation
Introduction to HTML: basic structure, tags and attributes:
Events in JavaScript
Introduction to HTML: basic structure, tags and attributes:
AJAX and Fetch API
Introduction to HTML: basic structure, tags and attributes:
Introduction to ES6+
Introduction to HTML: basic structure, tags and attributes:
Promises and async/await
Introduction to HTML: basic structure, tags and attributes:
Introduction to Node.js and NPM
Introduction to HTML: basic structure, tags and attributes:
Popular frameworks and libraries (React,
Formatting text with HTML
Lists and tables in HTML
Forms and inputs in HTML
Introduction to CSS: selectors, properties and values
Introduction to CSS: selectors, properties and values:
Introduction to CSS
Introduction to CSS: selectors, properties and values:
Understanding what CSS selectors are
Introduction to CSS: selectors, properties and values: Types
of CSS selectors: Element, Class and ID
Introduction to CSS: Selectors, Properties, and Values:
Combining CSS Selectors
Introduction to CSS: Selectors, Properties and Values:
Introduction to CSS Properties
Introduction to CSS: selectors, properties and values: How to
use and understand CSS properties
Introduction to CSS: selectors, properties and values:
Introduction to values ​in CSS
Introduction to CSS: selectors, properties and values:
Different types of values ​in CSS: Colors, S
Introduction to CSS: selectors, properties and values: How to
apply values ​to CSS properties
Introduction to CSS: selectors, properties and values:
Understanding cascade and inheritance in CSS
Introduction to CSS: Selectors, Properties, and Values: How
to Use the Element Inspector to Debug CS
Text styling with CSS
Layout and positioning with CSS
Box model and padding, border and margin
Colors and backgrounds in CSS
Chapter 12 of our e-book focuses on a crucial aspect of CSS,
namely colors and backgrounds. Colors a
Pseudoclasses and pseudoelements in CSS
Animations and transitions in CSS
Responsive design with media queries
Introduction to Bootstrap
Using grids and containers in Bootstrap
Bootstrap components: buttons, forms, carousel
Introduction to Javascript: variables, data types, operators
Introduction to Javascript: variables, data types, operators:
Introduction to Javascript
Introduction to Javascript: variables, data types, operators:
Variables in Javascript
Introduction to Javascript: variables, data types, operators:
Data Types in Javascript
Introduction to Javascript: variables, data types, operators:
Operators in Javascript
Control structures in Javascript: if, for, while
Functions in Javascript
Chapter 21: Functions in Javascript
Objects and arrays in Javascript
DOM and HTML element manipulation with Javascript
Events and listeners in Javascript
Forms and Data Validation with Javascript
Introduction to jQuery
Effects and animations with jQuery
Ajax and HTTP requests with Javascript
Introduction to React.js
Chapter 29: Introduction to React.js
Components and State in React.js
Routes and navigation in React.js
Introduction to Vue.js
Directives and Components in Vue.js
State Management with Vuex
Chapter 34: State Management with Vuex
Introduction to Angular.js
Components and Services in Angular.js
Forms and Data Validation with Angular.js
Good coding and project organization practices
Code versioning with Git
Deployment of Front End applications
Chapter 40: Front End Application Deployment
Unit and integration tests in Javascript
SEO and web accessibility
Website performance and optimization
Browser Development Tools
Working with APIs and JSON data
​Introduction to Node.js and Express.js
Websockets and real-time communication
Working with NoSQL databases: MongoDB
Authentication and authorization with JWT
Web Security: CORS, CSRF, XSS
Introduction to TypeScript
Chapter 51: Introduction to TypeScript
Webpack and build tools
CSS Preprocessors: SASS and LESS
CSS Frameworks: Materialize, Bulma, Tailwind
Front End software architecture: MVC, MVVM
Javascript Design Patterns
Functional Programming in Javascript
Reactive Programming with RxJS
GraphQL and Apollo Client
Chapter 59: GraphQL and Apollo Client
Web Components and Shadow DOM
Progressive Web Apps (PWA)
Chapter 61: Progressive Web Apps (PWA)
Mobile development with React Native
Game Development with Phaser.js
WebVR and virtual reality on the web
WebAssembly and web performance
Artificial intelligence on the web with TensorFlow.js
Web scraping with Puppeteer
Introduction to Docker and containers
Introduction to DevOps and CI/CD
Working with Content Management System
Introduction to SEO and Website Optimization
Analytics and website monitoring
UX/UI Design for Developers
Project management with Agile and Scrum
Job Interview and Career Development Front End
All answers
Summary
__________________
1 ..... Introduction to Front End Development
2 ..... What is HTML, CSS and Javascript
3 ..... Installation and configuration of the
development environment
4 ..... Introduction to HTML: basic structure, tags and
attributes
5 ..... 4.Introduction to HTML: basic structure, tags
and attributes: Introduction to HTML
6 ..... 4.Introduction to HTML: basic structure, tags
and attributes: Basic structure of HTML
7 ..... 4.Introduction to HTML: basic structure, tags
and attributes: Understanding HTML tags
8 ..... 4.Introduction to HTML: basic structure, tags
and attributes: Attributes in HTML
9 ..... 4.Introduction to HTML: Basic Structure, Tags
and Attributes: Heading Tags
10 ..... 4.Introduction to HTML: Basic Structure, Tags
and Attributes: Paragraph Tags
11 ..... 4.Introduction to HTML: basic structure, tags
and attributes: Link tags (a)
12 ..... 4.Introduction to HTML: basic structure, tags
and attributes: Image tags (img)
13 ..... 4.Introduction to HTML: basic structure, tags
and attributes: Lists in HTML
14 ..... 4.Introduction to HTML: basic structure, tags
and attributes: HTML Forms
15 ..... 4.Introduction to HTML: basic structure, tags
and attributes: Input tags
16 ..... 4.Introduction to HTML: basic structure, tags
and attributes: Button tags
17 ..... 4.Introduction to HTML: basic structure, tags
and attributes: Tables in HTML
18 ..... 4.Introduction to HTML: basic structure, tags
and attributes: Split and span tags
19 ..... 4.Introduction to HTML: Basic Structure, Tags
and Attributes: Semantic HTML
20 ..... 4.Introduction to HTML: basic structure, tags
and attributes: Introduction to CSS
21 ..... 4.Introduction to HTML: basic structure, tags
and attributes: CSS Selectors
22 ..... 4.Introduction to HTML: basic structure, tags
and attributes: CSS properties and values
23 ..... 4.Introduction to HTML: basic structure, tags
and attributes: Box Model
24 ..... 4.Introduction to HTML: basic structure, tags
and attributes: Positioning in CSS
25 ..... 4.Introduction to HTML: basic structure, tags
and attributes: Flexbox and Grid
26 ..... 4.Introduction to HTML: basic structure, tags
and attributes: Media Queries
27 ..... 4.Introduction to HTML: basic structure, tags
and attributes: Introduction to JavaScript
28 ..... 4.Introduction to HTML: basic structure, tags
and attributes: Variables and data types
29 ..... 4.Introduction to HTML: basic structure, tags
and attributes: JavaScript Operators
30 ..... 4.Introduction to HTML: basic structure, tags
and attributes: Control structures (if, switch, for,
while)
31 ..... 4.Introduction to HTML: basic structure, tags
and attributes: Functions in JavaScript
32 ..... 4.Introduction to HTML: basic structure, tags
and attributes: Objects and arrays
33 ..... 4.Introduction to HTML: basic structure, tags
and attributes: DOM manipulation
34 ..... 4.Introduction to HTML: basic structure, tags
and attributes: Events in JavaScript
35 ..... 4.Introduction to HTML: basic structure, tags
and attributes: AJAX and Fetch API
36 ..... 4.Introduction to HTML: basic structure, tags
and attributes: Introduction to ES6+
37 ..... 4.Introduction to HTML: basic structure, tags
and attributes: Promises and async/await
38 ..... 4.Introduction to HTML: basic structure, tags
and attributes: Introduction to Node.js and NPM
39 ..... 4.Introduction to HTML: basic structure, tags
and attributes: Popular frameworks and libraries
(React, Angular, Vue)
40 ..... Formatting text with HTML
41 ..... Lists and tables in HTML
42 ..... Forms and inputs in HTML
43 ..... Introduction to CSS: selectors, properties and
values
44 ..... 8.Introduction to CSS: selectors, properties
and values: Introduction to CSS
45 ..... 8.Introduction to CSS: selectors, properties
and values: Understanding what CSS selectors are
46 ..... 8.Introduction to CSS: selectors, properties
and values: Types of CSS selectors: Element, Class
and ID
47 ..... 8.Introduction to CSS: Selectors, Properties,
and Values: Combining CSS Selectors
48 ..... 8.Introduction to CSS: Selectors, Properties
and Values: Introduction to CSS Properties
49 ..... 8.Introduction to CSS: selectors, properties
and values: How to use and understand CSS
properties
50 ..... 8.Introduction to CSS: selectors, properties
and values: Introduction to values ​in CSS
51 ..... 8.Introduction to CSS: selectors, properties
and values: Different types of values ​in CSS: Colors,
Sizes and Units
52 ..... 8.Introduction to CSS: selectors, properties
and values: How to apply values ​to CSS properties
53 ..... 8.Introduction to CSS: selectors, properties
and values: Understanding cascade and inheritance
in CSS
54 ..... 8.Introduction to CSS: Selectors, Properties,
and Values: How to Use the Element Inspector to
Debug CSS
55 ..... Text styling with CSS
56 ..... Layout and positioning with CSS
57 ..... Box model and padding, border and margin
58 ..... Colors and backgrounds in CSS
59 ..... Pseudoclasses and pseudoelements in CSS
60 ..... Animations and transitions in CSS
61 ..... Responsive design with media queries
62 ..... Introduction to Bootstrap
63 ..... Using grids and containers in Bootstrap
64 ..... Bootstrap components: buttons, forms,
carousel
65 ..... Introduction to Javascript: variables, data
types, operators
66 ..... 19.Introduction to Javascript: variables, data
types, operators: Introduction to Javascript
67 ..... 19.Introduction to Javascript: variables, data
types, operators: Variables in Javascript
68 ..... 19.Introduction to Javascript: variables, data
types, operators: Data Types in Javascript
69 ..... 19.Introduction to Javascript: variables, data
types, operators: Operators in Javascript
70 ..... Control structures in Javascript: if, for, while
71 ..... Functions in Javascript
72 ..... Objects and arrays in Javascript
73 ..... DOM and HTML element manipulation with
Javascript
74 ..... Events and listeners in Javascript
75 ..... Forms and Data Validation with Javascript
76 ..... Introduction to jQuery
77 ..... Effects and animations with jQuery
78 ..... Ajax and HTTP requests with Javascript
79 ..... Introduction to React.js
80 ..... Components and State in React.js
81 ..... Routes and navigation in React.js
82 ..... Introduction to Vue.js
83 ..... Directives and Components in Vue.js
84 ..... State Management with Vuex
85 ..... Introduction to Angular.js
86 ..... Components and Services in Angular.js
87 ..... Forms and Data Validation with Angular.js
88 ..... Good coding and project organization
practices
89 ..... Code versioning with Git
90 ..... Deployment of Front End applications
91 ..... Unit and integration tests in Javascript
92 ..... SEO and web accessibility
93 ..... Website performance and optimization
94 ..... Browser Development Tools
95 ..... Working with APIs and JSON data
96 ..... ​Introduction to Node.js and Express.js
97 ..... Websockets and real-time communication
98 ..... Working with NoSQL databases: MongoDB
99 ..... Authentication and authorization with JWT
100 ..... Web Security: CORS, CSRF, XSS
101 ..... Introduction to TypeScript
102 ..... Webpack and build tools
103 ..... CSS Preprocessors: SASS and LESS
104 ..... CSS Frameworks: Materialize, Bulma,
Tailwind
105 ..... Front End software architecture: MVC, MVVM
106 ..... Javascript Design Patterns
107 ..... Functional Programming in Javascript
108 ..... Reactive Programming with RxJS
109 ..... GraphQL and Apollo Client
110 ..... Web Components and Shadow DOM
111 ..... Progressive Web Apps (PWA)
112 ..... Mobile development with React Native
113 ..... Game Development with Phaser.js
114 ..... WebVR and virtual reality on the web
115 ..... WebAssembly and web performance
116 ..... Artificial intelligence on the web with
TensorFlow.js
117 ..... Web scraping with Puppeteer
118 ..... Introduction to Docker and containers
119 ..... Introduction to DevOps and CI/CD
120 ..... Working with Content Management System
121 ..... Introduction to SEO and Website
Optimization
122 ..... Analytics and website monitoring
123 ..... UX/UI Design for Developers
124 ..... Project management with Agile and Scrum
125 ..... Job Interview and Career Development Front
End
INTRODUCTION TO
FRONT END
DEVELOPMENT
::: Introduction to Front End Development :::
Front End development, also known as user interface
development, is a crucial part of building websites and web
applications. It is the part of web development that deals
with direct user interaction. Front End development uses
technologies such as HTML, CSS and JavaScript to create
attractive and functional user interfaces. In this course, we
will cover the fundamental concepts of these three
technologies and how they work together to create the user
experience on the web.
::: What is Front End Development? :::
Front End Development is the aspect of website
development that deals with creating the user interface.
This interface is where users interact directly with the
website or web application. The goal of Front End
development is to create an intuitive and engaging user
experience that is easy to use and aesthetically pleasing.
Front End developers use various technologies to create this
user interface. The main three are HTML, CSS and
JavaScript. HTML is used to create the basic structure of a
web page, CSS is used to style that structure, and JavaScript
is used to add functionality and interactivity to the page.
::: HTML - Hypertext Markup Language :::
HTML, which stands for Hypertext Markup Language, is the
backbone of any website. It is a markup language that is
used to structure content on a web page. Each element on a
web page is represented by an HTML tag, which defines the
type of content the element contains and how it should be
displayed in the browser.
HTML is a markup language, which means it uses tags to
define elements. Each tag has a specific name and
represents a specific type of content. For example, the
<h1> is used to define a first-level header, while the <p> is
used to define a paragraph.
::: CSS - Cascading Style Sheets :::
CSS, or Cascading Style Sheets, is a styling language that is
used to describe the appearance of a document written in
HTML. CSS is used to style HTML, allowing developers to
define the color, size, font, and other visual aspects of HTML
elements on a web page.
CSS is a styling language, which means it is used to define
the appearance of HTML elements on a page. CSS uses
selectors to identify the HTML elements that should be
styled and declarations to define how those elements should
be styled. For example, a selector can be used to identify all
elements <p> on a page, and a declaration can be used to
set the text color of these elements to blue.
::: JavaScript - Script Programming Language :::
JavaScript is a scripting programming language that is used
to make web pages interactive. JavaScript allows developers
to add functionality to a web page, such as the ability to
respond to button clicks, dynamically update content, and
perform complex calculations.
JavaScript is a programming language, which means it is
used to create programs that control the behavior of a web
page. JavaScript uses variables, functions, loops, and other
programming constructs to manipulate HTML elements on a
page and create interactivity.
In summary, Front End development is a complex and
multifaceted discipline that requires a solid understanding of
various technologies. However, with proper study and
practice, anyone can learn to become a competent Front
End developer. This course is designed to provide you with a
solid foundation in HTML, CSS and JavaScript, the three
fundamental technologies of Front End development.
Throughout this course, you will gain an in-depth
understanding of these technologies and learn how to use
them to create websites and applications attractive and
functional website.
Answer the question about the previous content:

Exercise 1: What is the


objective of Front End
development?
( A ) - Create an intuitive and engaging user experience that
is easy to use and aesthetically pleasing.
( B ) - Develop the back end of the website that deals with
the database and server.
( C ) - Focusing exclusively on website programming and
functionality, ignoring design and user experience.

Note: The correct answer is on the last page.


WHAT IS HTML, CSS
AND JAVASCRIPT
HTML, CSS and JavaScript are three of the main
technologies used in building websites and web
applications. Together, these technologies form the basis for
front-end development, which is the part of software
development that deals with direct user interaction.
::: What is HTML? :::
HTML, or Hyper Text Markup Language, is the standard
markup language for creating web pages. It is the backbone
of any website and is responsible for the structure and
content of the page. HTML is not a programming language,
but a markup language. This means it is used to "tag"
content with tags that define what each piece of content is
(e.g., a title, a paragraph, an image, etc.).
An HTML document is composed of HTML elements, which
are represented by tags. These tags are used to define the
structure of the content. For example, the <h1> is used to
define a title, the <p> is used to define a paragraph, the
<img> is used to insert an image, and so on. In addition,
HTML also allows the inclusion of links, forms, lists, tables
and much more.
::: What is CSS? :::
CSS, or Cascading Style Sheets, is a style language used to
describe the appearance of a document written in HTML.
While HTML is used to structure content, CSS is used to
format that content. This includes things like colors, fonts,
spacing, layout, and more.
A CSS stylesheet consists of a list of rules. Each rule is
composed of a selector and a set of declarations. The
selector specifies which page elements the rule applies to,
and the declarations define what to do with those elements.
For example, you might have a rule that applies the color
red to all paragraphs on a page, or a rule that sets the font
and text size for all headings on a page.
One of the great advantages of CSS is that it allows you to
separate content (HTML) from presentation (CSS). This
makes the code easier to maintain and allows you to change
the look of an entire site just by changing a single
stylesheet.
::: What is JavaScript? :::
JavaScript is a programming language that is used to make
web pages interactive. While HTML is used for structure and
CSS for formatting, JavaScript is used for functionality. This
includes things like reacting to button clicks, dynamically
updating content, performing calculations, validating forms,
creating animations, and more.
One of the great advantages of JavaScript is that it runs in
the browser, which means that no server-side processing is
required. This makes JavaScript ideal for tasks that need to
be performed client-side, such as validating user input
before submitting a form.
In addition, JavaScript can also be used server-side through
technologies such as Node.js. This means you can use the
same programming language on both the front-end and
back-end, which can simplify code development and
maintenance.
In summary, HTML, CSS and JavaScript are three
fundamental technologies for any front-end developer. HTML
is used for structure, CSS for formatting, and JavaScript for
functionality. Together, these technologies allow you to
create rich, interactive websites and web applications.
Answer the question about the previous content:

Exercise 2: Which of the


following statements
correctly describes the
role of HTML, CSS, and
JavaScript technologies in
front-end development?
( A ) - JavaScript is used for structure, CSS for functionality,
and HTML for formatting.
( B ) - HTML is used for structure, CSS for functionality, and
JavaScript for formatting.
( C ) - HTML is used for structure, CSS for formatting, and
JavaScript for functionality.

Note: The correct answer is on the last page.


INSTALLATION AND
CONFIGURATION OF
THE DEVELOPMENT
ENVIRONMENT
Before diving into the world of Front End development with
HTML, CSS and JavaScript, it is essential to have a suitable
development environment installed and configured on your
computer. This chapter of our e-book will guide you through
the process of installing and configuring your development
environment.
::: 1. Installing a text editor :::
A text editor is a fundamental tool for any developer. It is
used to write and edit code. There are many text editors
available, but we recommend using Visual Studio Code (VS
Code) because of its user-friendly interface and powerful
features.
To install VS Code, visit the official website
(https://code.visualstudio.com/) and follow the instructions
for your specific operating system. After installation, you
can customize VS Code by installing extensions to improve
your coding experience. Some useful extensions include
Live Server, for previewing your web pages in real time, and
Prettier, for automatically formatting your code.
::: 2. Installing a web browser :::
As a Front End developer, you will need a web browser to
view and test your web pages. We recommend using Google
Chrome or Mozilla Firefox due to their excellent developer
features.
To install Google Chrome, visit the official website
(https://www.google.com/chrome/) and follow the
installation instructions. To install Mozilla Firefox, visit the
official website (https://www.mozilla.org/en-US/firefox/new/)
and follow the installation instructions.
Once installed, you can access your browser's developer
tools by pressing F12 on your keyboard. These tools allow
you to inspect and edit your HTML, CSS, and JavaScript code
in real time, as well as provide useful debugging features.
::: 3. Installing Node.js and NPM :::
Node.js is a JavaScript runtime environment that allows you
to run JavaScript code outside of a web browser. Node.js
comes with NPM (Node Package Manager), which is a tool
that allows you to install JavaScript libraries and packages to
use in your projects.
To install Node.js and NPM, visit the official Node.js website
(https://nodejs.org/) and download the LTS (Long Term
Support) version. Follow the installation instructions and at
the end you will be able to verify the installation by opening
a terminal and typing "node -v" and "npm -v". If both
statements return a version, then the installation was
successful.
::: 4. Configuring the development environment :::
With all the tools installed, you can now configure your
development environment. First, organize your folder
structure. Create a folder for your project and within that
create separate folders for your HTML, CSS and JavaScript
code.
In VS Code, you can open your project folder by clicking
"File" -> "Open Folder" and selecting your project folder.
Now, you can create HTML, CSS and JavaScript files within
the respective folders by right-clicking the folder and
selecting "New File".
Finally, you can launch the VS Code live server by right-
clicking your HTML file and selecting "Open with Live
Server." This will open your project in a web browser and
any changes you make to your code will be reflected in real
time.
With these steps complete, you are ready to start coding!
Remember, practice makes perfect. So, start building simple
projects and gradually work on more complex projects. You
will soon become a proficient Front End developer.
Answer the question about the previous content:

Exercise 3: What is the


recommended tool for
writing and editing code in
Front End development
and what are some of its
useful extensions?
( A ) - Google Chrome, with extensions such as Live Server
and Prettier.
( B ) - Mozilla Firefox, with extensions such as Live Server
and Prettier.
( C ) - Visual Studio Code (VS Code), with extensions such as
Live Server and Prettier.

Note: The correct answer is on the last page.


INTRODUCTION TO
HTML: BASIC
STRUCTURE, TAGS AND
ATTRIBUTES

Introduction to HTML: basic structure, tags and attributes

::: Introduction to HTML :::


HTML, or Hyper Text Markup Language, is the standard
markup language for creating web pages and applications. It
describes the structure of a web page and consists of a
series of HTML elements, also known as tags, that the
browser uses to render content.
::: Basic structure :::
A basic HTML document follows a specific structure. It starts
with the document type which tells the browser that this is
an HTML5 document. Next, we have the <html> which
involves the entire content of the page. Within this tag, we
have two main parts: the <head> and the <body>.
The <head> contains metadata about the document, such
as the page title (displayed in the browser tab), links to CSS
files, character definitions, and other information that is not
visible to the user.
The <body> This is where we place all the content that we
want to be visible to users when they visit our page. This
can include text, images, videos, links, lists, tables and
more.
::: Tags :::
HTML tags are the foundation of any web page. They tell the
browser how content should be interpreted and displayed.
Tags are enclosed in angle brackets (< and >) and most
tags have an opening and closing tag, with the content
between them. For example, the <p> is used for
paragraphs of text. To create a paragraph, you would
enclose your text between the opening tag <p> and the
closing tag </p>.
There are many HTML tags, each with its own purpose and
use. Some of the most common include <h1> to <h6> for
headers, <a> for links, <img> for images, <ul> and <li>
for unordered lists, and <table>, <tr> and <td> for tables.
::: Attributes :::
HTML attributes are used to provide additional information
about an element. They are placed in the opening tag and
consist of an attribute name and an attribute value,
separated by an equals sign. For example, the image tag
<img> uses the 'src' attribute to specify the URL of the
image that should be displayed, and the 'alt' attribute to
provide alternative text that will be displayed if the image
cannot be loaded.
Other common attributes include 'id' and 'class' for CSS
styling, 'href' for specifying the URL of a link, and 'style' for
adding CSS directly to an element.
Understanding the basic structure, tags and attributes of
HTML is the first step towards becoming a front-end
developer. With this foundation, you can start exploring CSS
and JavaScript to add style and functionality to your web
page.
Answer the question about the previous content:

Exercise 4: What is the


function of the
&lt;head&gt; in an HTML
document?
( A ) - To indicate to the browser how content should be
interpreted and displayed.
( B ) - To place all the content that we want to be visible to
users when they visit our page.
( C ) - To contain metadata about the document, such as the
page title, links to CSS files, character definitions, and other
information that is not visible to the user.

Note: The correct answer is on the last page.


INTRODUCTION TO
HTML: BASIC
STRUCTURE, TAGS AND
ATTRIBUTES:
INTRODUCTION TO
HTML

4.1. Introduction to HTML: basic structure, tags and


attributes

::: Introduction to HTML :::


HTML (HyperText Markup Language) is the main language
for creating websites and web applications. It is not a
programming language, but a markup language. HTML
allows you to structure your web page, add content, and
make text display how you want. It is the backbone of any
website and is an essential skill for any front-end developer.
::: Basic structure of HTML :::
A basic HTML document has a specific structure that
includes the following parts:
---Doctype: The first line of any HTML document is the
doctype declaration. It tells the browser what type of
document to expect. In HTML5, the doctype declaration is
very simple: ``.
---HTML Element: The HTML element is the root element of
an HTML page. All other elements must be descendants of
this element.
---Head Element: The head element contains metadata
(data about the data) that is not displayed on the web page
itself, but is machine readable. It typically contains the page
title and links to scripts and stylesheets.
---Body Element: The body element contains the main
content of the web page, which is displayed in the browser.

::: HTML Tags :::


HTML tags are the main syntax of HTML. They are used to
create HTML elements and consist of a tag name
surrounded by angle brackets. HTML tags come in pairs,
which consist of an opening tag and a closing tag.
For example, here is a paragraph tag: `This is a paragraph.`.
The opening tag is `` and the closing tag is ``. The content
inside the tags is the content of the element.
::: HTML Attributes :::
HTML attributes are used to add additional information to
HTML elements. They come in name-value pairs and are
placed inside the opening tag of an element.
For example, here is an image element with a src attribute:
`<img src="image.jpg">`. The attribute name is "src" and
the attribute value is "image.jpg". This attribute tells the
browser where to find the image that should be displayed.
::: Conclusion :::
This is a basic introduction to HTML. Learning HTML is the
first step towards becoming a web developer. However,
HTML is just the tip of the iceberg. To create interactive and
dynamic websites, you will also need to learn CSS and
JavaScript. But don't worry, we'll cover these topics in detail
in the next chapters.
Answer the question about the previous content:

Exercise 5: What is the


function of the "src"
attribute in an HTML
image tag?
( A ) - Tells the browser the size of the image to be
displayed.
( B ) - Tells the browser where to find the image to be
displayed.
( C ) - Tells the browser the color of the image to be
displayed.

Note: The correct answer is on the last page.


INTRODUCTION TO
HTML: BASIC
STRUCTURE, TAGS AND
ATTRIBUTES: BASIC
STRUCTURE OF HTML
HTML, which stands for Hyper Text Markup Language, is the
standard markup language for creating web pages and
applications. It is one of the main tools that any front-end
developer must master. This module of our e-book course
will introduce the basic structure of HTML, its tags and
attributes.
::: Basic structure of HTML :::
An HTML document is made up of a series of elements, each
represented by a tag. The basic structure of an HTML
document looks like this:
____________________________________________
<!DOCTYPE html>
<html>
<head>
<title>Page title</title>
</head>
<body>
Page content goes here.
</body>
</html>
____________________________________________
The <!DOCTYPE html> at the beginning of the document is
a declaration that tells the browser that this is an HTML5
document. The <html> involves the entire content of the
page. Within this tag, we have two other important tags:
<head> and <body>.
The <head> contains information about the page that is not
visible to the user, such as the page title (which appears in
the browser's title bar) and links to external CSS and
JavaScript files. The <body> contains all the content that
the user sees, such as text, images, links, etc.
::: HTML Tags :::
HTML tags are the foundation of any web page. They define
the structure and layout of the page, and can be used to
add text, images, links and other elements. Here are some
of the most common tags:

---<h1> a <h6>: These tags are used to add titles and


subtitles. <h1> is the most important title (and usually the
largest in size), while <h6> is the least important.
---<p>: This tag is used to add paragraphs of text.
---<a>: This tag is used to add links.
---<img>: This tag is used to add images.
---<div>: This tag is used to group other elements.

::: HTML Attributes :::


HTML attributes are used to provide additional information
about an element. They are always specified at the
beginning of the tag and have the following structure:
attribute_name="attribute_value". Here are some of the
most common attributes:

---class: This attribute is used to specify one or more


classes for an element. Classes are used to select elements
with CSS and JavaScript.
---id: This attribute is used to specify a unique identifier for
an element. The id must be unique within the document.
---src: This attribute is used to specify the source of a
media element, such as an image or video.
---href: This attribute is used to specify the URL of a link.
---alt: This attribute is used to specify alternative text for
an image, which will be displayed if the image cannot be
loaded.

In short, HTML is the backbone of any web page. Mastering


the basic structure of HTML, its tags and attributes is
essential for any front-end developer. In the next module of
our e-book course, we will explore CSS, the language used
to style HTML pages and create attractive, responsive
layouts.
Answer the question about the previous content:

Exercise 6: What does the


&lt;head&gt; in HTML
contains?
( A ) - All content visible to the user, such as text, images,
links, etc.
( B ) - Information about the page that is not visible to the
user, such as the page title and links to external CSS and
JavaScript files.
( C ) - The classes used to select elements with CSS and
JavaScript.

Note: The correct answer is on the last page.


INTRODUCTION TO
HTML: BASIC
STRUCTURE, TAGS AND
ATTRIBUTES:
UNDERSTANDING HTML
TAGS
::: Introduction to HTML: Basic Structure, Tags and Attributes
:::
HTML, or HyperText Markup Language, is the standard
markup language for creating web pages and applications.
Understanding the basic structure of HTML, as well as tags
and attributes, is critical for any front-end developer. In this
chapter, we will explore these concepts in detail.
::: Basic structure of HTML :::
An HTML document is made up of HTML elements, which are
indicated by tags. Each HTML document begins with the
document type declaration , which tells the browser that the
document is an HTML5 file. The tag <html> that involves
the entire content of the page.
____________________________________________
<!DOCTYPE html>
<html>
...
</html>
____________________________________________
Within the <html> tag, we have two main parts: the
<head> and <body>. The <head> contains metadata
about the document, such as the page title (<title> tag),
links to CSS stylesheets (<link> tag), and JavaScript scripts
(<script> tag). The <body> contains the actual content of
the page that is visible to users.
____________________________________________
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
Page content...
</body>
</html>
____________________________________________
::: HTML Tags :::
HTML tags are used to define elements in an HTML
document. They are surrounded by angle brackets (< and
>). Most tags come in pairs and wrap around the content
they are affecting. For example, the <p> is used to create a
paragraph:
____________________________________________
<p>This is a paragraph.</p>
____________________________________________
There are many HTML tags, each with its own purpose.
Some of the most common include <h1> to <h6> for
headers, <a> for links, <img> for images, <ul> and <li>
for lists, and <div> and <span> to group elements.
::: HTML Attributes :::
HTML attributes are used to provide additional information
about an element. They are always specified at the
beginning of the opening tag and usually come in
name/value pairs. For example, the <a> generally uses the
href attribute to specify the link URL:
____________________________________________
<a href="https://www.example.com">This is a link</a>
____________________________________________
Other common attributes include src to specify the font of
an image, alt to specify alternative text for an image, and
style to add CSS styles to an element.
In short, HTML is the backbone of any web page.
Understanding the basic structure of HTML, as well as tags
and attributes, is the first step to becoming an effective
front-end developer. In the next chapter, we will explore CSS
and how it is used to style HTML elements.
Answer the question about the previous content:

Exercise 7: What is the


function of the
&lt;head&gt; in an HTML
document?
( A ) - It is used to create a paragraph.
( B ) - Contains the actual content of the page that is visible
to users.
( C ) - Contains metadata about the document, such as the
page title, links to CSS stylesheets, and JavaScript scripts.

Note: The correct answer is on the last page.


INTRODUCTION TO
HTML: BASIC
STRUCTURE, TAGS AND
ATTRIBUTES:
ATTRIBUTES IN HTML
::: 4.4. Introduction to HTML: Basic structure, tags and
attributes :::
HTML, which stands for HyperText Markup Language, is the
standard markup language for creating web pages. It is
used to describe the structure and content of a web
document, and is made up of a series of elements or 'tags'
that the browser interprets to display the web page as the
developer intended.
::: Basic structure of an HTML document :::
A basic HTML document starts with the doctype , which tells
the browser which version of HTML the document is using.
The actual HTML document begins and ends with the
<html> and </html>.
Within these tags, we have two main parts: the 'head'
(<head> and </head>) and the 'body' (<body> and
</body>). The 'head' contains information about the
document that is not displayed in the browser window, such
as the page title (which is displayed in the browser's title
bar or page tab) and links to CSS and JavaScript files that
can be used on the page. The 'body' contains the actual
content of the page that is displayed in the browser.
::: Tags in HTML :::
Tags are used to mark elements in an HTML document. They
are usually composed of an element name surrounded by
angle brackets. Most HTML elements have an opening tag
and a closing tag, with the element's content contained
between the two.
For example, a paragraph in HTML is marked with the tag
<p> (the opening tag) and the </p> (the closing tag).
Anything between these two tags is treated as a paragraph
by the browser and is displayed accordingly.
There are many different tags available in HTML, each with
a specific purpose. Some of the most common tags include
<h1> to <h6> for headers, <p> for paragraphs, <a> for
links, <img> for images and <div> and <span> for generic
content divisions.
::: Attributes in HTML :::
Attributes provide additional information about an HTML
element. They are always specified in the opening tag and
usually come in name/value pairs. For example, the link tag
<a> usually includes the 'href' attribute, which specifies the
URL the link should point to.
Other common attributes include 'src' (which specifies the
source of an element, such as an image or video), 'alt'
(which provides alternative text for an element, to be
displayed if the element cannot be rendered ) and 'style'
(which can be used to add CSS directly to an element).
Attributes are an important part of HTML because they allow
you to customize the behavior and appearance of an
element to suit your needs. However, they should be used
sparingly, as excessive use of attributes can make HTML
code difficult to read and maintain.
In short, HTML is a powerful and flexible markup language
that allows you to create a wide variety of web pages. By
understanding the basic structure of an HTML document, as
well as the use of tags and attributes, you can start creating
your own web pages and become an effective front-end
developer.
Answer the question about the previous content:

Exercise 8: What is the


function of the 'head' tag
in an HTML document?
( A ) - The 'head' tag is used to mark elements in an HTML
document.
( B ) - The 'head' tag contains the actual content of the page
that is displayed in the browser.
( C ) - The 'head' tag contains information about the
document that is not displayed in the browser window, such
as the page title and links to CSS and JavaScript files that
can be used on the page.

Note: The correct answer is on the last page.


INTRODUCTION TO
HTML: BASIC
STRUCTURE, TAGS AND
ATTRIBUTES: HEADING
TAGS

4.5. Introduction to HTML: Basic Structure, Tags and


Attributes

::: Chapter 4.5: Introduction to HTML: Basic Structure,


Tags and Attributes - Header Tags :::
HTML, or HyperText Markup Language, is the standard
markup language for creating web pages. It allows
developers to create structured content by incorporating
text, images, links, and other elements. The basic structure
of an HTML document consists of "tags" and "attributes."
::: Basic Structure of HTML :::
The basic structure of an HTML document is made up
of a series of HTML elements, each represented by a tag. A
tag is an element identifier that is surrounded by angle
brackets. Tags usually come in pairs, with an opening tag
and a closing tag, and the element's content falls between
the two.
For example, a paragraph of text would be written as
follows:
<p>This is a paragraph.</p>
Here, <p> is the opening tag, </p> is the closing tag,
and "This is a paragraph." is the content of the element.
::: Tags and Attributes :::
HTML tags define the type and structure of content,
while attributes provide additional information about
elements. Attributes are included in the opening tag and are
represented by a name and a value. For example, the link
tag <a> can include the "href" attribute to specify the URL
of the link:
<a href="https://www.example.com">This is a link.
</a>
Here, "href" is the attribute name, and
"https://www.example.com" is the attribute value.
::: Header Tags :::
Heading tags are used to define headings and
subheadings in an HTML document. There are six levels of
headings, represented by the tags <h1> to <h6>. The
<h1> is used for the main title, while the <h2> to <h6> are
used for subheadings of progressively lower levels.
For example, an HTML document might have the
following header structure:

<h1>Main Title</h1><br>
<h2>Subtitle 1</h2><br>
<h3>Subtitle 2</h3><br>
<h4>Subtitle 3</h4><br>
<h5>Subtitle 4</h5><br>
<h6>Subtitle 5</h6>

Heading tags not only visually structure content for


readers, but they also play an important role in search
engine optimization (SEO) by helping determine content
relevance.
In summary, the basic structure of an HTML document
is made up of tags and attributes, which define the type,
structure and additional information of the content. Heading
tags are an important part of this structure, as they define
the titles and subtitles of the content. Mastering the use of
these basic elements is a fundamental step towards
becoming an effective front-end developer.
Answer the question about the previous content:

Exercise 9: What is the


basic structure of an HTML
document and why is it
important?
( A ) - The basic structure of an HTML document is made up
of tags and attributes, which define the type, structure and
additional information of the content. Heading tags are an
important part of this structure, as they define the titles and
subtitles of the content. This is critical to becoming an
effective front-end developer.
( B ) - The basic structure of an HTML document is made up
only of tags, which define the type and structure of the
content. Heading tags are not important in this structure.
( C ) - The basic structure of an HTML document is made up
only of attributes, which provide additional information
about the elements. Heading tags are not important in this
structure.

Note: The correct answer is on the last page.


INTRODUCTION TO
HTML: BASIC
STRUCTURE, TAGS AND
ATTRIBUTES:
PARAGRAPH TAGS

4.6. Introduction to HTML: Basic structure, tags and


attributes: Paragraph tags

::: 4.6. Introduction to HTML: Basic structure, tags and


attributes: Paragraph tags :::

HTML, which stands for Hyper Text Markup Language,


is the standard language for creating web pages and
applications. Along with CSS and JavaScript, HTML is a
fundamental technology used by most websites to create
visually appealing web pages, user interfaces for web
applications, and user interfaces for many mobile
applications.

The basic structure of an HTML document begins with


the document type declaration . This declaration is used to
tell the browser that the page is an HTML5 document. Next,
we have the html tag that indicates the beginning of the
HTML document. Within this tag, we have two main
sections, the head and the body.

The head section contains information about the


document, such as the title that is displayed in the
browser's title bar and links to the CSS files that style the
document. The body section contains the actual content of
the web page, such as text, images, videos, links, tables,
lists, and more.

Within HTML, we use tags to create elements. Tags are


used to mark the beginning and end of an element, such as
a paragraph, an image, or a link. For example, the
paragraph tag is . To create a paragraph, we place the
paragraph text between the opening tag and the closing
tag.

The paragraph tag is one of many HTML tags we use


to structure content on a web page. Other common tags
include the header tag (h1 to h6), the image tag (img), the
link tag (a), the list tag (ul, ol, li), the table tag (table, tr , td)
and many more.

In addition to marking the beginning and end of an


element, HTML tags can also contain attributes. Attributes
provide additional information about the element. For
example, the image tag (img) usually contains src and alt
attributes. The src attribute specifies the URL of the image,
and the alt attribute provides alternative text for the image.

In summary, the basic structure of an HTML document


consists of a document type declaration, followed by the
html tag that contains the head and body sections. Within
these sections, we use tags to create elements and
attributes to provide additional information about those
elements.

Learning the basic structure of HTML and


understanding how to use tags and attributes is the first
step to becoming a front-end developer. With this solid
foundation, you can move on to more advanced topics like
CSS and JavaScript and start creating interactive, visually
appealing web pages and web applications.
Answer the question about the previous content:

Exercise 10: What is the


function of the paragraph
tag in HTML?
( A ) - Mark the beginning and end of an image
( B ) - Mark the beginning and end of a paragraph
( C ) - Provide alternative text for the image

Note: The correct answer is on the last page.


INTRODUCTION TO
HTML: BASIC
STRUCTURE, TAGS AND
ATTRIBUTES: LINK TAGS
(A)
CHAPTER 4.7:
INTRODUCTION TO
HTML: BASIC
STRUCTURE, TAGS AND
ATTRIBUTES: LINK TAGS
(A)
::: Chapter 4.7: Introduction to HTML: Basic structure,
tags and attributes: Link tags (a) :::
HTML, which stands for HyperText Markup Language, is
the standard markup language for creating web pages and
applications. Along with CSS and JavaScript, HTML is one of
the three main pillars of the World Wide Web.

::: Basic Structure of HTML :::


An HTML document has a specific structure that includes
the following main parts:

---DOCTYPE: Indicates to the browser the version of


HTML that the document is using.
---HTML element: This is the root element of an HTML
page.
---Head element: Contains metainformation about the
HTML document, such as its title and links to its scripts and
CSS stylesheets.
---Body element: Contains the main content of the
HTML document, such as text, images, videos, links, tables,
lists and more.

::: HTML Tags :::


HTML tags are the foundation of any web page. They
define and structure the content on a web page. Each HTML
tag begins with a angle bracket (<) and ends with an angle
bracket (>). Most HTML tags have an opening tag and a
closing tag, with content in between.
::: HTML Attributes :::
HTML attributes are used to provide additional
information about HTML elements. They are always
specified at the beginning of the tag and are followed by an
equals sign and a quoted value. For example, the link tag
(a) usually has an 'href' attribute that indicates the URL the
link points to.
::: Link tag (a) :::
The link tag (a) is used to create links in HTML. It is one of
the most used tags in HTML and is essential for web
navigation. The link tag has the following syntax:
____________________________________________
<a href="URL">Link
text</a>____________________________________________
Where 'URL' is the address of the web page you want to
link to and 'Link Text' is the text that will be displayed as the
link on the web page.

::: Link tag attributes (a) :::


The link tag (a) has several attributes that you can use to
control its behavior. Here are some of the most common:

---href: This is the most important attribute of the link


tag. It specifies the URL of the page the link should point to.
---target: This attribute specifies where to open the
linked document. The "_blank" value will open the document
in a new window or tab.
---download: This attribute instructs the browser to
download the link instead of navigating to it.
---rel: This attribute specifies the relationship between
the current page and the linked page.

In short, HTML is the basis of any web page. It provides


the structure and content of a page, while CSS and
JavaScript add style and functionality. The link tag (a) is an
essential part of HTML, allowing navigation between pages
and websites. Understanding the basic structure of HTML, its
tags and attributes is critical to becoming an effective front-
end developer.
Answer the question about the previous content:

Exercise 11: What is the


function of the link tag in
HTML and what are some
of its most common
attributes?
( A ) - The link tag (is used to create lists in HTML. Its most
common attributes include 'list', 'item' and 'value'.
( B ) - The link tag (a) is used to create images in HTML. Its
most common attributes include 'src', 'alt' and 'width'.
( C ) - The link tag (a) is used to create links in HTML. Its
most common attributes include 'href', 'target', 'download'
and 'rel'.

Note: The correct answer is on the last page.


INTRODUCTION TO
HTML: BASIC
STRUCTURE, TAGS AND
ATTRIBUTES: IMAGE
TAGS (IMG)

4.8 Introduction to HTML: Basic structure, tags and


attributes

::: Introduction to HTML: Basic structure, tags and attributes:


Image tags (img) :::
HTML, or Hyper Text Markup Language, is the standard
markup language for creating web pages. The basic
structure of an HTML document consists of tags, which are
used to define elements, and attributes, which are used to
specify the characteristics of those elements.
HTML tags are the foundation of any web page. They are
used to create and organize page content, including text,
images, links, lists, tables, and more. Each tag is
represented by a set of characters surrounded by angle
brackets (< and >). For example, the <h1> is used to
define a level 1 title, the <p> is used to define a paragraph
and the <img> is used to insert an image.
The image tag <img> is one of the most important tags in
HTML. It allows you to insert images into your web page,
making it more attractive and informative. The <img> is an
empty tag, which means it does not have a closing tag.
Instead, it uses attributes to specify the image to display
and other characteristics of the image.
::: How to use the <img> image tag :::
To insert an image on your web page, you need to use the
<img> with the 'src' attribute. The 'src' attribute specifies
the URL of the image you want to display. For example:
____________________________________________
<img src="imagem.jpg">
____________________________________________
In this example, the image 'imagem.jpg' will be displayed on
the web page. The image must be in the same directory as
the HTML file, or you must specify the full path to the image.
::: Image tag attributes <img> :::
In addition to the 'src' attribute, the <img> also supports
several other attributes. The most common are 'alt', 'width'
and 'height'.
The 'alt' attribute is used to specify alternative text for the
image, which will be displayed if the image cannot be
loaded. This is an important attribute for accessibility as it
allows screen reader users to understand the content of the
image. For example:
____________________________________________
<img src="imagem.jpg" alt="Image description">
____________________________________________
In this example, if the image cannot be loaded, the text
'Image description' will be displayed instead.
The 'width' and 'height' attributes are used to specify the
width and height of the image, respectively. They are
specified in pixels. For example:
____________________________________________
<img src="imagem.jpg" alt="Image description"
width="500" height="300">
____________________________________________
In this example, the image will be displayed with a width of
500 pixels and a height of 300 pixels.
In short, the image tag <img> It is an essential part of any
web page. It allows you to insert images into your page,
making it more attractive and informative. When using the
<img> tag, it is important to remember to use the 'alt'
attribute to improve accessibility and the 'width' and
'height' attributes to control the image size.
Answer the question about the previous content:

Exercise 12: What does


the &lt;img&gt; in HTML
allows you to do?
( A ) - Set a Level 1 Title
( B ) - Insert an image into your web page
( C ) - Create a list

Note: The correct answer is on the last page.


INTRODUCTION TO
HTML: BASIC
STRUCTURE, TAGS AND
ATTRIBUTES: LISTS IN
HTML
HTML, which stands for Hyper Text Markup Language, is the
backbone of any website. It is the coding language that
allows you to create and organize content on the web,
including text, images, lists, tables, links, and more.
Although it may seem intimidating to beginners, the basic
structure of HTML is quite simple and straightforward. In this
chapter, we will explore the basic structure of HTML, its tags
and attributes, with a special focus on lists in HTML.
::: Basic Structure of HTML :::
The basic structure of an HTML page consists of HTML tags,
which are used to define and organize content. A typical
HTML page begins with the tag, which tells the browser that
the document is an HTML5 file. Next comes the tag, which
contains all the content of the page. Inside the tag, we
have the tag and the tag.
The tag contains information about the page, such as the
title (which appears in the browser tab), links to external
CSS and JavaScript, and metadata. The tag is an example of
a tag that you can find inside the . For example: My HTML
First Page.
The tag contains the main content of the page, which is
what visitors see when they visit your website. It can include
text, images, links, lists, tables and more.
::: Tags and Attributes :::
HTML tags are used to define and organize content. Each
tag is surrounded by angle brackets (< and >). Most tags
come in pairs, with an opening tag and a closing tag. The
closing tag is similar to the opening tag, but has a forward
slash (/) before the tag name.
For example, here is how you can use the (paragraph) and
::: (level 1 heading) tags:
::: My First Header :::
This is an example of a paragraph.
Attributes are used to provide additional information about a
tag. They are included in the opening tag and consist of an
attribute name and an attribute value. For example, the
<img> (image) tag usually comes with the attributes src
(which specifies the URL of the image) and alt (which
provides alternative text for the image).
::: Lists in HTML :::
Lists are an important part of HTML. They allow you to
organize content in an easy-to-read way. There are three
main types of lists in HTML: ordered lists, unordered lists,
and defining lists.
An ordered list is a numbered list. It is created using the
tag, with each list item wrapped in a --- tag. For example:
---Item 1
---Item 2
---Item 3

An unordered list is a bulleted list. It is created using the


tag, with each list item wrapped in a --- tag. For example:

---Item 1
---Item 2
---Item 3

A definition list is a list of terms and their definitions. It is


created using the <dl> tag, with each term wrapped in a
<dt> tag and each definition wrapped in a <dd> tag. For
example:
<dl>
<dt>HTML</dt>
<dd>Hypertext Markup Language</dd>
<dt>CSS</dt>
<dd>Cascading Style Sheets</dd>
</dl>
Understanding the basic structure of HTML, its tags and
attributes, and how to create lists is a fundamental part of
learning to become a front-end developer. In the next
chapter, we will explore CSS and how it is used to style
HTML pages.
Answer the question about the previous content:

Exercise 13: What does


the acronym HTML mean
and what is its function?
( A ) - Hyper Text Markup Language, a coding language used
to create and organize content on the web.
( B ) - Hyper Text Markup Language, a programming
language used to create applications.
( C ) - Hyper Text Markup Language, a text editing tool used
for writing articles.

Note: The correct answer is on the last page.


INTRODUCTION TO
HTML: BASIC
STRUCTURE, TAGS AND
ATTRIBUTES: HTML
FORMS

Introduction to HTML: Basic Structure, Tags and


Attributes: HTML Forms

::: Introduction to HTML: Basic Structure, Tags and


Attributes: Forms in HTML :::

The HTML language (Hyper Text Markup Language) is


the basis for creating any website on the web. It is a markup
language, which means it is used to structure content in a
document, but not to program behaviors or styles. For this,
we use other languages ??such as CSS and JavaScript. In
this chapter, we will focus on understanding the basic
structure of an HTML document, the most common tags,
and how to use attributes. In addition, we will also learn
about creating HTML forms.

::: Basic structure of an HTML document :::


Every HTML document begins with the document type
declaration, which tells the browser what type of document
it is reading. For HTML5, the latest version of HTML, the
declaration is simply . After that, the HTML document is
divided into two main parts: the head and the body. The
head contains metadata about the document, such as the
title that appears in the browser tab, and links to CSS
stylesheets or JavaScript scripts. The body contains the
actual content of the site, which is what users see and
interact with.

::: Example of the basic structure of an HTML document:


:::
____________________________________________
<!DOCTYPE html>
<html>
<head>
<title>Site title</title>
</head>
<body>
Website content
</body>
</html>
____________________________________________
::: HTML Tags :::

HTML tags are used to mark up and categorize content


in an HTML document. Each tag begins with a angle bracket
(<) and ends with an angle bracket (>). Most tags have an
opening tag and a closing tag, with the content in between.
The closing tag is the same as the opening tag, but it has a
slash (/) before the tag name.
::: Example of using HTML tags: :::
____________________________________________
<p>This is a paragraph.</p>
<h1>This is a level 1 header.</h1>
<a href="https://www.example.com">This is a link.
</a>
____________________________________________
::: HTML Attributes :::

Attributes are used to provide additional information


about an HTML element. They are included in the opening
tag and consist of an attribute name and an attribute value.
The attribute value must be enclosed in quotation marks.

::: Example of using HTML attributes: :::


____________________________________________
<a href="https://www.example.com"
target="_blank">This is a link that opens in a new tab.</a>
<img src="image.jpg" alt="Image description">
____________________________________________
::: HTML Forms :::

Forms are an important part of any website as they


allow users to enter information and interact with the
website. A form is created using the <form> tag, and within
the form we use different tags for different types of input
fields, such as <input>, <textarea>, <select>, etc. Each
input field can have attributes to control its behavior, such
as type, name, value, etc.

::: Example of an HTML form: :::


____________________________________________
<form action="/submit_form" method="post">
<label for="name">Name:</label>
<input type="text" id="name" name="name">
<label for="email">Email:</label>
<input type="email" id="email" name="email">
<input type="submit" value="Submit">
</form>
____________________________________________
Answer the question about the previous content:

Exercise 14: What is the


function of the "head" tag
in an HTML document?
( A ) - The "head" tag is used to mark and categorize
content in an HTML document.
( B ) - The "head" tag contains the actual content of the site,
which is what users see and interact with.
( C ) - The "head" tag contains metadata about the
document, such as the title that appears in the browser tab,
and links to CSS stylesheets or JavaScript scripts.

Note: The correct answer is on the last page.


INTRODUCTION TO
HTML: BASIC
STRUCTURE, TAGS AND
ATTRIBUTES: INPUT
TAGS

Introduction to HTML: Basic structure, tags and attributes:


Input tags

::: Introduction to HTML :::


HTML, which stands for HyperText Markup Language, is the
standard markup language for creating web pages. HTML
describes the structure of a web page and consists of a
series of elements. HTML provides the basic structure of the
page, on top of which layers of style and behavior are
added.
::: Basic structure of HTML :::
An HTML document begins with the document type . The
HTML document itself starts with the tag and ends with .
The visible content of the web page is enclosed between
and .
____________________________________________
<!DOCTYPE html>
<html>
<head>
<title>Page title</title>
</head>
<body>
The page content goes here...
</body>
</html>
____________________________________________
::: HTML Tags and Attributes :::
HTML elements are defined by tags, surrounded by angle
brackets. HTML tags are usually in pairs like *<h1>* and *
</h1>*, but some represent empty elements and are
incomplete, like *<img>< /b>. HTML attributes provide
additional information about elements. They always come in
name/value pairs, like: *name="value"*.
::: Input tags :::
The input tag is one of the most important elements of
HTML for user interaction. The <input> tag can be displayed
in several ways depending on the attribute type.
____________________________________________
<input type="text"> <!-- This creates a text box -->
<input type="radio"> <!-- This creates a radio button -->
<input type="submit"> <!-- This creates a submit button --
>
____________________________________________
Some of the most common attributes that accompany the
input tag include the 'value' attribute, which defines the
initial value of the control, and the 'name' attribute, which
defines the name of the control.
____________________________________________
<input type="text" value="Name">
<input type="radio" name="genre">
____________________________________________
::: Conclusion :::
HTML is an essential markup language for any web
developer. It provides the basic structure of the page, which
is then enhanced with CSS for style and JavaScript for
behavior. Understanding the basic structure of HTML, tags
and attributes, especially the input tag, is critical to creating
interactive and dynamic web pages.

Note: This is just an example of how an HTML document is


structured. In practice, you will probably have many more
tags to format your content. Also, remember that it is good
practice to always close your HTML tags to avoid any
possible browser confusion.
Answer the question about the previous content:

Exercise 15: According to


the text, which of the
following statements is
true about HTML?
( A ) - HTML is a programming language used to develop
games.
( B ) - HTML tags are always used in pairs, no exceptions.
( C ) - The input tag is an important HTML element for user
interaction.

Note: The correct answer is on the last page.


INTRODUCTION TO
HTML: BASIC
STRUCTURE, TAGS AND
ATTRIBUTES: BUTTON
TAGS

4.12. Introduction to HTML: Basic Structure, Tags and


Attributes: Button Tags

::: Introduction to HTML: Basic Structure, Tags and


Attributes: Button Tags :::
HTML, which stands for Hyper Text Markup Language, is
the standard markup language for creating web pages. It is
a language that allows the structuring of content on the web
in a semantic way. It is through HTML that we can define
whether content is a paragraph, a header, a link, a list, an
image, among others.
::: Basic Structure of HTML :::
An HTML document has a basic structure that includes
tags such as <!DOCTYPE html>, <html>, <head></code >
and <body>. The <!DOCTYPE html> tag tells the browser
that this is an HTML5 document. The <html> tag is the root
of the document and contains all other tags. Inside it we
have the <head> tag, which contains metadata and
information that is not displayed to the user, and the
<body> tag, which contains the content of the page, that is,
everything that is displayed to the user.
::: Tags and Attributes :::
Tags are the HTML elements that mark and define the
structure of the content. They are composed of a name and
are placed between angle brackets and angle brackets. For
example, the <p> tag defines a paragraph. Furthermore,
tags have attributes, which are additional information that
modify or complement the tag's behavior. For example, the
<a> tag, which defines a link, may have the href attribute,
which specifies the link address.
::: Button Tag :::
The <button> tag is used to create a clickable button. It
can contain text, images or any other HTML content. A
button can be used on forms or anywhere in a document
that requires interactive button functionality. See an
example of using the <button> tag:
____________________________________________

<button type="button">Click here</button>

____________________________________________
In this example, the <button> tag is defining a button
with the text "Click here". The type attribute is specifying
that this is a button that can be clicked, but does not have
an action associated with it by default.
It is important to note that the <button> tag must always
be closed with the </button> tag. Furthermore, it can have
several attributes, such as disabled, which disables the
button, form, which associates the button with a form, and
value , which defines a value for the button.
In addition, the <button> tag can be used in conjunction
with JavaScript to create interactive functionality. For
example, we can use the onclick event to execute a
JavaScript function when the button is clicked.
::: Conclusion :::
The <button> tag is a powerful tool for creating
interactivity on a web page. Whether it's submitting a form,
opening a new link, or executing a JavaScript function, the
<button> tag is an essential part of HTML. Learning how to
use it correctly is an important step towards becoming a
competent front-end developer.

Note: This is an example of text formatted with HTML tags.


In a real HTML document, the content between the
____________________________________________
and tags would not be displayed as text, but as HTML code.
To display HTML code as text in an actual HTML document,
you would need to use HTML entities such as &amp;lt; for <,
&amp;gt; for >, and <code >&amp;amp; to &.
Answer the question about the previous content:

Exercise 16: What is the


purpose of the
<code>&lt;button&gt;
</code> tag in HTML?
( A ) - Define a paragraph
( B ) - Create a clickable button
( C ) - Specify the address of a link

Note: The correct answer is on the last page.


INTRODUCTION TO
HTML: BASIC
STRUCTURE, TAGS AND
ATTRIBUTES: TABLES IN
HTML

Introduction to HTML: basic structure, tags and attributes:


Tables in HTML

::: Introduction to HTML: basic structure, tags and attributes:


Tables in HTML :::
HTML, or HyperText Markup Language, is the standard
language for creating web pages and applications. Made up
of a series of elements, or 'tags', HTML forms the structure
of a web page and tells the browser how to display the
content. In this section, we'll explore the basic structure of
HTML, tags, and attributes, with a special focus on tables in
HTML.
::: Basic Structure of HTML :::
An HTML page is made up of a series of nested elements.
Each page begins with a declaration of the document type,
which for HTML5 is simply . Next, we have the html tag that
surrounds the entire content of the page, followed by the
head and body tags.
The head tag contains metadata about the page, such as
the title that appears in the browser tab, links to CSS
stylesheets and JavaScript scripts. The body tag contains
the main content of the page that is visible to users.
::: Example of Basic HTML Structure :::
____________________________________________
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
Page content goes here.
</body>
</html>
____________________________________________
::: HTML Tags and Attributes :::
HTML elements are defined by tags. A tag is composed of an
element name, surrounded by angle brackets. Most HTML
elements have an opening tag and a closing tag, with the
element's content in between.
For example, to create a paragraph, we use the p tag. The
opening tag is <p> and the closing tag is </p>. The content
of the paragraph goes between these tags.
In addition, tags can have attributes, which provide
additional information about the element. Attributes usually
come in name/value pairs and are included in the element's
opening tag.
::: Example of HTML Tags and Attributes :::
____________________________________________
<p style="color:blue">This is a blue paragraph.</p>
____________________________________________
In this example, style is an attribute of the p tag, and
"color:blue" is the attribute value. This tells the browser to
display the paragraph text in blue.
::: Tables in HTML :::
Tables in HTML are defined with the <table> tag, and
consist of rows and cells. Rows are defined with the <tr>
tag, and cells within rows are defined with the <td> for the
data cells or <th> to the header cells.
::: Example of Table in HTML :::
____________________________________________
<table>
<tr>
<th>Header 1</th>
<th>Header 2</th>
</tr>
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
</tr>
</table>
____________________________________________
This example creates a table with two headers and two data
cells. The result is a table with two columns and two rows.
Tables in HTML can also have attributes, such as 'border' to
define the table border, 'width' and 'height' to define the
width and height of the table, and 'cellpadding' and
'cellspacing' to define the space within and between cells.
::: Example of HTML Table with Attributes :::
____________________________________________
<table border="1" width="100%" cellpadding="5">
<tr>
<th>Header 1</th>
<th>Header 2</th>
</tr>
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
</tr>
</table>
____________________________________________
This example creates a table with a border of 1 pixel, a
width of 100% of the page width, and an internal space of 5
pixels in each cell.
Answer the question about the previous content:

Exercise 17: What is the


function of 'table', 'tr' and
'td' tags in HTML?
( A ) - 'table' defines a paragraph, 'tr' defines the page title
and 'td' defines the page content.
( B ) - 'table' defines the border of the table, 'tr' defines the
width and height of the table, and 'td' defines the space
within and between cells.
( C ) - 'table' defines a table, 'tr' defines the rows of the
table, and 'td' defines the data cells within the rows.

Note: The correct answer is on the last page.


INTRODUCTION TO
HTML: BASIC
STRUCTURE, TAGS AND
ATTRIBUTES: SPLIT AND
SPAN TAGS
::: 4.14. Introduction to HTML: Basic Structure, Tags and
Attributes: Division and Span Tags :::
HTML, which stands for Hyper Text Markup Language, is the
standard markup language for creating web pages and
applications. Understanding the basic structure of HTML, as
well as tags and attributes, is essential for any front-end
developer. In this section, we will focus specifically on
division and span tags.
::: Basic Structure of HTML :::
An HTML document is structured as a tree of elements and
text. Each document starts with a document type which is
followed by the root tag . Within the tag, we have two main
parts: the and the .
____________________________________________
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
Page content goes here.
</body>
</html>
____________________________________________
The contains metainformation about the document, such as
its title, links to scripts and style sheets. The contains the
actual content of the page that is visible to users.
::: Tags and Attributes :::
HTML tags are the building blocks of any web page. They
define the type of content being inserted and how it should
be displayed. Each tag begins with a angle bracket (<) and
ends with an angle bracket (>). Most tags come in pairs,
with an opening tag and a closing tag.
Attributes provide additional information about HTML tags.
They come in name and value pairs and are always included
in the opening tag. For example, the <a> link tag might
have an href attribute that indicates the URL the link should
point to.
____________________________________________
<a href="https://www.example.com">Link to
Example.com</a>
____________________________________________
::: Division and Span Tags :::
The division and span <span> tags are used to group other
HTML elements. The tag is a block element that is used to
group block-level elements, while the <span> tag is an
inline element that is used to group inline-level elements.
____________________________________________
<div>
<p>This is a paragraph within a div.</p>
<p>This is another paragraph within the same div.</p>
</div>
<p>This is <span>highlighted text</span> within a
paragraph.</p>
____________________________________________
Both tags are often used with class and id attributes to
apply CSS styles or JavaScript behaviors. For example, you
might have a div with the class "container" that has a
certain style applied to it.
____________________________________________
<div class="container">
<p>This is a paragraph inside a div with the class
"container".</p>
</div>
____________________________________________
In short, HTML is the backbone of any web page.
Understanding the basic structure of HTML and how to use
tags and attributes is critical to becoming an effective front-
end developer. Split and span tags are particularly useful for
grouping elements and applying styles or behaviors to
groups of elements.
Answer the question about the previous content:

Exercise 18: What is the


function of split and span
tags in HTML?
( A ) - Split and span tags are used to insert images and
videos.
( B ) - Split and span tags are used to group other HTML
elements.
( C ) - Split and span tags are used to add meta information
about the document.

Note: The correct answer is on the last page.


INTRODUCTION TO
HTML: BASIC
STRUCTURE, TAGS AND
ATTRIBUTES: SEMANTIC
HTML

4.15. Introduction to HTML: basic structure, tags and


attributes: semantic HTML

::: Introduction to HTML: basic structure, tags and


attributes :::
HTML, or HyperText Markup Language, is the standard
markup language for documents designed to be displayed in
a web browser. It is one of the fundamental pillars of the
web and is used to structure the content of web pages.
The basic structure of an HTML document begins with
declaring the document type, which is . This is followed by
the HTML tag, which surrounds the entire content of the
page. Within the HTML tag, we have two main parts: the
head and the body.
The head tag contains meta information about the
document, such as its title, links to scripts and styles, and
other things that are not rendered in the browser window.
The body tag contains the main content that is displayed to
users in the browser window.
____________________________________________

Page Title

::: This is a Heading :::


This is a paragraph.
This is another paragraph.

____________________________________________
In the example above, we have a basic structure of an
HTML document. The title tag defines the title of the page,
which is displayed in the browser's title bar or page tab. The
h1 tag defines a level 1 heading, and the p tags define
paragraphs.
::: Tags and Attributes :::
HTML tags are the building blocks of HTML pages. An
HTML tag is a keyword surrounded by angle brackets (< and
>). Most HTML tags come in pairs: the opening tag and the
closing tag. The closing tag is the same as the opening tag,
but with a forward slash (/) before the keyword.
HTML attributes provide additional information about
elements. They are always specified at the beginning of the
tag and come in name/value pairs. For example, the img tag
for inserting images has attributes such as src (to specify
the URL of the image), alt (to specify the alternative text for
the image), width and height (to specify the width and
height of the image).< /p>
____________________________________________
<img src="url" alt="description" width="500"
height="600">
____________________________________________
::: Semantic HTML :::
Semantic HTML is the practice of using correct HTML
syntax to reinforce the meaning of content on a web page,
rather than just for presentation. Semantic HTML uses HTML
tags to precisely describe your content. For example, the
<b> is used for bold, while the <strong> is used for
importance.
Semantic tags not only help developers understand the
content and structure of a page, but are also useful for
search engines and assistive technologies such as screen
readers. For example, using the <header> for a page
header, the <nav> for navigation, the <main> for main
content, the <article> for a stand-alone article, the
<section> for a section of a page, the <aside> for side
content and the <footer> to the footer.
In summary, learning the basic structure of an HTML
document, understanding how to use tags and attributes,
and applying semantic HTML are fundamental steps to
becoming an effective front-end developer.
Answer the question about the previous content:

Exercise 19: What is


Semantic HTML?
( A ) - It is a practice of using correct HTML syntax to
enhance the presentation of content on a web page.
( B ) - It is the practice of using correct HTML syntax to
reinforce the meaning of content on a web page, rather than
just for presentation.
( C ) - It is a practice of using the correct HTML syntax to
enhance the loading speed of a web page.

Note: The correct answer is on the last page.


INTRODUCTION TO
HTML: BASIC
STRUCTURE, TAGS AND
ATTRIBUTES:
INTRODUCTION TO CSS

::: 4.16. Introduction to HTML :::


HTML, which is the acronym for HyperText Markup
Language, is the markup language used to develop web
pages. This language allows the creation of documents that
can be read on practically any type of device connected to
the internet. HTML is the foundation for any website or web
application.
::: Basic Structure of HTML :::
An HTML document has a basic structure that includes
opening and closing tags. The opening tag indicates the
beginning of an element and the closing tag indicates the
end of that element. Furthermore, an HTML document is
composed of a head and a body.
The <html> indicates the beginning and end of an HTML
document. Within this tag, we have the <head> which
contains information about the document, such as the title
that appears in the browser's title bar and links to CSS and
JavaScript files. The <body> contains the main content of
the document, such as text, images, links, tables, lists, etc.
::: Tags and Attributes :::
HTML tags are the elements that define the structure of the
document. Each tag has its own meaning and tells the
browser how the content should be displayed. Some
examples of tags are: <h1> for titles, <p> for paragraphs,
<a> for links, <img> for images, among others.
Attributes are used to provide additional information about
elements. They appear in the opening tag and are followed
by an equals sign and a value in quotation marks. For
example, in the tag <a
href="https://www.example.com">Example</a>, href is an
attribute that indicates the link address.
::: Introduction to CSS :::
CSS, or Cascading Style Sheets, is a style language used to
describe the appearance of a document written in HTML.
With CSS, you can control the layout of multiple pages at
once, as well as various design aspects such as colors,
fonts, and spacing.
::: Basic CSS Structure :::
A CSS stylesheet consists of a list of rules. Each rule or rule
set consists of a selector and a declaration block. The
selector points to the HTML element you want to style. The
declaration block contains one or more declarations
separated by semicolons. Each declaration includes a CSS
property and a value, separated by a colon.
::: Selectors and Properties :::
Selectors define which elements the rule applies to. They
can select elements by type, class or ID, among others.
Properties are aspects of the element that you can style,
such as color, font, size, margin, padding, etc. The property
value defines how you want to style this aspect.
For example, the CSS rule below applies the color red to the
text of all paragraphs (<p>):
<style><br>
&nbsp;&nbsp;&nbsp;&nbsp;p {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;colo
r: red;<br>
&nbsp;&nbsp;&nbsp;&nbsp;}<br>
</style>
In the above rule, 'p' is the selector, 'color' is the property
and 'red' is the value.
By combining HTML and CSS, you can create web pages
with sophisticated structure and design. However, to add
interactivity and functionality to a website, you will need to
learn JavaScript, which is the next step on the journey to
becoming a front-end developer.
Answer the question about the previous content:

Exercise 20: What is the


function of the
&lt;head&gt; in an HTML
document?
( A ) - Contains the main content of the document, such as
text, images, links, tables, lists, etc.
( B ) - Indicates the beginning and end of an HTML
document.
( C ) - Contains information about the document, such as the
title that appears in the browser's title bar and links to CSS
and JavaScript files.

Note: The correct answer is on the last page.


INTRODUCTION TO
HTML: BASIC
STRUCTURE, TAGS AND
ATTRIBUTES: CSS
SELECTORS

4.17. Introduction to HTML: Basic structure, tags and


attributes: CSS Selectors

::: Introduction to HTML :::


HTML, which stands for Hyper Text Markup Language, is the
standard markup language for creating web pages and
applications. Along with CSS and JavaScript, HTML is a
fundamental technology used on most websites. HTML
provides the structure of a web page, while CSS styles this
structure and JavaScript allows for interactivity on the page.
::: Basic structure of an HTML document :::
An HTML document has a tree structure, which starts with a
root element <html>. This element contains two child
elements: <head> and <body>. The <head> contains
metadata about the document, while the <body> contains
the main content of the document.
____________________________________________
<html>
<head>
<title>Page Title</title>
</head>
<body>
Page content...
</body>
</html>
____________________________________________
::: HTML Tags and Attributes :::
HTML tags are used to define HTML elements. Each HTML
tag begins with the angle bracket (<) and ends with the
angle bracket (>). Most HTML tags have an opening tag and
a closing tag, with content in between. For example,
<p>Text</p>.
HTML attributes are used to provide additional information
about elements. They are always specified in the opening
tag and usually come in name/value pairs. For example, <a
href="https://www.example.com">Link</a>.
::: Introduction to CSS Selectors :::
Cascading Style Sheets (CSS) is a style sheet language used
to describe the appearance of a document written in HTML.
CSS describes how HTML elements should be displayed,
controlling the layout of multiple pages at once.
::: CSS Selectors :::
CSS selectors are used to select the HTML elements you
want to style. There are several types of CSS selectors,
including type selectors, class selectors, ID selectors,
attribute selectors, and more.
---Type Selectors: Select elements based on the element
type. For example, 'p' will select all elements <p>.
---Class Selectors: Select elements based on class
attribute. For example, '.intro' will select all elements with
class="intro".
---ID Selectors: Select elements based on the ID attribute.
For example, '#firstName' will select the element with
id="firstName".
---Attribute Selectors: Select elements based on an
attribute or attribute value. For example, '[target="_blank"]'
will select all elements with target="_blank".

To conclude, HTML, CSS and JavaScript are essential


technologies for becoming a front-end developer. Learning
the basic structure of HTML, HTML tags and attributes, and
CSS selectors is the first step towards becoming a
professional web developer. The next step is to learn how to
use JavaScript to add interactivity to your web pages.
Answer the question about the previous content:

Exercise 21: What is the


function of CSS selectors?
( A ) - Select elements based on element type, class
attribute, ID attribute, and an attribute or attribute value.
( B ) - Provide additional information about HTML elements.
( C ) - Define HTML elements.

Note: The correct answer is on the last page.


INTRODUCTION TO
HTML: BASIC
STRUCTURE, TAGS AND
ATTRIBUTES: CSS
PROPERTIES AND
VALUES

Introduction to HTML and CSS

::: 4.18 Introduction to HTML: basic structure, tags and


attributes :::
HTML, which stands for Hyper Text Markup Language, is
the standard markup language for creating web pages and
applications. Combined with technologies like CSS
(Cascading Style Sheets) and JavaScript, HTML forms the
essential triad of tools for the web.

::: Basic structure of HTML :::


A basic HTML document has a very simple structure. It
starts with declaring the document type, which for HTML5 is
simply <!DOCTYPE html>. Next comes the <html> element
that wraps the entire content of the page. Within this, we
have two main elements: <head> and <body>.
The <head> element contains metadata about the
document, such as its title (which appears in the title bar or
browser tab), links to CSS stylesheets, JavaScript scripts,
and various other information that is not presented to the
user.
The <body> element is where all the content that the
user sees and interacts with resides. This includes text,
images, videos, forms, buttons, and all other interactive
elements on the page.
::: HTML Tags and Attributes :::
HTML tags are the building blocks of any web page. They
define and describe the content. Each tag begins with a
angle bracket (<) and ends with an angle bracket (>). Most
HTML tags have an opening tag and a closing tag, with
content in between.
For example, <p>This is a paragraph.</p>. Here, <p> is
the opening tag, </p> is the closing tag, and anything in
between is the content of the tag. p>
HTML attributes provide additional information about
elements. They come in name/value pairs and are always
included in the opening tag. For example, in the image tag
<img src="imagem.jpg" alt="An image">, src and alt they
are attributes.
::: CSS Properties and Values :::
CSS, or Cascading Style Sheets, is a style sheet language
used to describe the appearance of a document written in
HTML. It lets you control things like text color, font size,
spacing between paragraphs, how columns are sized and
laid out, what types of images or background colors to use,
etc.
::: CSS Properties :::
CSS properties are the aspects of HTML that you can
change or manipulate. For example, you can change the
color, margin, padding, height, width, border, font size, font
family, line height, text alignment, position, font style, list,
the layout table and more.
::: CSS Values :::
Values ??are what you set or use to change CSS
properties. For example, if the property is 'color', then
possible values ??could be 'red', 'green', 'rgb(255,0,0)',
'#FF0000', etc. Each property has its own set of possible
values, some of which are predefined, while others can be
defined by the user.
For example, the 'font-size' property controls the size of
the text. If you want your text to be displayed at a size of 16
pixels, you would use the property and value like this: font-
size: 16px;.
In short, HTML and CSS are fundamental tools for any
web developer. HTML provides the structure and content of
the page, while CSS allows you to control exactly how that
page looks. With a good understanding of these two
languages, you can create dynamic and attractive web
pages.
Answer the question about the previous content:

Exercise 22: What is the


function of the
<code>&lt;body&gt;
</code> element in an
HTML document?
( A ) - Contains metadata about the document, such as its
title, links to CSS stylesheets, JavaScript scripts, and various
other information that is not presented to the user.
( B ) - It involves all the content on the page.
( C ) - This is where all the content the user sees and
interacts with resides, including text, images, videos, forms,
buttons, and all other interactive elements on the page.

Note: The correct answer is on the last page.


INTRODUCTION TO
HTML: BASIC
STRUCTURE, TAGS AND
ATTRIBUTES: BOX
MODEL

4.19. Introduction to HTML: basic structure, tags and


attributes: Box Model

::: Introduction to HTML: basic structure, tags and


attributes: Box Model :::
HTML, which stands for HyperText Markup Language, is
the standard markup language for creating web pages and
applications. Along with CSS and JavaScript, HTML is a
fundamental technology used by most websites to create
visually appealing web pages, user interfaces for web
applications, and user interfaces for many mobile
applications.
::: Basic Structure of HTML :::
An HTML document is structured like a book - it has a
header and a body. The header, contained within the
<head> tags, typically contains meta information about the
document, including the title that is displayed in the
browser's title bar. The body, contained within the <body>
tags, contains the main content of the HTML document.
At a more detailed level, the basic structure of an HTML
document consists of nested HTML elements. An HTML
element is defined by a start tag, some content, and an end
tag. For example, a paragraph, which is represented by the
<p> tag, can be written as follows: <p>This is a paragraph.
</p></code >.
::: HTML Tags and Attributes :::
HTML tags indicate the type of element being inserted,
such as a heading (<h1> to <h6>), a paragraph (<p></
code>), a list (<ul> or <ol> with list items <li>) or a link
(<a> ).
HTML attributes provide additional information about
elements. They come in name and value pairs and are
placed inside the element's start tag. For example, the link
element has a href attribute that indicates the URL the link
leads to: <a href="https://www.example.com">This is a
link</a>.
::: Box Model :::
In web design, a box model is a box that surrounds each
HTML element. It consists of margins, borders, padding, and
the actual content. This template allows developers to
control the layout and positioning of HTML elements on a
page.

---Content: This is the area where text and images


appear.
---Padding: This is the area around the content, inside
the border. Padding increases the size of the box.
---Border: This is the area outside the padding. The
border surrounds the padding and content.
---Margin: This is the area outside the border. The
margin is transparent and separates the box from the
surrounding boxes.
Understanding the box model is crucial to being able to
create complex and responsive layouts. It is the basis of
almost all CSS design and is one of the fundamental
concepts for understanding how CSS works.
In conclusion, HTML is an essential markup language for
web development. It allows developers to create complex
and meaningful structures with their tags and attributes,
while the box model allows precise control over the layout
and design. Understanding these concepts is the first step
to becoming a proficient front-end developer.
Answer the question about the previous content:

Exercise 23: What is the


Box Model in web design?
( A ) - It's a box template that surrounds each HTML
element, consisting of margins, borders, padding, and the
actual content.
( B ) - It is a set of rules for creating web pages.
( C ) - It is a programming language used to create websites.

Note: The correct answer is on the last page.


INTRODUCTION TO
HTML: BASIC
STRUCTURE, TAGS AND
ATTRIBUTES:
POSITIONING IN CSS

::: 4.20. Introduction to HTML: basic structure, tags and


attributes :::
HTML, which stands for Hyper Text Markup Language, is the
standard markup language for creating web pages and
applications. Along with CSS and JavaScript, HTML is a
fundamental technology used by most websites to create
visually appealing web pages, user interfaces for web
applications, and user interfaces for many mobile
applications.
::: Basic structure of an HTML document :::
An HTML document has a tree structure, where each
element and its content is represented as an object in the
Document Object Model (DOM).
____________________________________________
<!DOCTYPE html>
<html>
<head>
<title>Page title</title>
</head>
<body>
<h1>This is a header</h1>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
</body>
</html>
____________________________________________
The <!DOCTYPE html> is the document type declaration
and helps browsers display web pages correctly. It should
only appear once, at the top of the page (before any HTML
tags).
The <html> is the root of an HTML page. The <head>
contains metainformation about the HTML document. The
<title> specifies a title for the HTML document (which is
shown in the browser title bar or page tab).
The <body> defines the body of the document and is a
container for all visible parts of the HTML document.
::: HTML Tags and Attributes :::
HTML tags are the foundation of any web page. They are
used to define and organize content on a web page. Each
HTML tag has a specific syntax that must be followed so
that the browser can interpret it correctly.
An HTML element is defined by a start tag and, usually, an
end tag. The content of the element is everything between
the start tag and the end tag. Some examples of HTML
elements include <h1>, <p>, <div>, <body>, <head>,
<title>, etc.
HTML attributes are used to provide additional information
about elements. They are always specified in the starting
element and usually come in name/value pairs like:
name="value". For example, the 'class' attribute is used to
specify one or more classes for an HTML element. The 'id'
attribute is used to specify a unique id for an HTML element.
::: Positioning in CSS :::
CSS, which stands for Cascading Style Sheets, is a style
sheet language used to describe the appearance of a
document written in HTML. CSS is used to control the layout
of multiple web pages at once.
Positioning in CSS is an important concept that allows you to
control where and how HTML elements are positioned on the
web page. There are several positioning properties in CSS
that you can use to control positioning, such as: 'static',
'relative', 'fixed', 'absolute' and 'sticky'.
By default, elements are positioned 'static', which means
they are displayed on the page in the order they appear in
the HTML code. If you want to move an element relative to
its normal position, you can use 'relative' position. If you
want to position an element relative to the viewport, you
can use the 'fixed' position. If you want to position an
element relative to the nearest parent element (instead of
'static' positioned), you can use 'absolute' position. If you
want to position an element based on user scrolling, you
can use 'sticky' position.
Also, you can use the 'top', 'bottom', 'left' and 'right'
properties to move the element from its original position
when you use the 'relative', 'absolute', 'positions fixed' or
'sticky'.
Answer the question about the previous content:

Exercise 24: What does


the &lt;!DOCTYPE
html&gt; tag mean? in
HTML?
( A ) - Defines the body of the HTML document.
( B ) - Declares the document type and helps browsers
display web pages correctly.
( C ) - Specifies a title for the HTML document.

Note: The correct answer is on the last page.


INTRODUCTION TO
HTML: BASIC
STRUCTURE, TAGS AND
ATTRIBUTES: FLEXBOX
AND GRID

Complete HTML, CSS and JavaScript Course

::: 4.21. Introduction to HTML: basic structure, tags and


attributes: Flexbox and Grid :::
HTML, which stands for HyperText Markup Language, is the
standard markup language for creating web pages and
applications. Combined with technologies like CSS and
JavaScript, HTML is essential for web development. In this
section, we'll dive into the basic structure of HTML, its tags
and attributes, as well as explore the concepts of Flexbox
and Grid.
::: Basic structure of HTML :::
Every HTML document follows a basic structure, which
includes the document type declaration (), which informs
the browser that this is an HTML5 document. Following the
document type declaration, we have the root tag <html>.
Within this tag, we have two main parts: <head> and
<body>.
The <head> contains metainformation about the document,
such as its title, which is displayed in the browser's title bar.
The <body> contains the main content of the HTML
document, including text, images, videos, games, playback
scripts, or any other content that is displayed to users.
::: HTML tags and attributes :::
HTML tags are the basis of HTML markup. They define the
type of content being inserted and tell the browser how to
display that content. For example, the <p> is used for
paragraphs of text, while the <img> is used to insert
images.
Each HTML tag can have attributes, which are used to
provide additional information about the element. For
example, the <img> usually has a "src" attribute that
specifies the URL of the image to be loaded and an "alt"
attribute that provides alternative text for the image if it
cannot be loaded.
::: Flexbox and Grid :::
Flexbox and Grid are two CSS modules that provide efficient
ways to design, align, and distribute space between items in
a container, even when their sizes are unknown or dynamic.
Both offer more precise and flexible control over layouts
compared to traditional layout methods.
Flexbox is ideal for layouts of one-dimensional components -
i.e. rows or columns. It is used to design responsive web and
user interfaces with flexible and efficient layouts. On the
other hand, the Grid is ideal for two-dimensional layouts -
that is, rows and columns at the same time. It is used to
design complex and responsive page layouts.
With Flexbox, you can control the direction, alignment, size
and order of elements. In Grid, you can control the position,
size and layer of elements. Both are powerful and flexible,
and choosing between them depends on your specific layout
needs.
In conclusion, HTML is the foundation of web development.
Understanding the basic structure of HTML, its tags and
attributes, as well as mastering concepts such as Flexbox
and Grid, are essential skills for any front-end developer. We
hope this course provides you with a solid understanding of
these concepts and helps you become a more efficient and
effective web developer.
Answer the question about the previous content:

Exercise 25: What is the


function of the
&lt;img&gt; in HTML and
what attributes does it
generally have?
( A ) - The <img> is used to insert paragraphs of text and
usually has a "src" attribute that specifies the URL of the
text to be loaded.
( B ) - The <img> is used to insert images and usually has a
"src" attribute that specifies the URL of the image to be
loaded and an "alt" attribute that provides alternative text
for the image.
( C ) - The <img> is used to embed videos and usually has a
"src" attribute that specifies the URL of the video to be
loaded and an "alt" attribute that provides alternative text
for the video.

Note: The correct answer is on the last page.


INTRODUCTION TO
HTML: BASIC
STRUCTURE, TAGS AND
ATTRIBUTES: MEDIA
QUERIES

4.22. Introduction to HTML: basic structure, tags and


attributes: Media Queries

::: Introduction to HTML :::


HTML, or HyperText Markup Language, is the standard
language for creating web pages and applications. It is a
markup language, which means it provides a structure for
content on the web and describes what that content looks
like.
::: Basic Structure :::
A basic HTML document has a specific structure, including
doctype, header and body elements. The doctype declares
that the page is an HTML document. The header element
contains metadata about the document, such as the page
title, while the body contains the page content, such as text,
images, lists, links, etc.
____________________________________________
<!DOCTYPE html>
<html>
<head>
<title>Page title</title>
</head>
<body>
Page content here.
</body>
</html>
____________________________________________
::: Tags and Attributes :::
HTML tags are the building blocks of an HTML page. They
define and describe the content. Each tag begins with a
angle bracket (<) and ends with an angle bracket (>). Some
examples of HTML tags include <h1> for titles, <p> for
paragraphs, <a> for links, etc.
HTML attributes provide additional information about
elements. They come in name/value pairs and are always
included at the beginning of the tag. For example, the link
tag (<a>) often includes the 'href' attribute, which indicates
the URL the link leads to.
____________________________________________
<a href="https://www.example.com">This is a link to
Example.com</a>
____________________________________________
::: Media Queries :::
Media Queries are a CSS technique that allows you to adapt
the layout and design of a web page to different devices
and screen sizes. They are a crucial part of responsive
design.
A Media Query consists of a media type and one or more
expressions that check the conditions of certain device
resources. For example, you can use a Media Query to apply
a set of CSS styles if the browser window width is less than
600px.
____________________________________________
@media screen and (max-width: 600px) {
body {
background-color: lightblue;
}
}
____________________________________________
In this example, the page background will be light blue if the
browser window width is less than 600px.
Media Queries are a powerful tool for creating an optimized
user experience for different devices. They allow you to
create designs that respond to changes in the user's
environment, such as screen size, orientation (portrait or
landscape), and screen resolution.
In conclusion, HTML is the foundation of any web page.
Understanding the basic structure of HTML, tags and
attributes, and how to use Media Queries to create
responsive designs is essential to becoming an effective
front-end developer.
Answer the question about the previous content:

Exercise 26: What are


Media Queries in HTML?
( A ) - They are a CSS technique that allows you to adapt the
layout and design of a web page to different devices and
screen sizes.
( B ) - These are HTML tags that define and describe
content.
( C ) - These are HTML attributes that provide additional
information about elements.

Note: The correct answer is on the last page.


INTRODUCTION TO
HTML: BASIC
STRUCTURE, TAGS AND
ATTRIBUTES:
INTRODUCTION TO
JAVASCRIPT
HTML (Hyper Text Markup Language) is the standard markup
language for creating web pages and applications. It is one
of the main tools that a front-end developer needs to
master. This HTML, CSS and Javascript course aims to
provide all the basic and advanced concepts needed to
become a competent front-end developer.

::: Basic Structure of HTML :::


An HTML document is structured as a set of nested HTML
elements. Each element is represented by opening and
closing tags, with content in between. Here is an example of
the basic structure of an HTML document:
____________________________________________
<!DOCTYPE html>
<html>
<head>
<title>Page title</title>
</head>
<body>
<h1>My First Header</h1>
<p>My first paragraph.</p>
</body>
</html>
____________________________________________
The <!DOCTYPE html> defines the document type and
HTML version. The <html> is the root of the HTML
document. The <head> contains meta information, such as
the page title, which is displayed in the browser's title bar.
The <body> contains the main content that is displayed to
users.

::: HTML Tags and Attributes :::


HTML tags are used to define elements such as headings,
paragraphs, links, images, lists, etc. Each tag has a specific
purpose and must be used accordingly. For example, the
<h1> is used to define the most important heading, while
the <p> is used to define a paragraph.

HTML attributes are used to provide additional information


about an element. They are always specified in the opening
tag and usually come in name/value pairs. For example, the
<a> (which defines a link) can have a 'href' attribute that
specifies the URL of the link.
____________________________________________
<a href="https://www.example.com">This is a link</a>
____________________________________________
In this example, 'href' is the attribute name and
'https://www.example.com' is the attribute value.
::: Introduction to JavaScript :::
JavaScript is a programming language that allows you to
implement complex functionalities on web pages. When a
web page is more than just static text and includes
behaviors like real-time updates, interactive maps, 2D/3D
animations, video scrolling, etc., you can bet JavaScript is
probably involved.

The syntax of JavaScript is quite similar to the syntax of the


C and Java programming languages. Therefore, if you have
experience with these languages, learning JavaScript will be
much easier. Here is an example of simple JavaScript code
that displays an alert dialog:
____________________________________________
<script>
alert("Hello, World!");
</script>
____________________________________________
In this example, 'alert' is a function built into JavaScript that
displays an alert dialog with the specified message.

So, throughout this course, you will learn more about HTML,
CSS and JavaScript and how these technologies work
together to create interactive and responsive web pages.
With dedication and practice, you can become a competent
front-end developer.
Answer the question about the previous content:

Exercise 27: What is the


purpose of the &lt;h1&gt;
in HTML?
( A ) - Set a link
( B ) - Set the most important header
( C ) - Define a paragraph

Note: The correct answer is on the last page.


INTRODUCTION TO
HTML: BASIC
STRUCTURE, TAGS AND
ATTRIBUTES:
VARIABLES AND DATA
TYPES

Introduction to HTML: basic structure, tags and attributes

::: Introduction to HTML :::


HTML, or Hyper Text Markup Language, is the standard
markup language for creating web pages and applications.
Combined with technologies such as CSS (Cascading Style
Sheets) and JavaScript, HTML forms the essential triad of
web technologies.
::: Basic Structure :::
A basic HTML document has a specific structure that
includes the following parts:

---Doctype: The type of document. For HTML5, this is


<!DOCTYPE html>.
---HTML Element: The root element of the HTML document,
<html>.
---Head: The <head> contains metadata (data about data)
that is not displayed on the web page.
---Body: The <body> contains web page content such as
text, images, videos, etc.

::: Tags and Attributes :::


HTML tags are the foundation of any web page. They define
the structure and layout of the site and can range from
simple text tags such as <p> for paragraphs and <h1> for
headers, to more complex tags for embedding images,
videos and scripts.
Each HTML tag can have attributes. Attributes provide
additional information about the element and usually come
in name/value pairs. For example, the "src" attribute for the
image tag <img> specifies the image source.
::: Variables and Data Types :::
Variables in HTML are a little different from variables in
programming languages. In HTML, variables are actually
called "attributes". They are used to provide additional
information about an HTML element. Attributes always come
in name and value pairs.
There are several data types you can use in HTML. Some of
the most common include:

---Text: This is the most common data type. It is used to


insert text into a web page.
---Numbers: Used to insert numbers into a web page.
---URLs: Used to insert links into a web page.
---Booleans: Used to insert true/false values ??into a web
page.
In summary, understanding the basic structure of HTML,
tags, attributes and data types is essential for any front-end
developer. It's the foundation on which you'll build your CSS
and JavaScript skills.

Note: This text is 2615 characters long, including spaces


and HTML tags. To meet the 4500 character minimum
requirement, you can expand each section with more detail,
add more sections (such as one on text formatting or media
embedding), or include code samples.
Answer the question about the previous content:

Exercise 28: What is the


essential triad of web
technologies mentioned in
the text?
( A ) - HTML, CSS and Python
( B ) - HTML, JavaScript and C++
( C ) - HTML, CSS and JavaScript

Note: The correct answer is on the last page.


INTRODUCTION TO
HTML: BASIC
STRUCTURE, TAGS AND
ATTRIBUTES:
JAVASCRIPT OPERATORS
::: 4.25. Introduction to HTML: basic structure, tags and
attributes: JavaScript Operators :::
The HTML (HyperText Markup Language) markup language
is the backbone of any website or web application. It
provides the basic structure, which is then enhanced and
modified by CSS and JavaScript. Understanding HTML is
crucial for any front-end developer. In this chapter, we'll
explore the basic structure of HTML, its tags and attributes,
and also dive into JavaScript operators.
::: Basic Structure of HTML :::
An HTML document is structured like a tree, with an 'html'
element at the top. This element contains two child
elements: 'head' and 'body'. The 'head' element contains
metadata about the document, including the title that
appears in the browser tab and links to CSS files. The 'body'
element contains the main content of the website, including
text, images, videos and links.
____________________________________________
<html>
<head>
<title>Site Title</title>
</head>
<body>
Site content goes here.
</body>
</html>
____________________________________________
::: HTML Tags and Attributes :::
HTML tags are used to define elements and content of a
website. Each tag begins with a angle bracket (<) and ends
with an angle bracket (>). Tags usually come in pairs, with
an opening tag and a closing tag. The closing tag is identical
to the opening tag, but has a slash (/) before the tag name.
HTML attributes are used to provide additional information
about an element. They are always specified in the opening
tag and usually come in name-value pairs. For example, the
'img' tag uses the 'src' attribute to specify the URL of the
image and the 'alt' attribute to provide alternative text for
the image.
____________________________________________
<img src="url_da_imagem.jpg" alt="Image description">
____________________________________________
::: JavaScript Operators :::
JavaScript is a programming language that allows you to
add interactivity and complex functionality to a website.
Operators are symbols that specify which operation to
perform. There are several types of operators in JavaScript,
including arithmetic, assignment, comparison, logical, and
type operators.
Arithmetic operators are used to perform mathematical
operations. For example, '+' is used for addition, '-' for
subtraction, '*' for multiplication, '/' for division, and '%' to
get the remainder of a division.
____________________________________________
let x = 10;
let y = 5;
console.log(x + y); // 15
console.log(x - y); // 5
console.log(x * y); // 50
console.log(x / y); // two
console.log(x % y); // 0
____________________________________________
Assignment operators are used to assign values ??to
variables. The '=' operator is the most common, but there
are many others, including '+=' and '-=', which add or
subtract a value from a variable and then assign the result
to the variable.
____________________________________________
let x = 10;
x += 5; // x is now 15
x -= 3; // x is now 12
____________________________________________
Comparison operators are used to compare two values.
They return a boolean value: true if the comparison is true,
false if it is false. Some examples include '==' (equal to),
'!=' (not equal to), '<' (less than), '>' (greater than), '<='
(less than or equal to) and '>=' (greater than or equal to).
____________________________________________
let x = 10;
let y = 5;
console.log(x == y); // false
console.log(x != y); // true
console.log(x < y); // false
console.log(x > y); // true
console.log(x <= y); // false
console.log(x >= y); // true
____________________________________________
Logical operators are used to test various conditions. They
include '&&' (and), '||' (or) and '!' (no).
____________________________________________
let x = 10;
let y = 5;
let z = 20;
console.log(x > y && x < z); // true
console.log(x > y || x > z); // true
console.log(!(x > y)); // false
____________________________________________
Type operators are used to determine the type of a value or
convert a value from one type to another. The 'typeof'
operator returns the type of a value and the 'instanceof'
operator checks whether an object is an instance of a
specific type.
____________________________________________
let x = "Hello, world!";
let y = new String("Hello, world!");
console.log(typeof x); // "string"
console.log(typeof y); // "object"
console.log(y instanceof String); // true
____________________________________________
In summary, HTML, CSS and JavaScript are the three
fundamental technologies for web development. Mastering
these skills is essential to becoming an effective front-end
developer. We hope this chapter has provided a solid
introduction to HTML and JavaScript operators.
Answer the question about the previous content:

Exercise 29: What are


JavaScript operators and
what are some of the
types mentioned in the
text?
( A ) - JavaScript operators are symbols that specify which
operation to perform, and types include arithmetic,
assignment, comparison, logical, and type operators.
( B ) - JavaScript operators are tags used to define elements
and content on a website, and types include 'head', 'body'
and 'title' operators.
( C ) - JavaScript operators are attributes used to provide
additional information about an element, and types include
'src', 'alt' and 'title'.

Note: The correct answer is on the last page.


INTRODUCTION TO
HTML: BASIC
STRUCTURE, TAGS AND
ATTRIBUTES: CONTROL
STRUCTURES (IF,
SWITCH, FOR, WHILE)

4.26. Introduction to HTML: Basic structure, tags and


attributes: Control structures (if, switch, for, while)

::: Introduction to HTML :::


HTML, which stands for Hyper Text Markup Language, is the
standard markup language for creating web pages and
applications. Combined with cutting-edge technologies like
JavaScript and CSS, HTML allows front-end developers to
create feature-rich websites and applications and visually
stunning.
::: Basic structure of an HTML document :::
A basic HTML document has a specific structure that
includes specific tags that define the head (<head>) and
body (<body>) of the document . The <html> tag is the
document root and all other tags are nested within it. The
<head> tag contains metadata about the document, such
as its title and links to CSS scripts and stylesheets. The
<body> tag contains the actual content of the web page,
such as text, images, videos, etc.
____________________________________________
<!DOCTYPE html>
<html>
<head>
<title>Page title</title>
</head>
<body>
<h1>This is a header</h1>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
</body>
</html>
____________________________________________
::: HTML Tags and Attributes :::
HTML tags are the basis of the HTML language. They define
and describe the content in an HTML document. An HTML
tag is composed of an element name, enclosed in angle
brackets. Some examples include <h1>, <p>, <div>, etc.
HTML attributes provide additional information about
elements. They are always specified in the start element
and usually come in name/value pairs. For example, the
<a> link tag often uses the "href" attribute to specify the
link it should point to.
____________________________________________
<a href="https://www.example.com">This is a link</a>
____________________________________________
::: Control structures in JavaScript :::
JavaScript, like many other programming languages, has
control structures that allow developers to specify different
execution paths based on conditions and loops. The most
common control structures in JavaScript are if, switch, for
and while.
::: if :::
The if statement is a conditional control structure that
executes a block of code if a specified condition is true.
____________________________________________
let x = 20;
if (x > 10) {
console.log("x is greater than 10");
}
____________________________________________
::: switch :::
The switch statement evaluates an expression and executes
the block of code corresponding to the value of the
expression.
____________________________________________
let fruit = "apple";
switch (fruit) {
case "banana":
console.log("I like bananas!");
break;
case "apple":
console.log("Apples are ok.");
break;
default:
console.log("I like all fruits!");
break;
}
____________________________________________
::: for :::
The for loop is a control structure that executes a block of
code a specific number of times.
____________________________________________
for (let i = 0; i < 5; i++) {
console.log(i);
}
____________________________________________
::: while :::
The while loop is a control structure that executes a block of
code as long as a specified condition is true.
____________________________________________
let i = 0;
while (i < 5) {
console.log(i);
i++;
}
____________________________________________
In summary, HTML, CSS and JavaScript are powerful tools
that allow developers to create rich, interactive web
applications. Understanding the basic structure of HTML,
tags and attributes, as well as JavaScript control structures
are fundamental steps to becoming an effective front-end
developer.
Answer the question about the previous content:

Exercise 30: Which of the


following statements
correctly describes the
basic structure of an HTML
document?
( A ) - The <body> tag is the root of the document and all
other tags are nested within it.
( B ) - The <head> tag contains the actual content of the
web page such as text, images, videos, etc.
( C ) - A basic HTML document has a specific structure that
includes specific tags that define the head (<head>) and
body (<body>) of the document. The <html> tag is the
document root and all other tags are nested within it.

Note: The correct answer is on the last page.


INTRODUCTION TO
HTML: BASIC
STRUCTURE, TAGS AND
ATTRIBUTES:
FUNCTIONS IN
JAVASCRIPT

4.27. Introduction to HTML: Basic structure, tags and


attributes: Functions in JavaScript

::: Introduction to HTML: Basic structure, tags and attributes


:::
HTML, which stands for HyperText Markup Language, is the
standard markup language for creating web pages and
applications. Along with CSS and JavaScript, HTML is a
fundamental technology used to create web content.
::: Basic structure of an HTML document :::
An HTML document has a tree structure. The root element is
always the html element. Inside the html element, we have
two child elements: the head and the body. The head
element contains metadata about the document, such as its
title and links to its scripts and CSS stylesheets. The body
element contains the actual content of the document, such
as text, images, videos, etc.
____________________________________________
<!DOCTYPE html>
<html>
<head>
<title>Page title</title>
</head>
<body>
Page content
</body>
</html>
____________________________________________
::: HTML tags and attributes :::
HTML elements are defined using tags. A tag is made up of
the name of the element, surrounded by lower and upper
characters. For example, <html>, <body>, <head>,
<title>, etc.
Some HTML elements can also have attributes. Attributes
provide additional information about the element. They are
always specified at the beginning of the element tag and
consist of a name and a value. For example, the a element,
which is used to create links, has an href attribute that
specifies the URL of the link.
____________________________________________
<a href="https://www.example.com">This is a link</a>
____________________________________________
::: Functions in JavaScript :::
JavaScript is a programming language that allows you to
implement complex functions on web pages. When a web
page is more than just static text and images, but interacts
with the user, JavaScript is likely involved.
Functions are one of the fundamental building blocks in
JavaScript. A function is a JavaScript procedure - a set of
instructions that performs a task or calculates a value. To
use a function, you must define it somewhere in the scope
of where you want to call it.
::: Defining functions :::
A function in JavaScript is similar to a procedure - a set of
instructions that performs a task or calculates a value, but
for a function to be useful, it must be defined. The
JavaScript function definition consists of a function keyword,
followed by a name, a list of parameters enclosed in
parentheses (brackets), and a declaration containing the
code to be executed.
____________________________________________
function functionname(parameter1, parameter2,
parameter3) {
// code to be executed
}
____________________________________________
::: Calling functions :::
Once you define a function, you can execute it by calling it
from another part of your code. To do this, you use the
function name followed by parentheses and provide the
values ??(known as arguments) for the function's
parameters.
____________________________________________
FunctionName(value1, value2, value3);
____________________________________________
We hope this basic information about HTML and JavaScript
provides a solid foundation for you to continue learning and
exploring these programming languages. Remember,
practice is the key to becoming proficient, so keep
practicing and building!
Answer the question about the previous content:

Exercise 31: What is the


function of attributes in
HTML elements?
( A ) - They are used to define the name of the HTML
element.
( B ) - They provide additional information about the
element.
( C ) - They are used to create links in an HTML document.

Note: The correct answer is on the last page.


INTRODUCTION TO
HTML: BASIC
STRUCTURE, TAGS AND
ATTRIBUTES: OBJECTS
AND ARRAYS

4.28. Introduction to HTML: basic structure, tags and


attributes: Objects and arrays

::: Introduction to HTML: basic structure, tags and


attributes :::
HTML, which stands for Hyper Text Markup Language, is
the standard markup language for creating web pages. With
HTML, you can create your own website structure, using
different tags and attributes.
::: Basic Structure of HTML :::
The basic structure of an HTML page consists of three
main parts: the <head> element, the <body> element, and
the &lt element ;html>. The <html> element is the root of
an HTML page. All other HTML elements must be
descendants of this element.
____________________________________________
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
The body of the page...
</body>
</html>
____________________________________________
::: HTML Tags :::
HTML tags are the foundation of any web page. They
define and structure the content on a web page and are
used to create HTML elements such as headings,
paragraphs, lists, links, images, and more.
An HTML tag consists of a tag name, enclosed in angle
brackets. An HTML tag typically comes in pairs, with an
opening tag and a closing tag.
____________________________________________
<p>This is an example of a paragraph tag in HTML.</p>
____________________________________________
::: HTML Attributes :::
HTML attributes are used to provide additional
information about HTML elements. They are always
specified in the opening tag and usually come in
name/value pairs.
For example, the <a> tag (which creates a link) has an
attribute called "href" that specifies where the link should
go:
____________________________________________
<a href="https://www.example.com">This is a link</a>
____________________________________________
::: Introduction to Objects and Arrays in JavaScript :::
::: Objects :::
In JavaScript, an object is a collection of properties, and a
property is an association between a name (or key) and a
value. A property value can be a function, which is then
considered a method of the object.
____________________________________________
var person = {
name: "John",
age: 30,
city: "New York"
};
____________________________________________
::: Arrays :::
An array is a special global object, which is an ordered list
of values. In JavaScript, arrays start with an index of 0.
____________________________________________
var fruits = ["Apple", "Banana", "Strawberry", "Orange",
"Lemon"];
____________________________________________
We hope this introduction to HTML and JavaScript has
been helpful and provided you with a basic understanding of
how these technologies work. In the next chapter, we will
explore CSS in more depth and how it is used to style web
pages.
Answer the question about the previous content:

Exercise 32: What does


HTML mean and what is its
purpose?
( A ) - HTML stands for Hyper Text Markup Language and is
the programming language used to create games.
( B ) - HTML stands for Hyper Text Markup Language and is
the standard markup language for creating web pages.
( C ) - HTML stands for Hyper Text Markup Language and is
the coding language used to create mobile applications.

Note: The correct answer is on the last page.


INTRODUCTION TO
HTML: BASIC
STRUCTURE, TAGS AND
ATTRIBUTES: DOM
MANIPULATION

4.29. Introduction to HTML: basic structure, tags and


attributes: DOM manipulation

::: Introduction to HTML: basic structure, tags and


attributes :::
HTML (HyperText Markup Language) is the fundamental
language used to develop web pages. It is a markup
language, which means it structures the content on the
page using tags. These tags are used to create elements
such as headings, paragraphs, lists, links, images, and
more.
::: Basic structure of HTML :::
A basic HTML page has a specific structure. It starts with
a document type declaration () to tell the browser that it is
an HTML5 page. The page is then wrapped with the <html>
tag, which contains two main sections: <head> and
<body>.
The <head> contains information about the page, such
as the title (which is displayed in the browser's title bar or
tab) and links to CSS (Cascading Style Sheets) or JavaScript,
if necessary. The <body> This is where the visible content
of the page is placed.
::: HTML tags and attributes :::
HTML tags are used to create elements on the page. Each
tag has a specific name and is written between angle
brackets (< and >). Most tags have an opening tag and a
closing tag, with the content in between. For example, the
<p> is used to create a paragraph.
HTML attributes are used to provide additional
information about an element. They are included in the
opening tag and have a name and value. For example, the
<a> (which creates a link) can have an "href" attribute that
defines the URL of the link.
::: DOM manipulation :::
The DOM (Document Object Model) is a representation of
the HTML page as a tree structure of objects. Every element
on the page is an object in the DOM, and we can manipulate
them using JavaScript.
::: Selecting elements :::
We can select elements in the DOM using various
methods. The most common are getElementById (which
selects an element with a specific id),
getElementsByClassName (which selects elements with a
specific class) and getElementsByTagName (which selects
elements with a specific tag).
::: Changing elements :::
After selecting an element, we can change it in several
ways. We can change the content of an element using the
innerHTML property, change the style of an element using
the style property, and change the attributes of an element
using the setAttribute and removeAttribute methods.
::: Adding and removing elements :::
We can also add and remove elements in the DOM. To
add an element, we create a new element using the
createElement method, set its content and attributes as
needed, and then add it to the page using the appendChild
or insertBefore method. To remove an element, we first
select the element and then use the removeChild method.
DOM manipulation is a fundamental part of front-end
development, as it allows you to create dynamic and
interactive websites. By combining HTML, CSS, and
JavaScript, you can create virtually any type of website or
web application you can imagine.
Answer the question about the previous content:

Exercise 33: What is the


function of the
&lt;head&gt; in an HTML
page?
( A ) - It is used to create a paragraph.
( B ) - Contains information about the page, such as the title
and links to CSS or JavaScript if necessary.
( C ) - It is used to select elements in the DOM.

Note: The correct answer is on the last page.


INTRODUCTION TO
HTML: BASIC
STRUCTURE, TAGS AND
ATTRIBUTES: EVENTS IN
JAVASCRIPT

Introduction to HTML: basic structure, tags and attributes:


Events in JavaScript

::: Introduction to HTML :::


HTML, or Hyper Text Markup Language, is the standard
markup language for creating web pages and applications.
Along with CSS and JavaScript, HTML is an essential
technology used by web developers. HTML provides the
structure of a web page, CSS the visual style and JavaScript
the interactivity.
::: Basic structure of HTML :::
An HTML document is made up of two main elements: the
'head' and the 'body'. The 'head' contains information about
the document, including the title that appears in the
browser's title bar and links to CSS and JavaScript files. The
'body' contains the actual content of the page, such as text,
images, videos, links, lists, tables and forms.
Here is the basic structure of an HTML document:
____________________________________________
<!DOCTYPE html>
<html>
<head>
<title>Page title</title>
</head>
<body>
Page content
</body>
</html>
____________________________________________
::: HTML Tags and Attributes :::
HTML tags are used to create HTML elements. A tag is made
up of a tag name (such as 'p' for paragraph, 'h1' for first-
level title, 'img' for image), surrounded by square brackets.
Most tags have an opening tag and a closing tag, with the
element's content in between.
Here is an example of a paragraph element:
____________________________________________
<p>This is a paragraph.</p>
____________________________________________
HTML attributes are used to provide additional information
about an element. They are placed in the opening tag of the
element and are composed of an attribute name and an
attribute value. The attribute value is always enclosed in
quotation marks.
Here is an example of an image element with attributes 'src'
(which specifies the URL of the image) and 'alt' (which
provides alternative text for the image):
____________________________________________
<img src="imagem.jpg" alt="A beautiful image">
____________________________________________
::: Events in JavaScript :::
JavaScript is a programming language that allows you to
add interactivity to a web page. One way to do this is using
JavaScript events.
An event is something that happens in the browser, such as
a mouse click, a key press, a page loading, or an interval of
time that has passed. JavaScript can respond to these
events and execute code when they occur.
To make JavaScript respond to an event, you first need to
identify the HTML element that you want the event to occur
(such as a button), and then you need to specify the event
that you want JavaScript to respond to (such as a mouse
click ). This is done using an event handler.
Here is an example of how to make JavaScript respond to a
mouse click on a button:
____________________________________________
<button onclick="alert('You clicked the button!')">Click me!
</button>
____________________________________________
In this example, the 'onclick' event handler is used to
specify that JavaScript should respond to a mouse click. The
JavaScript code to be executed when the event occurs is
enclosed in quotation marks after the event name. In this
case, the JavaScript code simply displays an alert box with
the message "You clicked the button!".
JavaScript events are an essential part of creating
interactive web pages. They allow you to create pages that
respond to user actions and provide a more dynamic and
engaging user experience.
Answer the question about the previous content:

Exercise 34: What is the


role of the HTML language
in creating web pages and
applications?
( A ) - HTML is used to provide interactivity on a web page.
( B ) - HTML provides the structure of a web page.
( C ) - HTML is used to define the visual style of a web page.

Note: The correct answer is on the last page.


INTRODUCTION TO
HTML: BASIC
STRUCTURE, TAGS AND
ATTRIBUTES: AJAX AND
FETCH API

::: 4.31. Introduction to HTML: basic structure, tags and


attributes: AJAX and Fetch API :::
HTML, or HyperText Markup Language, is the standard
markup language for documents designed to be displayed in
a web browser. HTML is the cornerstone of any web
developer. It is the basic structure of any web page. A web
page without HTML is like a building without a foundation.
Therefore, a solid understanding of HTML is crucial to
becoming a front-end developer.
::: Basic structure of HTML :::
The basic structure of HTML consists of tags that are used to
define and organize content on the web page. Each HTML
document begins with the document type declaration. This
is followed by the html tag that encapsulates the entire
content of the web page. Within this html tag, we have two
main parts: the head tag and the body tag.
____________________________________________
<!DOCTYPE html>
<html>
<head>
<title>Page title</title>
</head>
<body>
Page content
</body>
</html>
____________________________________________
The head tag contains metadata about the web page, such
as the page title, links to CSS and JavaScript, and various
other information that is not displayed directly on the web
page. The body tag contains the actual content of the web
page that is displayed in the browser.
::: HTML Tags and Attributes :::
HTML tags are the foundation of HTML. They define and
organize the content on the web page. Each tag begins with
a angle bracket (<) followed by the tag name and ends with
an angle bracket (>). Most HTML tags come in pairs,
meaning they have an opening tag and a closing tag. The
closing tag is similar to the opening tag, but it has a forward
slash (/) before the tag name. For example, the paragraph
tag is written as <p> to open and </p> to close.
HTML attributes are used to provide additional information
about HTML tags. They are always specified in the opening
tag and usually come in name/value pairs. For example, the
link tag (<a>) uses the href attribute to specify the URL of
the link.
____________________________________________
<a href="https://www.example.com">This is a link</a>
____________________________________________
::: AJAX and Fetch API :::
AJAX, or Asynchronous JavaScript and XML, is a technique
that allows web pages to be updated asynchronously,
sending and receiving data from the server without
interfering with the display and behavior of the existing
page. This means you can update parts of a web page
without reloading the entire page.
The Fetch API provides an interface for fetching resources
(including cross-origin resources) on the web. It is a more
modern and flexible alternative to AJAX, with a more
powerful and easier to use API. The Fetch API returns
promises and uses cleaner, more elegant syntax, making
the code more readable and easier to maintain.
____________________________________________
fetch('https://api.exemplo.com/dados')
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
____________________________________________
In short, HTML is the markup language we use to structure
and give meaning to our content on the web, defining what
is a header, a paragraph, a link, etc. HTML tags and
attributes are the foundation of HTML, while AJAX and the
Fetch API are powerful techniques that allow you to create
dynamic, interactive user experiences on the web.
Answer the question about the previous content:

Exercise 35: What is the


Fetch API and how does it
relate to AJAX?
( A ) - Fetch API is a technique that allows web pages to be
updated asynchronously, similar to AJAX, but is a more
modern and flexible alternative with a more powerful and
easier to use API.
( B ) - The Fetch API is a set of rules for writing HTML and
has no relation to AJAX.
( C ) - The Fetch API is a type of HTML tag used to create
links and has no relation to AJAX.

Note: The correct answer is on the last page.


INTRODUCTION TO
HTML: BASIC
STRUCTURE, TAGS AND
ATTRIBUTES:
INTRODUCTION TO
ES6+

4.32. Introduction to HTML: basic structure, tags and


attributes: Introduction to ES6+

::: Introduction to HTML :::


HyperText Markup Language, or HTML, is the standard
language for creating web pages and applications.
Understanding the basic structure of HTML, as well as its
tags and attributes, is essential for any front-end developer.
::: Basic Structure :::
The basic structure of an HTML page consists of three main
parts: the DOCTYPE, the head and the body.

---DOCTYPE: This is the first line of any HTML document. It


tells the browser which version of HTML the document is
using.
---Head: This section contains information about the page,
such as the title that appears in the browser's title bar and
links to the CSS and JavaScript files that the page uses.
---Body: This is the part of the page that users actually see.
It contains all the page content such as text, images, videos,
forms, and so on.

::: Tags and Attributes :::


HTML tags are the building blocks of any web page. They
define the type of content that is being inserted on the
page. Each tag has a specific name and is written in angle
brackets (< and >).
Attributes are used to provide additional information about
tags. They are included within the opening tag and usually
come in name/value pairs.
For example, the link tag (<a>) is used to create links on a
web page. It has an attribute called 'href' that specifies the
URL of the page the link points to.
::: Introduction to ES6+ :::
ES6, also known as ECMAScript 2015, is a version of
JavaScript that introduced a number of new features and
significant improvements to the language.
ES6+ includes all versions of ECMAScript released after ES6,
including ES7 (ECMAScript 2016), ES8 (ECMAScript 2017),
ES9 (ECMAScript 2018), ES10 (ECMAScript 2019), and so on.
</p >
::: Key features of ES6+ :::

---Let and Const: These are new keywords introduced to


declare variables. 'Let' is similar to 'var' but has block scope
instead of function scope. 'Const' is used to declare
constants, i.e. variables that cannot be reassigned.
---Arrow Functions: This is a new syntax for writing functions
in JavaScript. They are shorter and easier to write than
traditional functions.
---Promises: Promises are objects that represent the
eventual result of an asynchronous operation. They are used
to handle asynchronous operations in a more efficient and
flexible way.

These are just some of the many new features and


improvements introduced by ES6+. Learning and
understanding these concepts is critical for any modern
JavaScript developer.
Answer the question about the previous content:

Exercise 36: Which of the


following statements
about the basic structure
of an HTML page is true?
( A ) - The "body" part of the page is where the browser is
informed which version of HTML the document is using.
( B ) - The "head" section contains all the page content that
users actually see, such as text, images, videos, forms, and
so on.
( C ) - The first line of any HTML document is the DOCTYPE,
which tells the browser which version of HTML the document
is using.

Note: The correct answer is on the last page.


INTRODUCTION TO
HTML: BASIC
STRUCTURE, TAGS AND
ATTRIBUTES: PROMISES
AND ASYNC/AWAIT

Introduction to HTML: Basic structure, tags and


attributes: Promises and async/await

::: Introduction to HTML :::


HTML, or HyperText Markup Language, is the standard
markup language for documents designed to be displayed in
a web browser. It is one of the core technologies of the
World Wide Web and is an essential skill for any front-end
developer.
::: Basic structure of an HTML document :::
The basic structure of an HTML document consists of
nested tags. Each document begins with the <!DOCTYPE
html> tag, which tells the browser that the following is an
HTML5 document. Next, we have the <html> that involves
the entire content of the page.
Within the <html> tag, we have two main parts: the
<head> and <body>. The <head> contains metadata
about the document, such as the page title, links to CSS
stylesheets, and JavaScript scripts. The <body> contains
the main content that is displayed in the browser.
::: HTML tags and attributes :::
HTML tags are the building blocks of any web page. They
define the structure and layout of the content. Each tag
begins with a angle bracket (<) and ends with an angle
bracket (>). The most common tags include <h1> to <h6>
for headers, <p> for paragraphs, <a> for links, <img> for
images, and many more.
Attributes provide additional information about HTML
elements. They come in name/value pairs and are always
included at the beginning of the tag. For example, the link
tag <a> usually comes with the 'href' attribute, which
specifies the URL the link should point to.
::: Introduction to Promises and async/await in JavaScript
:::
JavaScript is a programming language that allows you to
add complex interactivity to websites. One of JavaScript's
most powerful features is its ability to handle asynchronous
operations, such as fetching data from a server. This is done
using Promises and the async/await syntax.
::: Promises in JavaScript :::
A Promise in JavaScript is an object that represents the
eventual completion or failure of an asynchronous
operation. It serves as a proxy for a value that may not be
known when the promise is created. A promise can be in
one of three states: pending, fulfilled, or rejected.
Promises are used to handle asynchronous operations in a
more flexible and robust way than old callbacks. They can
be chained and manipulated in a way that avoids the so-
called "callback hell", where we have many nested callbacks
and the code becomes difficult to read and maintain.
::: Async/Await in JavaScript :::
async/await is a special syntax in JavaScript that makes
working with Promises more comfortable and easier to
understand. The 'async' keyword is used to declare a
function as asynchronous, which means it will return a
Promise. The 'await' keyword is used to pause the execution
of the asynchronous function until the Promise is resolved or
rejected.
Using async/await makes asynchronous code look more
like synchronous code, which can make it easier to
understand and maintain. However, it's important to note
that although the code may appear synchronous, it still runs
asynchronously, meaning it doesn't block the rest of the
code from running.
Answer the question about the previous content:

Exercise 37: What is the


function of the
&lt;head&gt; in an HTML
document?
( A ) - Defines the structure and layout of the content.
( B ) - Contains metadata about the document, such as the
page title, links to CSS stylesheets, and JavaScript scripts.
( C ) - Represents the eventual completion or failure of an
asynchronous operation.

Note: The correct answer is on the last page.


INTRODUCTION TO
HTML: BASIC
STRUCTURE, TAGS AND
ATTRIBUTES:
INTRODUCTION TO
NODE.JS AND NPM

Complete HTML, CSS and Javascript Course

::: 4.34. Introduction to HTML: Basic Structure, Tags and


Attributes :::
HTML, or Hyper Text Markup Language, is the markup
language that defines the structure of a web page. It is the
backbone of any website and is essential for front-end
development. Let's start with the basic structure of an HTML
page.
::: Basic Structure :::
An HTML page is made up of a series of elements, each
represented by a tag. The outermost tag is the <html> tag,
which encapsulates the entire content of the page. Within
this tag, we have two main sections: <head> and <body>.
The <head> contains meta information about the page,
such as the title (which appears in the browser tab), links to
CSS stylesheets, JavaScript scripts, and other information
that is not directly visible to the user.

The <body> This is where all of the page's visible


content resides. This includes text, images, links, forms,
buttons and more.
::: Tags and Attributes :::
Tags are used to mark the beginning and end of an
element. For example, text that you want to appear as a
paragraph would be placed between the <p> and </p>.
There are many tags in HTML, each with a specific purpose.

In addition, tags can contain attributes, which provide


additional information about the element. For example, the
<a> (which creates a link) usually contains the 'href'
attribute, which specifies the URL the link should point to.
::: Introduction to Node.js and NPM :::
Node.js is a JavaScript runtime environment that allows
you to run JavaScript code on the server side. This is useful
for creating web servers, interacting with databases, and
more. Node.js comes with a built-in package manager called
NPM (Node Package Manager), which makes it easy to install
and manage JavaScript libraries and tools.
::: What is Node.js? :::
Node.js is a JavaScript runtime environment built on
Google Chrome's V8 JavaScript engine. It allows developers
to use JavaScript to write code that runs on the server, not
just in the user's browser. This opens up a number of
possibilities, including creating web servers, performing I/O
operations (such as reading and writing files), and
interacting with databases.
::: What is NPM? :::
NPM is the default package manager for Node.js. It makes
it easy to install and manage JavaScript code libraries,
called packages. NPM also allows developers to share and
distribute their code with the community. With NPM, you can
install packages into your project with a single command,
and it will take care of resolving and installing any
dependencies.
To use NPM, you need to install Node.js on your
computer. Once installed, you can use the 'npm install'
command to install packages into your project.
Answer the question about the previous content:

Exercise 38: What is HTML


and what is its function?
( A ) - HTML is a JavaScript runtime environment that allows
you to execute JavaScript code on the server side.
( B ) - HTML, or Hyper Text Markup Language, is the markup
language that defines the structure of a web page. It is the
backbone of any website and is essential for front-end
development.
( C ) - HTML is the default package manager for Node.js. It
makes it easy to install and manage JavaScript code
libraries, called packages.

Note: The correct answer is on the last page.


INTRODUCTION TO
HTML: BASIC
STRUCTURE, TAGS AND
ATTRIBUTES: POPULAR
FRAMEWORKS AND
LIBRARIES (REACT,
ANGULAR, VUE)

4.35. Introduction to HTML: basic structure, tags and


attributes: Popular frameworks and libraries (React, Angular,
Vue)

::: Introduction to HTML :::


HTML, or HyperText Markup Language, is the standard
markup language for documents designed to be displayed in
a web browser. HTML is the foundation of any website or
web page you see on the internet. It is one of the main tools
that any front-end developer needs to understand and use
effectively.
::: Basic structure of HTML :::
A basic HTML document consists of three main parts: the
head (<head>), the body (<body>), and the HTML tag
(<html>).

---The <html> is the root of the HTML document and


everything that is part of the HTML document must be
within this tag.
---The <head> contains metadata about the document,
such as the page title, links to CSS, JavaScript scripts, and
more. This information is not displayed in the main content
of the web page, but is vital to the functionality of the page.
---The <body> This is where the main content of the HTML
document is placed. This includes text, images, lists, links,
videos and more.

::: HTML tags and attributes :::


HTML uses 'tags' to mark different types of content. Each
tag begins with a angle bracket (<) and ends with an angle
bracket (>). Each HTML element has an opening tag and a
closing tag, with content in between. For example, to create
a paragraph, we use the opening tag <p>, followed by the
paragraph text, and then the closing tag </p>.
HTML attributes are used to provide additional information
about HTML elements. They are always specified in the
opening tag and usually come in name/value pairs. For
example, the link tag (<a>) uses the 'href' attribute to
specify the URL of the link.
::: Popular frameworks and libraries :::
While HTML, CSS and JavaScript are the fundamental tools
for web development, there are several libraries and
frameworks available that can help speed up the
development process and create more efficient and
effective websites.
::: React :::
React is a JavaScript library for building user interfaces.
Developed by Facebook, React allows developers to create
large web applications that can change data without
reloading the page. React's main advantage is development
speed and efficiency, thanks to its reusable component
system.
::: Angular :::
Angular is a JavaScript framework developed by Google. It
allows developers to create rich and efficient web
applications with a single page. Angular is known for being
comprehensive and efficient, with a large set of built-in tools
and functionality.
::: Vue :::
Vue is a JavaScript framework for building user interfaces.
Compared to React and Angular, Vue is known for being
lighter and easier to learn, making it an excellent choice for
smaller projects or for developers who are just starting to
learn front-end development.
In short, HTML is the foundation of web development, but
development efficiency and effectiveness can be improved
by using libraries and frameworks such as React, Angular
and Vue. The choice of framework or library to use will
depend on the specific needs of the project and the
developer's experience.
Answer the question about the previous content:

Exercise 39: Which of the


following statements is
true about the basic
structure of an HTML
document?
( A ) - The <head> This is where the main content of the
HTML document is placed.
( B ) - The <html> is the root of the HTML document and
everything that is part of the HTML document must be
inside this tag.
( C ) - The <body> contains metadata about the document,
such as the page title, links to CSS, JavaScript scripts, and
more.

Note: The correct answer is on the last page.


FORMATTING TEXT
WITH HTML

Text Formatting with HTML

::: Chapter 5: Formatting Text with HTML :::


HTML, an acronym for HyperText Markup Language, is the
backbone of almost every website on the internet. It is used
to structure the content of a web page and includes several
tags to format and organize the text. In this chapter, we will
explore the various ways to format text using HTML.
::: 1. Title Elements :::
Heading elements in HTML are used to define the titles
and subtitles of a page. They range from <h1> to <h6>,
with <h1> being the largest and most important, and <h6>
being the smallest and least important. For example:
____________________________________________
<h1>This is an H1 heading</h1>
<h2>This is an H2 heading</h2>
<h3>This is an H3 heading</h3>
____________________________________________
::: 2. Paragraph Elements :::
The paragraph element <p> is probably the most
commonly used in HTML text formatting. It is used to define
a paragraph of text. For example:
____________________________________________
<p>This is an example of a paragraph in HTML.</p>
____________________________________________
::: 3. Elements of Emphasis :::
There are several emphasis elements in HTML that allow
you to change the appearance of text to highlight important
parts. The most common are <strong>, for bold text, and
<em>, for italic text. For example:
____________________________________________
<strong>This text is in bold.</strong>
<em>This text is in italics.</em>
____________________________________________
::: 4. List Elements :::
Lists are an important part of HTML text formatting. There
are two main types of lists: ordered lists (<ol>) and
unordered lists (<ul>). Ordered lists have numbers or
letters as bullets, while unordered lists have bullet points.
For example:
____________________________________________
<ol>
<li>This is the first item in an ordered list.</li>
<li>This is the second item in an ordered list.</li>
</ol>
<ul>
<li>This is the first item in an unordered list.</li>
<li>This is the second item in an unordered list.</li>
</ul>
____________________________________________
::: 5. Link Elements :::
The link element <a> is used to create links in HTML. You
can use the href attribute to define the link URL. For
example:
____________________________________________
<a href="https://www.example.com">This is a link to
example.com</a>
____________________________________________
::: 6. Citation Elements :::
There are several citation elements in HTML that allow
you to format text citations in various ways. For example,
<blockquote> is used for long block quotes, while <q> is
used for short in-line quotes. For example:
____________________________________________
<blockquote>This is a long block quote.</blockquote>
<q>This is a short inline quote.</q>
____________________________________________
These are just a few examples of how you can format text
using HTML. There are many other elements and attributes
available, and the best way to learn about them is to
practice and experiment on your own. Remember, the
purpose of HTML text formatting is to make your web page
content clear and easy to read for your users.
Answer the question about the previous content:

Exercise 40: What is the


purpose of text formatting
in HTML?
( A ) - Making web page content difficult to read.
( B ) - Make web page content clear and easy to read.
( C ) - Make web page content invisible.

Note: The correct answer is on the last page.


LISTS AND TABLES IN
HTML
HTML lists and tables are essential tools for organizing
information on a website. They allow you to present data in
a structured, easy-to-understand way, which can
significantly improve the user experience. This chapter of
our e-book will cover these two elements in detail to help
you become an efficient Front End developer.
::: Lists in HTML :::
In HTML, we have three main types of lists: ordered lists,
unordered lists, and defining lists.
::: Ordered Lists :::
Ordered lists are used when the order of items is important.
They are created using the <ol> tag. Each list item is placed
within a <li> tag. See the example below:
____________________________________________
<ol>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
</ol>
____________________________________________
::: Unordered Lists :::
Unordered lists are used when the order of items does not
matter. They are created using the <ul> tag. As with
ordered lists, each item is placed within a <li> tag. See the
example:
____________________________________________
<ul>
<li>Item</li>
<li>Other item</li>
<li>One more item</li>
</ul>
____________________________________________
::: Definition Lists :::
Definition lists are used to list terms and their definitions.
They are created using the tags <dl>, <dt> (for term) and
<dd> (for definition). See the example:
____________________________________________
<dl>
<dt>HTML</dt>
<dd>Markup language used to structure content on the
web.</dd>
<dt>CSS</dt>
<dd>Style language used to describe the presentation of a
document written in HTML.</dd>
</dl>
____________________________________________
::: Tables in HTML :::
Tables are used to present data in rows and columns. They
are created using various tags, including <table> (to create
the table), <tr> (to create a line), <td> (to create a cell)
and <th> (to create a table header).
See an example of how to create a table in HTML:
____________________________________________
<table>
<tr>
<th>Name</th>
<th>Age</th>
</tr>
<tr>
<td>John</td>
<td>25</td>
</tr>
<tr>
<td>Maria</td>
<td>30</td>
</tr>
</table>
____________________________________________
In addition to these basic tags, there are several other tags
and attributes that you can use to control the appearance
and behavior of your tables. For example, you can use the
<caption> To add a title to your table, the <colgroup> to
specify properties for multiple columns at once, and the
'colspan' attribute to make a cell span multiple columns.
We hope this chapter has given you a good understanding
of how to use lists and tables in HTML. Remember that
practice is the key to becoming an efficient Front End
developer, so be sure to try out what you've learned on your
own projects. In the next chapter, we'll explore CSS, the
language we use to style our websites and make them
visually appealing.
Answer the question about the previous content:

Exercise 41: What are the


three main types of lists in
HTML and what tag is
used to create each of
them?
( A ) - Ordered lists (<ol>), unordered lists (<ul>), and
definition lists (<dl>)
( B ) - Ordered lists (<ul>), unordered lists (<ol>), and
definition lists (<li>)
( C ) - Ordered lists (<li>), unordered lists (<ol>), and
definition lists (<ul>)

Note: The correct answer is on the last page.


FORMS AND INPUTS IN
HTML
::: 7. Forms and inputs in HTML :::
Forms are an essential part of a user's interaction with a
web page. They allow users to input data that can be sent to
a server for processing. Forms can be used for things like
searching, logging in, signing up, and more. In this chapter,
we will discuss how to create forms and use different input
types in HTML.
::: HTML Forms :::
HTML forms are created using the <form> tag. The <form>
acts as a container for different form elements like input
fields, buttons, and more.
____________________________________________
<form action="/submit" method="post">
<!-- form elements here -->
</form>
____________________________________________
The 'action' attribute in the <form> Specifies where form
data should be sent when the form is submitted. The
'method' attribute specifies how form data should be
submitted. The most common methods are 'get' and 'post'.
::: Inputs in HTML :::
Input fields are used to collect user data. They are created
using the <input> tag. There are many different types of
input fields that can be used, depending on the type of data
you want to collect.
::: Text :::
To collect a single line of text, you can use the 'text' input
type.
____________________________________________
<input type="text" name="firstname" id="firstname">
____________________________________________
The 'name' attribute is used to identify the input field when
data is sent. The 'id' attribute is used to identify the input
field in CSS and JavaScript.
::: Password :::
To collect a password, you can use the 'password' input
type. This hides characters as they are typed.
____________________________________________
<input type="password" name="password"
id="password">
____________________________________________
::: Email :::
To collect an email address, you can use the 'email' input
type. This automatically validates the field to ensure a valid
email address is entered.
____________________________________________
<input type="email" name="email" id="email">
____________________________________________
::: Buttons :::
Buttons are used to submit the form. They are created using
the <button> or the <input> with the type set to 'submit'.
____________________________________________
<button type="submit">Submit</button>
<input type="submit" value="Submit">
____________________________________________
::: Other types of input :::
There are many other input types you can use, including
'radio', 'checkbox', 'file', 'date', 'color' and more. Each type
has its own specific characteristics and uses.
::: Conclusion :::
Forms and input fields are an essential part of building
interactive websites. They allow you to collect user data and
send it to a server for processing. By understanding how to
use different types of input fields, you can create more
efficient and effective forms that meet your users' needs.
Practice creating different types of forms and using different
types of input. Experiment with different attributes and see
how they affect your form's behavior. Remember, the best
way to learn is by doing!
Answer the question about the previous content:

Exercise 42: What is the


function of the
&lt;form&gt; in HTML and
what attributes are
commonly used with it?
( A ) - The <form> is used to create buttons and the
commonly used attributes are 'action' and 'method'.
( B ) - The <form> is used to create input fields and the
commonly used attributes are 'name' and 'id'.
( C ) - The <form> is used as a container for different form
elements and the commonly used attributes are 'action' and
'method'.

Note: The correct answer is on the last page.


INTRODUCTION TO CSS:
SELECTORS,
PROPERTIES AND
VALUES

::: Chapter 8: Introduction to CSS: selectors, properties and


values :::
For a website to be visually attractive and functional, it
requires more than just HTML. This is where CSS (Cascading
Style Sheets) comes into play. CSS is a styling language
used to describe the appearance and formatting of a
document written in HTML. It is fundamental to web
development and is used to define colors, fonts, layout and
more.
::: CSS Selectors :::
CSS selectors are the part of CSS that selects the HTML
element you want to style. There are several types of
selectors, but we will focus on the most common: element,
class and ID selectors.

---Element Selectors: They select elements based on the


name of the HTML element. For example, if we want to style
all paragraphs (<p>) in our document, we will use the
element selector. Example: p {color: red;}
---Class Selectors: They select elements based on the class
attribute of the HTML element. Classes are useful when you
want to create CSS styling that can be reused. Example:
.myClass {font-size: 20px;}
---ID Selectors: They select elements based on the ID
attribute of the HTML element. IDs are unique and should be
used when you want to style a single element. Example:
#myID {background-color: blue;}

::: CSS Properties :::


CSS properties are what you want to style in the selected
element. For example, you may want to change the
background color, font, font color, spacing, margin, border,
and more. Each property has a name and is followed by a
colon and a value. For example: p {color: red;} - 'color' is
the property and 'red' is the value.
::: CSS Values :::
CSS values ??are the adjustments you make to the chosen
property. In the previous example, 'red' is the value we
assigned to the 'color' property. Values ??can be keywords
such as 'red', 'blue', 'green', numbers, percentages, and a
wide range of other options depending on the property you
are styling.
::: Conclusion :::
Understanding CSS selectors, properties, and values ??is
critical to becoming an effective front-end developer. They
are the foundation for creating visually appealing and
functional websites. In the next chapter, we'll explore CSS
deeper, learning about the CSS box model, positioning,
animations, and more.
Answer the question about the previous content:

Exercise 43: What are CSS


selectors and what are the
three most common types
mentioned in the text?
( A ) - CSS selectors are the part of HTML that selects the
element you want to style. The three most common types
are: attribute, tag and group selectors.
( B ) - CSS selectors are the part of CSS that selects the
HTML element you want to style. The three most common
types are: element, class and ID selectors.
( C ) - CSS selectors are the part of JavaScript that selects
the element you want to style. The three most common
types are: event, function and variable selectors.

Note: The correct answer is on the last page.


INTRODUCTION TO CSS:
SELECTORS,
PROPERTIES AND
VALUES:
INTRODUCTION TO CSS
::: 8.1. Introduction to CSS: selectors, properties and values
:::
CSS, or Cascading Style Sheets, is a style language that is
used to describe the appearance and formatting of a
document written in HTML. CSS is one of the main front-end
technologies, along with HTML and JavaScript, that are used
to create and design websites.
So what are selectors, properties and values ??in CSS? Let's
start with selectors.
::: CSS Selectors :::
CSS selectors are the part of CSS that determines which
HTML elements on a page will be styled. In other words,
they "select" which elements will receive certain CSS styles.
There are several types of CSS selectors, including type
selectors, class selectors, ID selectors, attribute selectors,
pseudo-class selectors, and pseudo-element selectors.
Type selectors select HTML elements based on their element
type. For example, the 'h1' type selector would select all h1
elements on a page.
Class selectors select HTML elements based on their class.
Classes are HTML attributes that can be added to any HTML
element. For example, the class selector '.intro' would select
all elements with the class 'intro'.
ID selectors select HTML elements based on their ID. IDs are
unique HTML attributes that can be added to any HTML
element. For example, the ID selector '#header' would
select the element with the ID 'header'.
::: CSS Properties :::
CSS properties are the aspects of HTML elements that you
want to style. For example, you may want to change the
background color, font, font size, margin, padding, height,
width, and many other aspects of an HTML element. Each of
these things you might want to change is a CSS property.
For example, the 'color' property is used to change the color
of an element's text. The 'font-size' property is used to
change the font size of an element. The 'background-color'
property is used to change the background color of an
element.
::: CSS Values :::
CSS values ??are the specific values ??you assign to a CSS
property. For example, if you wanted the text of an element
to be red, you would use the 'color' property and assign the
value 'red' to it.
Values ??can be many different things depending on the
property. For example, for the 'color' property, the values ??
can be color names, such as 'red', 'blue', or 'green', or they
can be hexadecimal color codes, such as '#FF0000' for red.
</p >
For the 'font-size' property, values ??can be units of
measurement, such as 'px' for pixels, 'em' for the width of
the letter 'M' in the current font, or '%' for a relative size to
the font size of the parent element.
In conclusion, CSS is a powerful styling language that allows
you to style HTML elements in many different ways. By
understanding CSS selectors, properties, and values, you
can start creating more complex and attractive website
designs.
Answer the question about the previous content:

Exercise 44: What are


selectors, properties and
values ​in CSS?
( A ) - Selectors are the HTML elements you want to style,
properties are the specific values ​you assign to a selector,
and values ​are different types of selectors.
( B ) - Selectors are the part of CSS that determines which
HTML elements are styled, properties are the aspects of the
HTML elements that you want to style, and values ​are the
specific values ​you assign to a CSS property.
( C ) - Selectors are the specific values ​you assign to a CSS
property, properties are the part of CSS that determines
which HTML elements are styled, and values ​are the aspects
of HTML elements that you want to style.

Note: The correct answer is on the last page.


INTRODUCTION TO CSS:
SELECTORS,
PROPERTIES AND
VALUES:
UNDERSTANDING WHAT
CSS SELECTORS ARE

Complete HTML, CSS and Javascript Course to become a


Front End Developer

::: 8.2. Introduction to CSS: selectors, properties and


values :::
The CSS (Cascading Style Sheets) language is a powerful
tool that allows developers to control the style and layout of
a website. CSS allows you to apply styles to HTML elements
on a website without changing the page content. This is
done through the use of selectors, properties and values.

::: CSS Selectors :::


CSS selectors are the way to choose which HTML element
a set of CSS styles will be applied to. There are several
types of selectors in CSS, each with its own rules and uses.
The most common are the type, class and id selectors.

A type selector is simply the name of an HTML tag. For


example, to style all paragraphs in a document, you would
use the "p" type selector.

A class selector is a name you give to a set of styles so


you can reuse them in multiple places in a document. To use
a class selector, you add the "class" attribute to an HTML
element and then reference that class in your CSS using a
period followed by the class name.

An ID selector is similar to a class selector, but is used to


identify a single element in a document. To use an ID
selector, you add the "id" attribute to an HTML element and
then reference that ID in your CSS using a hashtag followed
by the ID name.

::: CSS Properties :::


CSS properties are the aspects of the style that you want
to change. Each property has a specific name and can be
used to control things like the background color of an
element, the font used for text, the thickness of an
element's border, etc.

For example, the "color" property is used to change the


color of an element's text. The "font-family" property is used
to change the font of an element's text. The "border-width"
property is used to change the thickness of an element's
border.
::: CSS Values :::
CSS values ??are the specific settings you want to apply
to a property. For example, if you are using the "color"
property, the value would be the specific color you want the
text to be.

Values ??can be keywords such as "red" or "blue",


numbers such as "12px" or "50%", or even more complex
values ??such as "rgb(255, 0, 0)" to red or "url(image.jpg)"
to use an image as a background.

In summary, selectors are used to choose which HTML


element the style will be applied to, properties are used to
choose which aspect of the style will be changed, and
values ??are used to choose the specific setting that will be
applied to the property.

Understanding how these three components work


together is critical to understanding CSS and creating
effective styles for your sites.
Answer the question about the previous content:

Exercise 45: Which of the


following statements is
true about CSS?
( A ) - CSS selectors are used to choose the background
color of an element.
( B ) - CSS properties are used to identify a single element in
a document.
( C ) - CSS values ​are the specific settings you want to apply
to a property.

Note: The correct answer is on the last page.


INTRODUCTION TO CSS:
SELECTORS,
PROPERTIES AND
VALUES: TYPES OF CSS
SELECTORS: ELEMENT,
CLASS AND ID
::: 8.3. Introduction to CSS: selectors, properties and values
:::
Studying CSS (Cascading Style Sheets) is essential for any
front-end developer. It is the language that gives style and
layout to web pages, making them visually attractive and
functional. In this chapter, we will focus on a fundamental
aspect of CSS: selectors, properties, and values.
Additionally, we'll explore the three main types of CSS
selectors: Element, Class, and ID.
::: CSS Selectors :::
Selectors are the way CSS identifies the HTML elements it
wants to style. There are several types of selectors, but we
will focus on the main three: Element, Class and ID.
::: Element Selectors :::
Element selectors are the most basic. They select HTML
elements based on their tag name. For example, if we want
to style all paragraphs (<p>) on a page, we can use the 'p'
element selector.
____________________________________________
P{
color: blue;
font-size: 14px;
}
____________________________________________
In this example, all paragraphs on the page will be rendered
in blue and with a font size of 14px.
::: Class Selectors :::
Class selectors are more specific than element selectors.
They select HTML elements based on a class assigned to
them. Classes are assigned to HTML elements using the
'class' attribute. For example, we can assign the 'highlight'
class to a specific paragraph (<p>) like this:
____________________________________________
<p class="highlighted">This is a highlighted paragraph.
</p>
____________________________________________
And then, we can use the '.highlight' class selector to style
just that paragraph:
____________________________________________
.emphasis {
color: red;
font-size: 18px;
}
____________________________________________
In this example, only the paragraph with the 'highlight' class
will be rendered in red and with a font size of 18px.
::: ID Selectors :::
ID selectors are the most specific of all. They select a single
HTML element based on an ID assigned to it. IDs are
assigned to HTML elements using the 'id' attribute. For
example, we can assign the ID 'title' to a specific header
(<h1>) like this:
____________________________________________
<h1 id="title">This is the title.</h1>
____________________________________________
And then, we can use the '#title' ID selector to style just
that header:
____________________________________________
#title {
color: green;
font-size: 24px;
}
____________________________________________
In this example, only the header with the ID 'title' will be
rendered in green and with a font size of 24px.
::: CSS Properties and Values :::
Once we select the HTML elements we want to style, we use
CSS properties and values ??to define the style. Properties
are aspects of the style that we want to change, such as
color, font size, margin, padding, etc. Values ??are the
specific settings we want to apply to these properties.
For example, in the CSS rule below:
____________________________________________
P{
color: blue;
font-size: 14px;
}
____________________________________________
'color' and 'font-size' are properties, while 'blue' and '14px'
are their respective values.
There are many different CSS properties and values ??to
learn, and the right combination can create an endless
variety of styles for your web pages.
In summary, CSS selectors, properties, and values ??are
powerful tools in your front-end development arsenal.
Understanding how they work and when to use them is key
to creating visually appealing and functional web pages.
Answer the question about the previous content:

Exercise 46: What are the


three main types of CSS
selectors mentioned in the
text?
( A ) - Element, Class and ID
( B ) - Tag, Class and ID
( C ) - Element, Attribute and ID
( D ) - Tag, Attribute and Class

Note: The correct answer is on the last page.


INTRODUCTION TO CSS:
SELECTORS,
PROPERTIES, AND
VALUES: COMBINING
CSS SELECTORS
::: 8.4. Introduction to CSS: Selectors, Properties and Values:
Combining CSS Selectors :::
Cascading Style Sheets (CSS) are a style language used to
describe the appearance of a document written in HTML.
They are used to control the layout of multiple web pages at
once. In this section, we will discuss selectors, properties,
and values ??in CSS and how to combine them to create
effective and attractive styles for your web pages.
::: CSS Selectors :::
CSS selectors are the means by which designers identify
which HTML page elements should receive CSS styles. They
can be divided into five categories: simple, combinator,
pseudo-class, pseudo-element and attribute.
Simple selectors include type selector (e.g. h1, p), class
selector (e.g. .intro, .footer), and ID selector (e.g. #navbar,
#logo). They select elements based on element name,
element class, or element ID, respectively.
Combinator selectors include the descendant combinator
(e.g. div p), the child combinator (e.g. ul > li), and the
adjacent combinator (e.g. h1 + p). They select elements
based on their specific relationships to other elements.
Pseudo-class selectors include :hover, :focus, :active,
:visited, and :link. They select elements based on their
specific state.
Pseudo-element selectors include ::before, ::after, ::first-
letter, and ::first-line. They select a specific part of an
element.
Attribute selectors include [attr], [attr=value],
[attr~=value], [attr|=value], [attr^=value], [attr$=value],
and [attr* =value]. They select elements based on a specific
attribute or attribute value.
::: CSS Properties and Values :::
CSS properties are the aspects of HTML elements that you
want to style. For example, you may want to change the
text color, font type, font size, line spacing, margin,
padding, border, background, etc.
CSS values ??are the specific styles you apply to properties.
For example, you might want the text to be red, the font to
be Arial, the font size to be 14px, the line spacing to be 1.5,
the margin to be 10px, the padding to be 5px, the border to
be solid 1px black, the flat background is blue, etc.
::: Combining CSS Selectors :::
Combining CSS selectors is a powerful way to apply styles to
specific elements on your web page. For example, you
might want to apply a style to all paragraphs within a
specific div. To do this, you can combine the div type
selector with the p type selector using the descendant
combinator. The combined selector would be div p.
Another example would be to apply a style to all list items
that are direct children of a specific unordered list. To do
this, you can combine the ul type selector with the li type
selector using the child combinator. The combined selector
would be ul > li.
Also, you may want to apply a style to a specific element
when it is in a specific state. For example, you may want to
change the color of a link's text when the mouse is over it.
To do this, you can combine the a type selector with the
:hover pseudo-class selector. The combined selector would
be a:hover.
In conclusion, combining CSS selectors allows you to apply
styles to specific elements on your web page precisely and
efficiently. By mastering this skill, you can create high-
quality, visually appealing web pages.
Answer the question about the previous content:

Exercise 47: What are CSS


selectors and how are
they used?
( A ) - They are the means by which designers identify which
elements of the HTML page should receive CSS styles. They
can be divided into five categories: simple, combinator,
pseudo-class, pseudo-element and attribute.
( B ) - These are the specific styles that you apply to
properties in CSS.
( C ) - These are the aspects of HTML elements that you
want to style.

Note: The correct answer is on the last page.


INTRODUCTION TO CSS:
SELECTORS,
PROPERTIES AND
VALUES:
INTRODUCTION TO CSS
PROPERTIES

Introduction to CSS: selectors, properties and values

::: Introduction to CSS: selectors, properties and values :::


CSS, which stands for Cascading Style Sheets, is a style
language used to describe the appearance of a document
written in HTML. CSS describes how HTML elements should
be displayed. This can control the layout of multiple web
pages at once. CSS allows you to apply styles to web pages.
More importantly, CSS allows you to do this independently
of the HTML being used to structure the document.
::: CSS Selectors :::
CSS selectors are the part of CSS that selects the HTML
element you want to style. There are several types of
selectors in CSS, including type, class, ID, attribute
selectors, among others.
---Type selectors: Select elements based on the name of the
HTML element. For example, the p type selector will select
all paragraphs.
---Class selectors: Select elements based on class attribute.
For example, the class selector .intro will select all elements
with class="intro".
---ID Selectors: Select an element based on the ID attribute.
For example, the ID selector #firstname will select the
element with id="firstname".
---Attribute selectors: Select elements based on an attribute
or attribute value. For example, the [target="_blank"]
attribute selector will select all elements with
target="_blank".

::: CSS Properties :::


CSS properties are what you want to style in the selected
element. For example, you may want to change the color,
font, size, margin, padding, background, border, and many
other properties of HTML elements. Each property has a
specific value.
For example, the color property controls the color of the
text. So, if you want the text of all paragraphs to be red, you
would use the following CSS code:
____________________________________________

P{
color: red;
}
____________________________________________
::: CSS Values :::
CSS values ??are the adjustments you make to properties.
In the example above, red is the value of the color property.
Values ??can be keywords such as red, numbers such as
12px, percentages such as 50%, or a variety of other units
of measure.
Values ??can also be more complex, such as
url("image.jpg") for the background-image property, or
rgba(255, 0 , 0, 0.3) for a semi-transparent color.
In short, CSS is a powerful language that allows developers
to precisely control how HTML elements are displayed on
the screen. Understanding CSS selectors, properties, and
values ??is key to becoming an effective front-end
developer.
Answer the question about the previous content:

Exercise 48: What is the


function of CSS selectors?
( A ) - Control the layout of multiple web pages at once.
( B ) - Select the HTML element you want to style.
( C ) - Change the color, font, size, margin, padding,
background, border, and many other properties of HTML
elements.

Note: The correct answer is on the last page.


INTRODUCTION TO CSS:
SELECTORS,
PROPERTIES AND
VALUES: HOW TO USE
AND UNDERSTAND CSS
PROPERTIES

::: 8.6. Introduction to CSS: selectors, properties and values


:::
CSS, or Cascading Style Sheets, is a style language used to
describe the presentation of a document written in HTML. It
is used to control the layout of multiple pages at once,
allowing you to change the design of an entire website just
by modifying one file. On our journey to becoming proficient
front-end developers, it is crucial to understand how to use
and understand CSS properties.
::: CSS Selectors :::
CSS selectors are the elements that define which HTML
elements the style will be applied to. They can be divided
into five categories: type selectors, descendant selectors,
class selectors, ID selectors, and attribute selectors.
::: Type selectors :::
Type selectors select elements based on the HTML element
name. For example, if we want to select all paragraphs on a
page and change the text color to red, we can use the
following code:
____________________________________________
P{
color: red;
}
____________________________________________
::: Descendant selectors :::
Descendant selectors select elements that are descendants
of a specific element. For example, if we want to select only
paragraphs that are inside a div, we can use the following
code:
____________________________________________
div p {
color: red;
}
____________________________________________
::: Class selectors :::
Class selectors select elements based on their class. For
example, if we want to select all elements with the class
"red-text" and change the text color to red, we can use the
following code:
____________________________________________
.red-text {
color: red;
}
____________________________________________
::: ID Selectors :::
ID selectors select an element based on its ID. For example,
if we want to select the element with the ID "my-paragraph"
and change the text color to red, we can use the following
code:
____________________________________________
#my-paragraph {
color: red;
}
____________________________________________
::: Attribute selectors :::
Attribute selectors select elements based on a specific
attribute and value. For example, if we want to select all
links that point to "https://www.google.com" and change the
text color to red, we can use the following code:
____________________________________________
a[href="https://www.google.com"] {
color: red;
}
____________________________________________
::: CSS properties and values :::
CSS properties are the styles you want to change, and CSS
values ??are the styles you want to apply. For example, if we
want to change the color of a paragraph's text to red,
"color" is the property we want to change, and "red" is the
value we want to apply.
There are many different properties you can change,
including background color, font size, margin, padding,
border, etc. Each property has a specific set of values ??that
can be applied.
For example, if we want to change the font size of a
paragraph to 16 pixels, we can use the following code:
____________________________________________
P{
font-size: 16px;
}
____________________________________________
If we want to change the background color of a div to blue,
we can use the following code:
____________________________________________
div {
background-color: blue;
}
____________________________________________
It's important to remember that the order of styles in your
CSS can affect the final result. If you have conflicting styles
for the same element, the last style in your CSS will prevail.
Understanding how to use and understand CSS properties is
an essential skill for any front-end developer. I hope this
guide helped clarify some of the basics.
Answer the question about the previous content:

Exercise 49: Which of the


following statements is
true about CSS?
( A ) - CSS is a programming language used to create the
functionality of a website.
( B ) - CSS is a style language used to describe the
presentation of a document written in HTML.
( C ) - CSS is a markup language used to structure a
website's content.

Note: The correct answer is on the last page.


INTRODUCTION TO CSS:
SELECTORS,
PROPERTIES AND
VALUES:
INTRODUCTION TO
VALUES ​IN CSS
CSS (Cascading Style Sheets) is a style language used to
describe the appearance and formatting of a document
written in HTML. It is mainly used to add style to web pages
and user interfaces written in HTML and XHTML. In this
section, we will focus on selectors, properties, and values ??
in CSS.
::: CSS Selectors :::
CSS selectors are the part of CSS that selects the HTML
element you want to style. There are several types of
selectors in CSS, including type selectors, class selectors, ID
selectors, attribute selectors, pseudo-class selectors, and
pseudo-element selectors.
Type selectors select elements based on their HTML tag
name. For example, the type selector 'p' selects all
elements <p> on one page.
Class selectors select elements based on the value of the
class attribute. For example, the class selector '.intro'
selects all elements that have 'intro' as the value of their
class attribute.
ID selectors select an element based on the value of the ID
attribute. For example, the ID selector '#name' selects the
element that has 'name' as the value of its ID attribute.
::: CSS Properties :::
CSS properties are what you want to style in the selected
element. These can be things like color, font size, spacing,
border, etc. Each property has a name and a value,
separated by a colon. For example, 'color: red;' is a CSS
property declaration, where 'color' is the property name and
'red' is the value.
There are hundreds of CSS properties, each with its own set
of possible values. Some properties are specific to certain
element types, while others can be used on any element
type.
::: CSS Values :::
CSS values ??are the specific details you want to apply to
the property. For example, if you are using the 'color'
property, the values ??could be 'red', 'blue', 'green', etc. If
you are using the 'font-size' property, the values ??could be
'12px', '14px', '16px', etc.
Values ??can be numbers, colors, percentages, URLs, among
other things. They can also be relative or absolute values.
An absolute value is a fixed value, such as '12px'. A relative
value is a value that is relative to something else, like '50%'.
Also, there are some special keywords that can be used as
values, such as 'inherit', 'initial' and 'unset'. 'Inherit' causes
the element to inherit the value of its parent element.
'Initial' sets the property to its initial value. 'Unset' is a
combination of 'inherit' and 'initial'.
In summary, selectors, properties, and values ??in CSS are
powerful tools that allow you to style your HTML documents
in very flexible and detailed ways. With a good
understanding of how they work, you can create stunning
and effective web designs.
Answer the question about the previous content:

Exercise 50: What are


selectors, properties and
values ​in CSS and how are
they used?
( A ) - Selectors are used to choose the HTML element to
style, properties are what you want to style in the selected
element, and values ​are the specific details you want to
apply to the property.
( B ) - Selectors are used to set the color of an HTML
element, properties are used to set the font size, and values
​are used to set the border.
( C ) - Selectors are used to set the value of a property,
properties are used to select an HTML element, and values ​
are used to style the selected element.

Note: The correct answer is on the last page.


INTRODUCTION TO CSS:
SELECTORS,
PROPERTIES AND
VALUES: DIFFERENT
TYPES OF VALUES ​IN
CSS: COLORS, SIZES
AND UNITS

Introduction to CSS: Selectors, Properties and Values

::: Introduction to CSS: Selectors, Properties and Values :::


CSS (Cascading Style Sheets) is a style language used to
describe the appearance of a document written in HTML. It
provides a more efficient and sophisticated way to style web
pages, allowing developers to control the layout and
appearance of multiple elements on a page simultaneously.
::: Selectors, Properties and Values ??in CSS :::
Selectors are the part of CSS that selects the HTML element
you want to style. Once an element is selected, you can
apply different properties to it. Properties are the
characteristics of the element that you want to change,
such as color, size, and position. Values ??are the specific
settings you give to these properties.
::: Different Types of Values ??in CSS :::
There are many different types of values ??you can use in
CSS, including colors, sizes, and units. Let's explore each of
them in detail.
::: Colors :::
Colors in CSS can be specified in several ways. The most
common way is to use predefined color names such as
"red", "green" or "blue". However, this limits you to a fixed
set of colors. To have more control over the exact color, you
can use RGB values, which represent the amount of red,
green, and blue in the color. You can also use hexadecimal
values, which are a hexadecimal representation of RGB
values. Additionally, CSS3 introduced HSL values, which
represent hue, saturation, and lightness.
::: Sizes and Units :::
Sizes in CSS are generally specified in units of
measurement. The most commonly used units of
measurement are pixels (px), percentages (%), and ems
(em). Pixels are a fixed unit of measurement that does not
change based on screen size or user configuration.
Percentages are relative to the size of the parent element.
Ems are relative to the font size of the parent element.
In addition, there are several other units of measurement
available in CSS, including points (pt), pica (pc), ex (ex), rem
(rem), viewport width (vw), viewport height (vh), viewport
minimum (vmin) and viewport maximum (vmax).
Choosing the right unit of measurement is crucial for
creating responsive designs that work well on a variety of
screen sizes and devices.
::: Conclusion :::
Understanding the concepts of selectors, properties and
values ??in CSS is fundamental to becoming an effective
front-end developer. We hope this introduction has given
you a good foundation to start exploring the world of CSS.
Remember, practice is the key to becoming proficient in any
programming language, so keep experimenting and
learning.
Answer the question about the previous content:

Exercise 51: What are


selectors, properties and
values ​in CSS?
( A ) - Selectors are colors and sizes that you can use in CSS.
Properties are the units of measurement in CSS. Values ​are
the different types of selectors in CSS.
( B ) - Selectors are the part of CSS that selects the HTML
element you want to style. Properties are the characteristics
of the element that you want to change, such as color, size,
and position. Values ​are the specific settings you give to
these properties.
( C ) - Selectors are a style language used to describe the
appearance of a document written in HTML. Properties are a
more efficient and sophisticated way to style web pages.
Values ​are the part of CSS that allows developers to control
the layout and appearance of multiple elements on a page
simultaneously.

Note: The correct answer is on the last page.


INTRODUCTION TO CSS:
SELECTORS,
PROPERTIES AND
VALUES: HOW TO APPLY
VALUES ​TO CSS
PROPERTIES

Introduction to CSS: Selectors, Properties and Values

::: Introduction to CSS: Selectors, Properties and Values :::


CSS, or Cascading Style Sheets, is a style language used to
describe the appearance of a document written in HTML.
CSS describes how HTML elements should be displayed on
screen, paper, or other media. CSS saves a lot of work as it
controls the layout of multiple pages at once.
::: CSS Selectors :::
CSS selectors are used to "find" (or select) HTML elements
based on their element name, id, class, attribute, and more.
For example, a type selector selects elements by node
name. For example, the type selector 'h1' selects all
elements <h1>.
____________________________________________
<style>
h1 {
color: blue;
}
</style>
____________________________________________
This example selects all <h1> elements and changes the
text color to blue.
::: CSS Properties :::
CSS properties are used to specify the style of an element.
Each property has a name and a value. The property name
is followed by a colon and the property value. A CSS
declaration always ends with a semicolon, and style
declarations are separated by a space.
For example:
____________________________________________
<style>
P{
color: red;
text-align: center;
}
</style>
____________________________________________
This example sets the text color to red and aligns the text to
the center.
::: CSS Values :::
CSS values ??are defined along with properties to style
HTML elements. For example, the color property can have
values ??like 'red', 'blue', 'green', etc. Additionally, the width
property can have values ??like '100px', '50%', etc.
Example:
____________________________________________
<style>
P{
font-size: 20px;
color: white;
background-color: black;
}
</style>
____________________________________________
This example sets the font size to 20 pixels, the text color to
white, and the background color to black.
::: How to apply values ??to CSS properties :::
Applying values ??to CSS properties is quite simple. First,
you need to select the element you want to apply the style
to. Next, you need to define the property you want to
change. Finally, you need to set the value you want to apply
to this property.
For example, if you want to change the color of all your
paragraphs to blue, you can do this as follows:
____________________________________________
<style>
P{
color: blue;
}
</style>
____________________________________________
In this example, 'p' is the selector, 'color' is the property,
and 'blue' is the value.
CSS is a powerful language that allows developers to control
the appearance of their websites. By understanding how
CSS selectors, properties, and values ??work, you can create
more attractive and effective websites.
We hope this guide helped you understand CSS better.
Remember that practice is key when it comes to learning
and mastering CSS. So keep practicing and experimenting
with different selectors, properties and values.
Answer the question about the previous content:

Exercise 52: What is CSS


and what is it used for?
( A ) - CSS is a programming language used to create
website content.
( B ) - CSS, or Cascading Style Sheets, is a style language
used to describe the appearance of a document written in
HTML.
( C ) - CSS is a tool for creating animations on a website.

Note: The correct answer is on the last page.


INTRODUCTION TO CSS:
SELECTORS,
PROPERTIES AND
VALUES:
UNDERSTANDING
CASCADE AND
INHERITANCE IN CSS
The introduction to CSS is a crucial point in developing front-
end skills. CSS, which stands for Cascading Style Sheets, is
the language used to describe the presentation of a
document written in HTML or XML. It is through CSS that you
can control the color of the text, the style of fonts, the
spacing between paragraphs, how columns are sized and
arranged, which images or background colors are used,
layout designs, among other things.
::: Selectors, Properties and Values :::
To start, let's talk about selectors, properties and values ??in
CSS. Selectors are used to select the HTML elements you
want to style. For example, if you want to style all
paragraphs (<p>) in your HTML document, you would use
the paragraph selector (<p>).
Once you select the elements you want to style, you can
declare the properties you want to change for those
elements. Properties are simply the characteristics of HTML
elements that you want to change. For example, text color,
font size, height, width, etc.
The values ??are what you want to change the property to.
For example, if you wanted to change the text color of all
your paragraphs to red, 'red' would be the value you give to
the 'color' property.
So an example of a CSS declaration would be:
____________________________________________
<p style="color: red;">This is a paragraph.</p>
____________________________________________
In this example, '<p>' is the selector, 'color' is the property
and 'red' is the value.
::: Understanding Cascade and Inheritance in CSS :::
An essential part of CSS is understanding cascading and
inheritance. The 'cascading' in CSS refers to the priority
order of style rules that determine which style rule will be
applied if more than one rule is applicable to a given
element.
For example, if you have the following CSS code:
____________________________________________
<p style="color: red;">This is a paragraph.</p>
<p style="color: blue;">This is another paragraph.</p>
____________________________________________
The first paragraph will be red and the second will be blue,
because the 'color' rule for the first paragraph is 'red' and
the 'color' rule for the second paragraph is 'blue'. This is the
waterfall in action.
'Inheritance' in CSS refers to the fact that styles are
inherited from parent elements to child elements. For
example, if you have the following CSS code:
____________________________________________
<div style="color: red;">
<p>This is a paragraph.</p>
</div>
____________________________________________
The paragraph will be red, because it is inheriting the 'color'
rule from the parent element '<div>'. This is inheritance in
action.
Understanding cascading and inheritance is crucial to
working effectively with CSS, as it allows you to create
efficient styling rules and avoid the need to style each
element individually.
In summary, introducing CSS and understanding selectors,
properties, and values, as well as cascading and
inheritance, are key to becoming an effective front-end
developer. With a solid understanding of these concepts,
you can create visually appealing and efficient websites.
Answer the question about the previous content:

Exercise 53: What does


'waterfall' mean in CSS
and how does it work?
( A ) - 'Cascading' in CSS refers to the fact that styles are
inherited from parent elements to child elements.
( B ) - The 'cascading' in CSS refers to the priority order of
style rules that determine which style rule will be applied if
more than one rule is applicable to a given element.
( C ) - 'Cascading' in CSS refers to the process of selecting
the HTML elements you want to style.

Note: The correct answer is on the last page.


INTRODUCTION TO CSS:
SELECTORS,
PROPERTIES, AND
VALUES: HOW TO USE
THE ELEMENT
INSPECTOR TO DEBUG
CSS

8.11. Introduction to CSS: selectors, properties and values

::: Introduction to CSS: selectors, properties and values :::


CSS (Cascading Style Sheets) is the language used to style
and layout web pages. CSS describes how HTML elements
should be displayed on screen, paper, or other media. It is a
powerful language that, when combined with HTML, can
create visually stunning and highly functional websites. In
this chapter, we'll explore the basics of CSS, including
selectors, properties, and values, and how to use the
element inspector to debug CSS.
::: CSS Selectors :::
CSS selectors are the way to choose which HTML elements
you want to style. There are several types of selectors in
CSS, including type selectors, class selectors, ID selectors,
and attribute selectors.

---Type selectors: They select elements based on the HTML


element type. For example, if you wanted to select all
paragraphs on a page, you would use the p type selector.
---Class selectors: They select elements based on the HTML
class. For example, if you wanted to select all elements with
the class "highlight", you would use the class selector
.highlight.
---ID Selectors: They select a specific element based on the
HTML ID. For example, if you want to select the element
with the ID "my-id", you would use the ID selector #my-id.
---Attribute selectors: They select elements based on a
specific attribute. For example, if you wanted to select all
links that point to a specific URL, you would use the
[href="https://www.mysite.com"] attribute selector.
::: CSS Properties and Values :::
Once you've selected the elements you want to style, you
can set CSS properties and values ??for those elements. CSS
properties are aspects of the element that you want to
change, such as color, font size, width, height, margin,
padding, etc. CSS values ??are the specific values ??you
want to apply to these properties. For example, if you
wanted to change the text color of all paragraphs to red,
you would use the color CSS property with the value red.

Here's an example of how you can use CSS selectors,


properties, and values ??to style a web page:
____________________________________________
<style>
P{
color: red;
font-size: 16px;
}
.emphasis {
background-color: yellow;
}
#my-id {
width: 100px;
height: 100px;
}
[href="https://www.mysite.com"] {
text-decoration: none;
}
</style>
____________________________________________
::: Using the Element Inspector to Debug CSS :::
The Element Inspector is a powerful tool that allows you to
view and edit the HTML and CSS of a web page in the
browser. It's an essential tool for any front-end developer as
it allows you to debug CSS issues in real time.

To open the Element Inspector, right-click anywhere on the


web page and select "Inspect" or "Inspect Element". This
will open the Element Inspector at the bottom of the
browser window. You will see the page's HTML in the left
panel and the CSS in the right panel.

To debug CSS, you can select any element in the HTML


panel and see all the CSS rules applied to that element in
the CSS panel. You can edit any CSS property or value
directly in the Element Inspector to see how the changes
affect the element in real time. This is extremely useful for
debugging issues with layout, colors, font sizes, etc.
Additionally, the Element Inspector also shows you which
CSS rules are being overridden, which can help you
understand why certain styles are not being applied as
expected.

In short, CSS is a powerful language that allows you to style


and layout web pages. Understanding the basics of CSS
selectors, properties, and values ??is essential for any front-
end developer. Additionally, learning how to use the
Element Inspector to debug CSS is an invaluable skill that
can save you a lot of time and frustration.
Answer the question about the previous content:

Exercise 54: Which of the


following statements
correctly describes what
CSS selectors are?
( A ) - CSS selectors are specific values ​that you want to
apply to CSS properties.
( B ) - CSS selectors are the way to choose which HTML
elements you want to style.
( C ) - CSS selectors are a tool that allows you to view and
edit the HTML and CSS of a web page in the browser.

Note: The correct answer is on the last page.


TEXT STYLING WITH
CSS
Text styling with CSS is a crucial part of web design and an
essential component of any front-end development course.
CSS, or Cascading Style Sheets, is a styling language used
to describe the appearance of a document written in HTML.
It is a powerful tool that allows developers to control the
layout, colors, fonts, and other visual aspects of a website.
Text styling with CSS involves several properties and values
??that can be used to control the appearance of text on a
web page. This includes text color, font size, font style, line
spacing, text alignment, and more.
::: Text Color :::
The 'color' property in CSS is used to set the color of the
text. You can use color names, hexadecimal values, RGB
values, or HSL values ??to define the color. For example:
____________________________________________
<style>
P{
color: blue;
}
</style>
____________________________________________
In this example, the text inside all <p> it will be blue.
::: Text Size :::
The 'font-size' property is used to set the size of the text.
You can use various units of measurement, including pixels
(px), points (pt), percentages (%), and relative units like
'em' and 'rem'. For example:
____________________________________________
<style>
P{
font-size: 16px;
}
</style>
____________________________________________
In this example, the text inside all <p> will have a size of 16
pixels.
::: Font Style :::
The 'font-style' property is used to define whether the text
should be normal, italic or oblique. For example:
____________________________________________
<style>
P{
font-style: italic;
}
</style>
____________________________________________
In this example, the text inside all <p> will be displayed in
italics.
::: Line Spacing :::
The 'line-height' property is used to control the space
between lines of text. You can use a number without a unit
to set the line height relative to the current font size, or you
can use a unit of measurement. For example:
____________________________________________
<style>
P{
line-height: 1.5;
}
</style>
____________________________________________
In this example, the space between lines of text in all
elements <p> will be 1.5 times the current font size.
::: Text Alignment :::
The 'text-align' property is used to control text alignment.
You can align the text left, right, center, or justify the text.
For example:
____________________________________________
<style>
P{
text-align: center;
}
</style>
____________________________________________
In this example, the text inside all <p> will be centralized.
In addition to these basic properties, there are many other
CSS properties that you can use to style text, including
'text-decoration' to add a line through text, underline text,
or add a line above text; 'text-transform' to control text
capitalization; and 'letter-spacing' and 'word-spacing' to
control the space between letters and words respectively.
When learning how to style text with CSS, it's important to
remember that cascading in Cascading Style Sheets means
that CSS rules are applied in order, with later rules
overriding earlier rules if they have the same specificity.
Therefore, the order in which you write your CSS rules and
how you select your elements can have a big impact on the
final appearance of your text.
In summary, text styling with CSS is an essential skill for any
front-end developer. With a solid understanding of CSS
properties and values, you can create attractive, readable
text that improves user experience and helps effectively
communicate your site's message.
Answer the question about the previous content:

Exercise 55: Which of the


following statements
about styling text with
CSS is true?
( A ) - The 'color' property in CSS is used to set the font
style.
( B ) - The 'line-height' property in CSS is used to control the
text color.
( C ) - The 'text-align' property in CSS is used to control text
alignment.

Note: The correct answer is on the last page.


LAYOUT AND
POSITIONING WITH CSS

::: Chapter 10: Layout and positioning with CSS :::


To create an aesthetically pleasing and functional
website, it is essential to have a good understanding of the
concepts of layout and positioning in CSS. CSS, or Cascading
Style Sheets, is a style sheet language used to describe the
appearance of a document written in HTML. It's a crucial
component of front-end development and is responsible for
many aspects of a website's design, including layout, colors,
fonts, and more.
::: 10.1 Basic layout concepts :::
CSS layouts can be divided into two types: block layout
and inline layout. Block elements, such as divs and
paragraphs, start on a new line and take up all available
horizontal space, while inline elements, like links and spans,
only take up as much space as necessary and do not start
on a new line.
CSS layouts can also be classified as fixed, fluid or
responsive layouts. Fixed layouts have widths that are
defined in pixels and do not change with the size of the
browser window. Fluid layouts have widths that are set in
percentages, allowing the layout to adjust to the size of the
browser window. Responsive layouts use media queries to
adjust the layout based on the device's screen size.
::: 10.2 Positioning in CSS :::
Positioning in CSS is an important concept that allows
you to control where elements are placed on the page.
There are five values ??for the 'position' property: static,
relative, absolute, fixed and sticky.
The 'static' value is the default value and positions the
element according to the normal flow of the document. The
'relative' value positions the element relative to its normal
position. The 'absolute' value positions the element relative
to the nearest parent element that has a position value
other than 'static'. The 'fixed' value positions the element
relative to the browser window. The 'sticky' value is a mix of
'relative' and 'fixed' and positions the element based on the
user's scrolling.
::: 10.3 Layouts with Flexbox and Grid :::
Flexbox and Grid are two modern CSS layout
techniques that offer greater flexibility and control over the
positioning of elements. Flexbox is ideal for one-dimensional
layouts, while Grid is more suitable for two-dimensional
layouts.
With Flexbox, you can easily align elements
horizontally or vertically and distribute space between
elements. The 'display' property is set to 'flex' on the parent
element and several other properties such as 'flex-
direction', 'justify-content' and 'align-items' can be used to
control the layout of child elements.< /p>
With Grid, you can create complex layouts with rows
and columns. The 'display' property is set to 'grid' on the
parent element and the 'grid-template-columns', 'grid-
template-rows' and 'grid-gap' properties are used to define
the grid structure. The child elements are then positioned
on the grid using the 'grid-column' and 'grid-row' properties.
::: 10.4 Conclusion :::
Understanding the concepts of layout and positioning
in CSS is fundamental to creating attractive and functional
websites. By mastering these concepts, you will be able to
create complex layouts with ease and precision. Remember
that practice is the key to becoming proficient in CSS, so
keep experimenting and building projects to improve your
skills.
Answer the question about the previous content:

Exercise 56: What is the


role of CSS in the front-
end development of a
website?
( A ) - CSS is only used to add colors to a website.
( B ) - CSS is used to describe the appearance of a
document written in HTML, including layout, colors, fonts,
and more.
( C ) - CSS is only used to add animations to a website.

Note: The correct answer is on the last page.


BOX MODEL AND
PADDING, BORDER AND
MARGIN

Complete HTML, CSS and Javascript course

::: Chapter 11: Box Model and Padding, Border and Margin :::
The Box Model is one of the most fundamental parts of CSS,
as it controls the design and layout of many aspects of a
web page. Each element on a web page is considered a
"box" and that box can have different properties, such as
width, height, padding, borders, and margins.
::: Box Model :::
The Box Model is a representation of how each element is
rendered on the page. The 'box' of an element includes the
element's content, padding, border, and margin. Content is
the text, image, or anything else inside the element.
Padding is the space between the content and the border.
The border is a line that surrounds the content and padding.
The margin is the space between the border and
neighboring elements.
To view the Box Model, you can use the browser's inspect
tool. This will show the content width and height, padding,
border, and margin of an element.
::: Padding :::
Padding is the space between the content of an element
and its border. You can set the padding for all sides at once
using the 'padding' property, or you can set each side
individually using 'padding-top', 'padding-right', 'padding-
bottom' and 'padding-left'.
For example, if you wanted to add 10px padding to the top
of an element, you would use 'padding-top: 10px;'. If you
wanted to add 10px padding to all sides, you would use
'padding: 10px;'. The fill is transparent, so the background
of the element will be visible through it.
::: Border :::
A border is a line that surrounds the padding and content of
an element. You can set the border width, style and color
using the 'border-width', 'border-style' and 'border-color'
properties respectively. You can also set all three properties
at once using the 'border' property.
For example, if you wanted a 1px wide solid border around
an element, you would use 'border: 1px solid;'. If you
wanted this border to be red, you would use 'border: 1px
solid red;'. You can also set the border properties for each
side individually using 'border-top', 'border-right', 'border-
bottom' and 'border-left'.
::: Margin :::
Margin is the space between the edge of an element and
the elements around it. You can set the margin for all sides
at once using the 'margin' property, or you can set each
side individually using 'margin-top', 'margin-right', 'margin-
bottom' and 'margin-left'.
For example, if you wanted to add 10px margin to the top of
an element, you would use 'margin-top: 10px;'. If you
wanted to add 10px margin to all sides, you would use
'margin: 10px;'. The margin is transparent, so anything
behind the element will be visible through it.
Understanding the Box Model is crucial to being able to
create complex and responsive layouts. It's one of the first
things you should learn when starting out with CSS, and it
will be a valuable tool in your arsenal as a front-end
developer.
Answer the question about the previous content:

Exercise 57: In the context


of CSS, what is the Box
Model?
( A ) - Alternatives:
( B ) - a) It is a tool for creating 3D images.
( C ) - b) It is a method for creating animations.
( D ) - c) It is a representation of how each element is
rendered on the page, including the element's content,
padding, border, and margin.

Note: The correct answer is on the last page.


COLORS AND
BACKGROUNDS IN CSS
CHAPTER 12 OF OUR E-
BOOK FOCUSES ON A
CRUCIAL ASPECT OF
CSS, NAMELY COLORS
AND BACKGROUNDS.
COLORS AND
BACKGROUNDS ARE AN
INTEGRAL PART OF WEB
DEVELOPMENT AS THEY
HELP DEFINE THE LOOK
AND FEEL OF A
WEBSITE. THEY CAN BE
USED TO HIGHLIGHT
IMPORTANT
INFORMATION, CREATE
CONTRAST, AND ADD
VISUAL DEPTH TO A
DESIGN. IN THIS
CHAPTER, WE'LL
EXPLORE HOW TO USE
COLORS AND
BACKGROUNDS IN CSS
TO CREATE ATTRACTIVE
AND EFFECTIVE
DESIGNS.
::: Defining Colors in CSS :::
In CSS, colors can be defined in several ways. The most
common way to define colors is by using predefined color
names such as 'red', 'blue', 'green', etc. However, this
approach has its limitations as there are only around 140
predefined color names available.
To have more control over colors, you can use RGB, HEX or
HSL values. RGB (Red, Green, Blue) values ??define color
using a combination of red, green, and blue. Each of these
color components can have a value between 0 and 255. For
example, 'rgb(255,0,0)' represents the color red.
HEX values ??are a hexadecimal representation of RGB
values. They start with a hashtag sign (#) followed by six
digits. The first two digits represent red, the next two
represent green, and the last two represent blue. For
example, '#FF0000' represents the color red.
HSL (Hue, Saturation, Lightness) values ??define color using
hue, saturation, and lightness. Hue is represented as an
angle on the color wheel (from 0 to 360 degrees), saturation
is represented as a percentage (from 0% to 100%), and
luminosity is also represented as a percentage (from 0% to
100% ). For example, 'hsl(0,100%,50%)' represents the color
red.
::: Defining Backgrounds in CSS :::
In CSS, backgrounds are defined using the 'background'
property. This property is a shortcut property for several
other properties, including 'background-color', 'background-
image', 'background-repeat', 'background-position' and
'background-size'.
The 'background-color' property defines the background
color of an element. It accepts the same color values ??that
we discussed in the previous section.
The 'background-image' property defines a background
image for an element. It accepts a URL that points to the
image you want to use as the background. For example,
'background-image: url("image.jpg")' sets the image
'image.jpg' as the element's background.
The 'background-repeat' property defines whether and how
a background image should be repeated. It accepts values
??such as 'repeat', 'repeat-x', 'repeat-y' and 'no-repeat'.
The 'background-position' property defines the starting
position of a background image. It accepts values ??such as
'left', 'right', 'top', 'bottom', 'center', or specific coordinates.
The 'background-size' property defines the size of a
background image. It accepts values ??such as 'auto',
'cover', 'contain', or a specific size.
::: Conclusion :::
Colors and backgrounds play a crucial role in creating
attractive and effective website designs. In CSS, you have a
large amount of control over how colors and backgrounds
are defined and displayed. By mastering these aspects of
CSS, you will be well equipped to create visually appealing
websites that stand out from the crowd.
We hope this chapter has provided you with a clear
understanding of how to work with colors and backgrounds
in CSS. In the next chapter, we will explore another
important aspect of CSS: the layout and positioning of
elements.
Answer the question about the previous content:

Exercise 58: How are


colors defined in CSS?
( A ) - Only through predefined color names such as 'red',
'blue', 'green', etc.
( B ) - Only through RGB, HEX or HSL values.
( C ) - Through predefined color names, RGB, HEX or HSL
values.

Note: The correct answer is on the last page.


PSEUDOCLASSES AND
PSEUDOELEMENTS IN
CSS
Pseudoclasses and pseudoelements are an essential part of
CSS, as they allow developers to dynamically and
specifically style elements. Understanding these concepts is
vital to becoming an effective front-end developer.
::: Pseudoclasses :::
Pseudoclasses are keywords added to selectors that specify
a special state of the selected element. For example, an
element can change state when a user hovers over it, when
it is the first child of its parent, when it is empty, and so on.
Some of the most common pseudo-classes include:

---:hover - selects an element when the user hovers over it.


---:focus - selects an element when it has focus (for
example, when a user clicks on a text input field).
---:active - selects an element at the moment it is activated
by the user.
---:visited - selects links that the user has already visited.
---:first-child - selects the first child of an element.
---:last-child - selects the last child of an element.
---:nth-child(n) - selects the nth child of an element.
---:empty - selects elements that have no children (including
text nodes).
::: Pseudoelements :::
Pseudo-elements, on the other hand, are keywords added to
selectors that allow you to style a specific part of a selected
element. For example, you might want to style the first
letter or first line of text, or perhaps add content before or
after an element.
Some of the most common pseudoelements include:

---::first-line - selects the first line of a block of text.


---::first-letter - selects the first letter of a block of text.
---::before - inserts content before the content of an
element.
---::after - inserts content after the content of an element.

::: How to use Pseudoclasses and Pseudoelements :::


The syntax for using pseudoclasses and pseudoelements is
quite simple. For pseudoclasses, you add the pseudoclass
directly after the selector, preceded by a colon. For
example:
____________________________________________

p:hover {
background-color: yellow;
}
____________________________________________
This example selects all paragraphs on the page and
changes the background color to yellow when the user
hovers over them.
For pseudo-elements, the syntax is similar, but you use two
colons instead of one. For example:
____________________________________________
p::first-letter {
font-size: 200%;
color: red;
}
____________________________________________
This example selects the first letter of all paragraphs on the
page and changes its font size to 200% and its color to red.
In conclusion, pseudo-classes and pseudo-elements are
powerful tools for dynamically and specifically styling HTML
elements. They allow you to create more interactive and
attractive designs, improving the user experience on your
website. Understanding and effectively using these
techniques is an essential skill for any front-end developer.
Answer the question about the previous content:

Exercise 59: What are


pseudoclasses and
pseudoelements in CSS
and how are they used?
( A ) - Pseudoclasses and pseudoelements are keywords
added to selectors that allow you to style a specific part of a
selected element. Pseudoclasses are used to specify a
special state of the selected element, while pseudoelements
allow you to style a specific part of a selected element.
( B ) - Pseudoclasses and pseudoelements are tools for
creating animations in CSS. They are used to make
elements move on the page.
( C ) - Pseudoclasses and pseudoelements are code
optimization techniques in CSS. They are used to reduce the
size of CSS code.

Note: The correct answer is on the last page.


ANIMATIONS AND
TRANSITIONS IN CSS
::: Chapter 14: Animations and Transitions in CSS :::
CSS animations and transitions are powerful tools that allow
developers to create dynamic and engaging interactions on
websites. They can be used to create a variety of visual
effects, from subtle color changes to complex animations
involving multiple elements and properties. In this chapter,
we will explore in detail how to use animations and
transitions in CSS to enhance the user experience.
::: Transitions in CSS :::
Transitions in CSS allow you to smooth changes between
different states of an element. For example, you can use a
transition to smooth the color change of a button when the
user hovers over it. To create a transition in CSS, you need
to set the 'transition' property on the element you want to
animate.
The 'transition' property is a shortcut property that allows
you to define four aspects of a transition: the property to be
animated, the duration of the animation, the timing
function, and the animation delay. Here is an example of
how to use the 'transition' property to smooth out a button's
color change:

.btn {
background-color: blue;
transition: background-color 0.5s ease-in-out;
}
.btn:hover {
background-color: red;
}

In this example, the button's background color changes


from blue to red in 0.5 seconds when the user hovers over
it. The 'ease-in-out' timing function ensures that the
transition starts and ends slowly, giving a smooth effect.
::: CSS animations :::
CSS animations go one step beyond transitions, allowing
you to create complex animations that involve multiple
states and properties. To create an animation in CSS, you
need to set the 'animation' property and also create a
'@keyframes' rule that defines the animation states.
The 'animation' property is a shortcut property that allows
you to set various aspects of an animation, including the
animation name, duration, delay, number of times the
animation should be repeated, and the direction of
animation. animation. Here is an example of how to use the
'animation' property to create a simple animation:

.box {
animation: slide 2s infinite;
}
@keyframes slide {
0% { left: 0; }
50% { left: 50px; }
100% { left: 0; }
}
In this example, the box moves 50 pixels to the right and
then returns to its original position in a continuous 2-second
cycle. The '@keyframes' rule defines the animation states,
which are interpolated by the browser to create the
complete animation.
CSS animations and transitions are an effective way to add
interactivity and dynamism to your websites. They can be
used to improve user experience, highlight important
information, and create stunning visual effects. However,
it's important to use these tools sparingly and always
consider usability and accessibility when creating
animations and transitions.
We hope this chapter has given you a good understanding
of how to use animations and transitions in CSS. In the next
chapter, we'll explore JavaScript, the third and final
technology you need to learn to become a front-end
developer.
Answer the question about the previous content:

Exercise 60: What does


the 'transition' property in
CSS allow you to do?
( A ) - Allows you to set the background color of an element.
( B ) - Allows you to smooth changes between different
states of an element.
( C ) - Allows you to create a complex animation that
involves multiple states and properties.

Note: The correct answer is on the last page.


RESPONSIVE DESIGN
WITH MEDIA QUERIES
::: Chapter 15: Responsive Design with Media Queries :::
In our journey to become an efficient front-end developer,
one aspect we cannot ignore is responsive design.
Responsive design is a web development approach that
makes our web pages adjust to the user's device, be it a
desktop, tablet or smartphone. With the increasing use of
mobile devices to access the internet, responsive design has
become an absolute necessity. In this chapter, we'll explore
one of the main pillars of responsive design - Media Queries.
::: What are Media Queries? :::
Media Queries are a feature of CSS3 that allows the
rendering of content to adapt to different types of devices
based on specific characteristics such as viewport width and
height, screen resolution, and orientation. With media
queries, we can write specific CSS that will only be applied if
certain conditions are met.
::: How to use Media Queries? :::
A media query is composed of a media type and at least
one expression that limits the style sheets by specific device
characteristics. For example:
____________________________________________
@media screen and (min-width: 600px) {
body {
background-color: lightblue;
}
}
____________________________________________
In this example, the CSS within the media query will only be
applied if the media type is 'screen' (i.e. not being printed or
similar) and the viewport width is 600 pixels or more.
::: Types of Media :::
There are several media types you can target with media
queries, including 'all' (for all devices), 'print' (for printers),
'screen' (for computer screens, tablets, smartphones, etc. ),
'speech' (for screen readers that 'read' the page aloud).
::: Device Characteristics :::
Device characteristics that you can test in a media query
include things like 'width', 'height', 'orientation' (whether the
device is in portrait or landscape mode) , 'resolution' (screen
resolution), among others.
::: Responsive Design with Media Queries :::
By using media queries, you can create layouts that adapt
and respond to different screen sizes and devices. For
example, you might have a three-column layout on a large
screen, which changes to a one-column layout on a small
screen.
To do this, you can use a media query to apply different CSS
styles depending on the viewport width. For example:
____________________________________________
@media screen and (max-width: 600px) {
.column {
width: 100%;
}
}
____________________________________________
In this example, if the viewport width is 600 pixels or less,
the width of any element with the 'column' class will be
100%, effectively creating a one-column layout.
::: Conclusion :::
Media Queries are a powerful tool for creating responsive
designs. They allow you to customize the appearance of
your website for different devices and screen sizes,
improving the user experience. In the next chapter, we'll
explore more about how to combine HTML, CSS, and
JavaScript to create dynamic interactions on your website.
Answer the question about the previous content:

Exercise 61: What are


Media Queries and how
are they used in
responsive design?
( A ) - They are a feature of CSS3 that allows content
rendering to adapt to different types of devices based on
specific characteristics such as viewport width and height,
screen resolution, and orientation. They are used in
responsive design to create layouts that adapt and respond
to different screen sizes and devices.
( B ) - They are a JavaScript programming tool that allows
dynamic interaction with the user. They are used in
responsive design to create animations and visual effects
that adapt to different screen sizes and devices.
( C ) - They are an HTML5 feature that allows the creation of
adaptive multimedia content. They are used in responsive
design to create videos and audio that adapt to different
screen sizes and devices.

Note: The correct answer is on the last page.


INTRODUCTION TO
BOOTSTRAP
Bootstrap is one of the most popular and widely used
frameworks in web development. It was created by Twitter
developers Mark Otto and Jacob Thornton to help with
consistency across internal tools. Since its launch in 2011,
Bootstrap has grown to become one of the most important
tools for front-end developers.
Bootstrap is an open source library that provides design
templates for typography, forms, buttons, tables,
navigation, modals, and more, all with HTML, CSS, and
JavaScript. It stands out for its ease of use, flexibility and
responsiveness, allowing developers to create websites and
mobile applications efficiently and effectively.
This chapter is an introduction to Bootstrap and will cover
the basics to help you get started using it in your projects.
Let's start with an overview of what Bootstrap is, how it
works, and why you should consider using it.
::: What is Bootstrap? :::
Bootstrap is a front-end development framework that
provides a robust and responsive codebase for developing
websites and mobile applications. It is built with HTML, CSS,
and JavaScript, and provides a wide range of reusable
components that make development faster and easier.
Bootstrap is responsive, meaning it is designed to look and
work well on a variety of devices, from desktops to tablets
and smartphones. It does this using a flexible grid system
that adapts to your screen size. This is important in a world
where using mobile devices to browse the web is quickly
becoming the norm.
::: How does Bootstrap work? :::
Bootstrap is based on a 12-column structure, where you can
specify how many columns an element should occupy on
different screen sizes. This allows you to create complex
layouts with relative ease.
In addition to the grid system, Bootstrap also provides a
series of CSS classes and JavaScript components that you
can use to add functionality to your website. For example,
you can use CSS classes to add styles to buttons, forms, and
other elements. JavaScript components allow you to add
functionality such as carousels, modals, and tooltips.
::: Why use Bootstrap? :::
There are several reasons why you might want to use
Bootstrap in your projects. The first is the speed of
development. Bootstrap provides a large amount of pre-
written code that you can use to get up and running quickly.
This can save a lot of time, especially on larger projects.
Another great advantage of Bootstrap is its consistency. All
of Bootstrap's components and classes are designed to work
together cohesively, which helps ensure your site has a
consistent look and feel.
Finally, Bootstrap is widely supported and has a large
community of developers behind it. This means it's easy to
find help and resources if you run into problems or have
questions.
::: Conclusion :::
Bootstrap is a powerful tool that can help speed up
development and ensure consistency across your projects. It
provides a wide range of components and classes that you
can use to create responsive websites and mobile
applications. If you're a front-end developer, it's worth
considering using Bootstrap in your projects.
In this chapter, we've introduced you to Bootstrap, but
there's still a lot more to learn. In the next chapter, we'll
dive deeper and start exploring some of Bootstrap's more
advanced components and features.
Answer the question about the previous content:

Exercise 62: Who were the


creators of Bootstrap and
for what purpose did they
create it?
( A ) - Bootstrap was created by Mark Zuckerberg and Bill
Gates to help create social networks.
( B ) - Bootstrap was created by Twitter developers Mark
Otto and Jacob Thornton to help with consistency between
internal tools.
( C ) - Bootstrap was created by Larry Page and Sergey Brin
to aid in the development of search engines.

Note: The correct answer is on the last page.


USING GRIDS AND
CONTAINERS IN
BOOTSTRAP
Bootstrap is one of the most popular tools when it comes to
front-end web development. It is known for its ease of use
and efficiency in creating responsive websites. One of the
most notable features of Bootstrap is the use of grids and
containers. In this chapter, we will dive into the use of grids
and containers in Bootstrap.
::: Understanding the Container :::
Containers in Bootstrap are fundamental elements for
creating responsive layouts. They are the basic building
blocks of any Bootstrap web page. A container is simply a
div with the class .container or .container-fluid. The
difference between the two is that .container has a fixed
maximum width in pixels on different screen sizes, while
.container-fluid expands to fill the width of the screen.
____________________________________________
<div class="container">
<!-- Contents -->
</div>
<div class="container-fluid">
<!-- Contents -->
</div>
____________________________________________
::: Understanding the Grid :::
Bootstrap uses a grid system to create layouts. The grid is
divided into 12 columns, allowing you to create complex and
responsive layouts with ease. Grid classes are applied to
divs to control page layout. Classes range from .col- (for
extra-small devices like phones) to .col-xl- (for extra-large
devices like large-scale TVs).
____________________________________________
<div class="row">
<div class="col-">
<!-- Contents -->
</div>
<div class="col-">
<!-- Contents -->
</div>
</div>
____________________________________________
::: Using Grids and Containers Together :::
To create a responsive layout in Bootstrap, you usually start
with a container. Inside this container, you create a 'row',
which is a horizontal line that contains columns. In front of
the rows, you place your columns, which are where your
content actually goes. The total sum of the columns in a row
must be equal to 12.
____________________________________________
<div class="container">
<div class="row">
<div class="col-6">
<!-- Contents -->
</div>
<div class="col-6">
<!-- Contents -->
</div>
</div>
</div>
____________________________________________
In this example, we have two columns each taking up half
the width of the screen (6/12) across all screen sizes. You
can adjust the number after 'col-' to control the column
width on different screen sizes.
::: Conclusion :::
Bootstrap grids and containers are powerful tools that let
you create complex, responsive layouts with ease. They are
the foundation of any Bootstrap web page and are essential
to understand if you want to become an effective front-end
developer. With practice, you will be able to create full-page
layouts with ease, using just grids and containers.
I hope this chapter gave you a clear understanding of how
to use grids and containers in Bootstrap. In the next
chapter, we'll explore some more Bootstrap components
and how they can be used to further improve your websites.
Answer the question about the previous content:

Exercise 63: What is the


difference between
.container and .container-
fluid in Bootstrap?
( A ) - .container is used to create layouts, while .container-
fluid is used to create grids.
( B ) - .container has a fixed maximum width in pixels on
different screen sizes, while .container-fluid expands to fill
the screen width.
( C ) - .container-fluid is a div with class .container.

Note: The correct answer is on the last page.


BOOTSTRAP
COMPONENTS:
BUTTONS, FORMS,
CAROUSEL

Bootstrap components: buttons, forms, carousel

::: Bootstrap components: buttons, forms, carousel :::


Bootstrap is one of the most popular libraries when it comes
to front-end development. It offers a variety of ready-to-use
components that can significantly speed up the
development process. In this chapter, we'll focus on three
main components: buttons, forms, and carousel.
::: Buttons :::
Buttons are an essential part of any user interface and
Bootstrap offers a wide range of button styles. To create a
button in Bootstrap, you need to use the <button> with
class .btn and one of the button style classes, for example
.btn-primary for a blue button.
____________________________________________
<button type="button" class="btn btn-primary">Primary
button</button>
____________________________________________
In addition to button styles, Bootstrap also offers classes for
different button sizes, border buttons, group buttons, and
more.
::: Forms :::
Forms are another crucial part of any web application.
Bootstrap offers classes to create professional-looking forms
with form validation, input styles, text areas, checkboxes,
radio buttons, etc.
To create a form in Bootstrap, you need to use the <form>
with the .form class. Each form field is then created using
the <div> with the .form-group class to group the label and
input field.
____________________________________________
<form>
<div class="form-group">
<label for="exampleInputEmail1">Email
address</label>
<input type="email" class="form-control"
id="exampleInputEmail1" aria-describedby="emailHelp">
</div>
<div class="form-group">
<label for="exampleInputPassword1">Password</label>
<input type="password" class="form-control"
id="exampleInputPassword1">
</div>
<button type="submit" class="btn btn-
primary">Submit</button>
</form>
____________________________________________
This is an example of a simple form with two fields: one for
the email and one for the password. Bootstrap also offers
classes for adding tooltips, error messages, and more.
::: Carousel :::
The carousel is a component that allows you to display a
series of images (or other content) in a rotating sequence. It
is commonly used to display a series of featured images on
a website's home page.
To create a carousel in Bootstrap, you need to use the
<div> with the .carousel class. Each carousel item is then
created using the <div> with the .carousel-item class.
____________________________________________
<div id="carouselExampleIndicators" class="carousel slide"
data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#carouselExampleIndicators" data-slide-
to="0" class="active"></li>
<li data-target="#carouselExampleIndicators" data-slide-
to="1"></li>
<li data-target="#carouselExampleIndicators" data-slide-
to="2"></li>
</ol>
<div class="carousel-inner">
<div class="carousel-item active">
<img src="..." class="d-block w-100" alt="...">
</div>
<div class="carousel-item">
<img src="..." class="d-block w-100" alt="...">
</div>
<div class="carousel-item">
<img src="..." class="d-block w-100" alt="...">
</div>
</div>
<a class="carousel-control-prev"
href="#carouselExampleIndicators" role="button" data-
slide="prev">
<span class="carousel-control-prev-icon" aria-
hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next"
href="#carouselExampleIndicators" role="button" data-
slide="next">
<span class="carousel-control-next-icon" aria-
hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
____________________________________________
This is an example of a simple carousel with three images.
Bootstrap also offers options for adding image captions,
navigation controls, and bookmarks.
In summary, Bootstrap offers a variety of components that
can make the development process much faster and easier.
However, it is important to remember that Bootstrap is just
a tool and does not replace a good knowledge of HTML, CSS
and JavaScript.
Answer the question about the previous content:

Exercise 64: What are the


three main components of
Bootstrap mentioned in
the text?
( A ) - Buttons, forms and carousel
( B ) - Buttons, tables and carousel
( C ) - Forms, tables and carousel

Note: The correct answer is on the last page.


INTRODUCTION TO
JAVASCRIPT: VARIABLES,
DATA TYPES,
OPERATORS
::: 19. Introduction to JavaScript: Variables, Data Types,
Operators :::
JavaScript is a dynamic programming language that is
primarily used to add interactivity to web pages. It allows
developers to manipulate web page elements and change
their behavior according to user actions. In this chapter, we
will explore the basic concepts of JavaScript, such as
variables, data types, and operators.
::: Variables :::
Variables are used to store data that can be used and
modified later in your code. In JavaScript, you can declare a
variable using the 'var', 'let' or 'const' keyword. For
example:
____________________________________________

var name = 'John';


let age = 25;
const pi = 3.14;
____________________________________________
Here, 'name' and 'age' are variables that store a string and
a number, respectively. 'pi' is a constant that stores the
value of pi. The main difference between 'var', 'let' and
'const' is scope and reassignment. 'var' has a function
scope, while 'let' and 'const' have a block scope.
Furthermore, 'const' does not allow reassignment of values.
::: Data Types :::
JavaScript has six primitive data types:

---String: represents a sequence of characters. For example:


'Hello, World!'
---Number: represents a numeric value. For example: 10,
3.14
---Boolean: represents a true or false value.
---Undefined: represents an undefined value.
---Null: represents a null value.
---Symbol: represents a unique value that is not equal to any
other value.

In addition to these, JavaScript also has a data type called


Object to store collections of data and more complex
entities.
::: Operators :::
Operators are used to perform operations between variables
and values. JavaScript has several types of operators:

---Arithmetic operators: are used to perform mathematical


operations. For example: +, -, *, /, %, ++, --
---Assignment operators: are used to assign values ??to
variables. For example: =, +=, -=, *=, /=
---Comparison operators: are used to compare two values.
For example: ==, !=, ===, !==, >, <, >=, <=
---Logical operators: are used to combine conditions. For
example: &&, ||, !

These are the basic JavaScript concepts you need to


understand to start programming in JavaScript. In the next
chapter, we will explore more about functions and how they
are used in JavaScript.
Answer the question about the previous content:

Exercise 65: What is the


main difference between
'var', 'let' and 'const' in
JavaScript?
( A ) - 'var' and 'let' are used to declare variables, while
'const' is used to declare constants.
( B ) - 'var' has a function scope, while 'let' and 'const' have
a block scope. Furthermore, 'const' does not allow
reassignment of values.
( C ) - 'var', 'let' and 'const' are used to declare different
data types.

Note: The correct answer is on the last page.


INTRODUCTION TO
JAVASCRIPT: VARIABLES,
DATA TYPES,
OPERATORS:
INTRODUCTION TO
JAVASCRIPT
::: 19.1. Introduction to Javascript: variables, data types,
operators :::
Javascript is a dynamic and interpreted programming
language that is essential for creating interactive web
pages. It is one of the three main technologies that make up
the World Wide Web, along with HTML and CSS. In this
section, we will introduce some of the fundamental concepts
of Javascript: variables, data types and operators.
::: Variables :::
In Javascript, a variable is a container for storing data
values. To declare (create) a variable, we use the 'var'
keyword, followed by the variable name. For example, var
x;. In this example, 'x' is the variable. Now, we can store a
value in this variable using the '=' assignment operator. For
example, x = 5;. Now, the variable 'x' contains the value 5.
Variables in Javascript can contain many different types of
data: numbers, strings, objects, and more. This brings us to
the next topic: data types.
::: Data Types :::
Javascript has a variety of data types. Here are the most
common ones:

---Numbers: These can be integers or decimals. For


example, var x = 10; or var y = 3.14;.
---Strings: These are sequences of characters, usually
enclosed in quotation marks. For example, var greeting =
"Hello, world!";.
---Boolean: This is a logical data type that can have only one
of two values: true (true) or false (false). For example, var
isRaining = false;.
---Objects: These are collections of named values, similar to
'dictionaries' in some other programming languages. For
example, var person = {firstName: "John", lastName:
"Donate"};.
---Undefined: This is a special data type that represents an
undefined value. A variable that has been declared but not
assigned a value has the type 'undefined'.
---Null: This is another special data type that represents a
null or "nothing" value.

These data types allow Javascript programmers to


manipulate a variety of information in their programs.
::: Operators :::
Operators are symbols that perform operations on values.
Javascript has many types of operators, including:

---Arithmetic operators: These perform mathematical


operations. For example, x + y (addition), x - y (subtraction),
x * y (multiplication), x / y (division), and x % y (module, or
remainder of the division).
---Assignment operators: These assign values ??to variables.
The simplest is the '=' operator. For example, x = 5;. There
are also compound assignment operators that perform an
arithmetic operation and an assignment at the same time.
For example, x += 5; is the same as x = x + 5;.
---Comparison operators: These compare two values ??and
return a boolean (true or false). For example, x == y (equal
to), x != y (not equal to), x > y (greater than), x < y (less
than), x >= y (greater than or equal to), and x <= y (less
than or equal to) .
---Logical operators: These operate on Booleans. For
example, x &amp;&amp; y (logical AND), x || y (logical OR),
and !x (NOT logical).

Operators allow Javascript programmers to perform complex


operations and make decisions in their programs.
In summary, variables, data types, and operators are
fundamental Javascript concepts that every front-end
developer must understand. Understanding these concepts
is the first step to becoming an effective Javascript
developer.
Answer the question about the previous content:

Exercise 66: What are the


three fundamental
Javascript concepts
mentioned in the text?
( A ) - Variables, Functions and Arrays
( B ) - Variables, Data Types and Operators
( C ) - HTML, CSS and Javascript
( D ) - Strings, Numbers and Booleans

Note: The correct answer is on the last page.


INTRODUCTION TO
JAVASCRIPT: VARIABLES,
DATA TYPES,
OPERATORS: VARIABLES
IN JAVASCRIPT
::: 19.2. Introduction to Javascript: variables, data types,
operators: Variables in Javascript :::
Javascript is a high-level, dynamic language that is
commonly used to make web pages interactive. One of the
fundamental characteristics of Javascript is the ability to
manipulate variables. Variables are basically containers that
store information that can be changed and manipulated
over time.
::: Declaring Variables :::
To declare a variable in Javascript, we use the keywords var,
let or const. The var keyword was the traditional way to
declare variables, but was replaced by the let and const
keywords in the ES6 Javascript update . The difference
between these keywords lies in the mutability and scope of
the variables.
____________________________________________
var x = 10; // Variable declaration using 'var'
let y = 20; // Variable declaration using 'let'
const z = 30; // Variable declaration using 'const'
____________________________________________
::: Data Types :::
Javascript is a dynamically typed language, which means we
do not need to specify the data type when declaring a
variable. Data types can be divided into two categories:
primitives and objects.
Primitive data types include: Number, String, Boolean,
Undefined, Null and Symbol. Objects are a collection of
properties, with each property consisting of a key-value pair.
::: Operators :::
Javascript provides a variety of operators that can be used
to manipulate data. These include arithmetic, comparison,
logical, and assignment operators.
::: Arithmetic Operators :::
Arithmetic operators are used to perform mathematical
operations. These include addition (+), subtraction (-),
multiplication (*), division (/), and modulus (%).
____________________________________________
var a = 10;
var b = 20;
console.log(a + b); // 30
console.log(a - b); // -10
console.log(a * b); // 200
console.log(a / b); // 0.5
console.log(a % b); // 10
____________________________________________
::: Comparison Operators :::
Comparison operators are used to compare two values.
These include equal (==), not equal (!=), strict equal
(===), strict not equal (!==), greater than (>), less than
(<), greater than or equal (>= ), and less than or equal
(<=).
____________________________________________
var a = 10;
var b = 20;
console.log(a == b); // false
console.log(a != b); // true
console.log(a === b); // false
console.log(a !== b); // true
console.log(a > b); // false
console.log(a < b); // true
console.log(a >= b); // false
console.log(a <= b); // true
____________________________________________
::: Logical Operators :::
Logical operators are used to test the truth of something.
These include AND (&&), OR (||), and NOT (!).
____________________________________________
var a = true;
var b = false;
console.log(a && b); // false
console.log(a || b); // true
console.log(!a); // false
____________________________________________
::: Assignment Operators :::
Assignment operators are used to assign values ??to
variables. These include the assignment operator (=),
addition and assignment (+=), subtraction and assignment
(-=), multiplication and assignment (*=), division and
assignment (/=), and modulo and assignment (%=) .
____________________________________________
var a = 10;
a += 20; // a = a + 20
console.log(a); // 30
a -= 10; // a = a - 10
console.log(a); // 20
a *= 2; // a = a * 2
console.log(a); // 40
a /= 4; // a = a / 4
console.log(a); // 10
a %= 3; // a = a % 3
console.log(a); // 1
____________________________________________
In summary, variables in Javascript are a fundamental part
of the language. They allow programmers to store and
manipulate data effectively. Understanding how to declare
variables, different data types, and how to use operators is
crucial to becoming an efficient Javascript developer.
Answer the question about the previous content:

Exercise 67: What are the


keywords used to declare
variables in Javascript?
( A ) - var, let, const
( B ) - int, float, char
( C ) - public, private, protected

Note: The correct answer is on the last page.


INTRODUCTION TO
JAVASCRIPT: VARIABLES,
DATA TYPES,
OPERATORS: DATA
TYPES IN JAVASCRIPT
::: 19.3. Introduction to Javascript: variables, data types,
operators: Data Types in Javascript :::
JavaScript is a dynamic programming language that allows
the creation of interactive and complex content on websites.
When we talk about data types in JavaScript, we are
referring to the different types of values ??that a variable
can have. Data types are fundamental to understanding
how information is stored and manipulated in JavaScript.
::: Variables :::
A variable is a container for storing data. In JavaScript, we
declare variables using the keywords 'var', 'let' and 'const'.
For example, let name = 'John';. Here 'name' is the variable
and 'John' is the value we are storing in it.
::: Data Types :::
JavaScript has six primitive data types: String, Number,
Boolean, Null, Undefined, and Symbol. Additionally, it has a
non-primitive data type: Object.
::: String :::
A string is a sequence of characters used to represent text.
In JavaScript, strings are wrapped in single or double quotes.
For example, let name = 'John'; or let name = "John";.
::: Number :::
The Number data type is used to represent positive or
negative numbers with or without decimals. For example, let
age = 25; or let average = 19.5;.
::: Boolean :::
The Boolean data type has only two values: true or false.
This data type is commonly used for conditional testing. For
example, let isAdult = true;.
::: Null :::
Null is a special data type that represents "nothing" or
"empty". For example, let empty = null;.
::: Undefined :::
A variable that has been declared but has not had a value
assigned is of type undefined. For example, let test; Here,
test is undefined.
::: Symbol :::
Symbol is a data type introduced in ES6 that produces a
unique value that cannot be changed. For example, let
sym1 = Symbol('sym');.
::: Object :::
Objects are used to store collections of data and more
complex entities. They are different from primitive data
types because they can contain multiple values ??in the
form of properties. For example, let car = {make: 'Toyota',
model: 'Corolla', year: 2005};.
::: Operators :::
Operators are used to perform operations between variables
and values. The main types of operators in JavaScript are:
arithmetic operators, assignment operators, comparison
operators, logical operators and bitwise operators.
::: Arithmetic Operators :::
Arithmetic operators are used to perform mathematical
operations. For example, let sum = 10 + 20;.
::: Assignment Operators :::
Assignment operators are used to assign values ??to
variables. For example, let x = 10;.
::: Comparison Operators :::
Comparison operators are used to compare two values. For
example, let result = (10 == 20); Here, result will be false.
::: Logical Operators :::
Logical operators are used to determine the logic between
variables or values. For example, let result = (10 < 20 &&
20 > 30); Here, result will be false.
Understanding variables, data types and operators is
fundamental for anyone who wants to become a front-end
developer. They are the foundation of any JavaScript
program and are used in almost every script you will write.
Answer the question about the previous content:

Exercise 68: What are the


six primitive data types in
JavaScript?
( A ) - String, Number, Boolean, Null, Array, Object
( B ) - String, Number, Boolean, Null, Undefined, Symbol
( C ) - Integer, Float, Double, Boolean, String, Byte

Note: The correct answer is on the last page.


INTRODUCTION TO
JAVASCRIPT: VARIABLES,
DATA TYPES,
OPERATORS:
OPERATORS IN
JAVASCRIPT

19.4. Introduction to Javascript: variables, data types,


operators: Operators in Javascript

::: Introduction to Javascript: variables, data types,


operators: Operators in Javascript :::
Javascript is a programming language that allows the
creation of interactivity on web pages. It runs in the user's
browser, which means that the code is processed on the
user's computer and not on the server, as is the case with
other programming languages. In this chapter, we will focus
on operators in Javascript.
::: Operators in Javascript :::
Operators in Javascript are used to perform operations
between variables and values. Operators are symbols that
indicate an action to be performed. There are several types
of operators in Javascript, including arithmetic operators,
assignment operators, comparison operators, logical
operators, and bitwise operators.
::: Arithmetic operators :::
Arithmetic operators are used to perform mathematical
operations between numeric values. Arithmetic operators in
Javascript include + (addition), - (subtraction), *
(multiplication), / (division), % (modulus), ++ (increment),
and -- (decrement).
::: Assignment operators :::
Assignment operators are used to assign values ??to
variables. The most common assignment operator is =,
which assigns the value on the right of the operator to the
variable on the left. Other assignment operators include +=,
-=, *=, /=, and %=, which perform an arithmetic operation
before assigning the result to the variable.
::: Comparison operators :::
Comparison operators are used to compare two values ??
and return a Boolean value that indicates whether the
comparison is true or false. Comparison operators in
Javascript include == (equal to), != (not equal to), >
(greater than), < (less than), >= (greater than or equal to),
<= (less than or equal to), === (equal to and of the same
type) and !== (not equal to or not of the same type).
::: Logical operators :::
Logical operators are used to determine the logic
between variables or values. Logical operators in Javascript
include && (and), || (or) and ! (no).
::: Bitwise operators :::
Bitwise operators are used to manipulate the bits of a
number. Bitwise operators in Javascript include & (bitwise
AND), | (bitwise OR), ^ (bitwise XOR), ~ (bitwise NOT), <<
(left shift), >> (right shift) and >>> (right shift without
signal).
Operators in Javascript are a fundamental part of the
language and are used in almost all scripts. They allow
programmers to perform complex operations with few lines
of code. However, it is important to remember that
operators must be used with caution, as inappropriate use
can lead to unexpected results.
In summary, operators in Javascript allow programmers to
perform a variety of operations, from simple mathematical
calculations to complex comparisons and bit manipulations.
Understanding how and when to use each type of operator
is a fundamental skill for any Javascript programmer.
Answer the question about the previous content:

Exercise 69: What are the


types of operators in
Javascript mentioned in
the text?
( A ) - Arithmetic operators, assignment operators,
comparison operators, logical operators and bitwise
operators.
( B ) - Mathematical operators, assignment operators,
equality operators, logical operators and bit operators.
( C ) - Arithmetic operators, assignment operators, equality
operators, condition operators and bitwise operators.

Note: The correct answer is on the last page.


CONTROL STRUCTURES
IN JAVASCRIPT: IF, FOR,
WHILE

Control Structures in Javascript

::: Complete HTML, CSS and Javascript course to become


a Front End Developer :::
::: Chapter 20: Control Structures in Javascript: if, for,
while :::
Control structures in JavaScript are essential for
programming because they allow you to control the flow of
execution of your code. In this chapter, we will cover the 'if',
'for' and 'while' structures.
::: 1. The 'if' structure :::
The 'if' control structure is used to execute a block of
code if a specified condition is true. The basic syntax is:
____________________________________________

if (condition) {
// code to be executed if the condition is true
}
____________________________________________
For example, if we want to check if a variable 'x' is
greater than 10, we could write:
____________________________________________

if (x > 10) {
console.log("x is greater than 10");
}

____________________________________________
::: 2. The 'for' structure :::
The 'for' control structure is used to repeat a block of
code a specific number of times. The basic syntax is:
____________________________________________

for (initialization; condition; increment) {


// code to be executed on each repetition
}

____________________________________________
For example, if we wanted to print the numbers 1 to 5, we
could write:
____________________________________________

for (let i = 1; i <= 5; i++) {


console.log(i);
}

____________________________________________
::: 3. The 'while' structure :::
The 'while' control structure is used to repeat a block of
code as long as a specified condition is true. The basic
syntax is:
____________________________________________

while (condition) {
// code to be executed while the condition is true
}

____________________________________________
For example, if we wanted to print the numbers 1 to 5, we
could write:
____________________________________________

let i = 1;
while (i <= 5) {
console.log(i);
i++;
}

____________________________________________
These control structures are the foundation of JavaScript
programming and are used in almost all programs. They
allow you to control the flow of your code, making certain
blocks of code only execute under certain conditions or
repeat a specific number of times. Understanding how and
when to use these frameworks is essential to becoming an
effective JavaScript developer.
In the next chapter, we will explore control structures in
more depth and learn about other important structures such
as 'switch' and 'do-while'. Read on to learn more about how
to become an effective front-end developer with our
complete HTML, CSS, and JavaScript course.
Answer the question about the previous content:

Exercise 70: Which of the


following statements
about control structures in
Javascript is correct?
( A ) - The 'if' structure is used to repeat a block of code a
specific number of times.
( B ) - The 'for' structure is used to execute a block of code if
a specified condition is true.
( C ) - The 'while' structure is used to repeat a block of code
as long as a specified condition is true.

Note: The correct answer is on the last page.


FUNCTIONS IN
JAVASCRIPT
CHAPTER 21:
FUNCTIONS IN
JAVASCRIPT
Functions in Javascript are one of the main building blocks of
a program. A function is a Javascript procedure - a set of
instructions that performs a task or calculates a value. To
use a function, you must define it somewhere in the scope
from which you want to call it.
::: Defining functions :::
A function in Javascript is defined with the keyword
"function", followed by a name, followed by parentheses ().
____________________________________________

function functionName() {
// code to be executed
}
____________________________________________
Brackets can include parameter names separated by
commas: (parameter1, parameter2, ...)
::: Parameters vs Arguments :::
The terms parameters and arguments can be used for the
same thing: information that is passed to a function.
Of a function, the parameters are the names listed in the
function definition.
The arguments are the actual values ??received by the
function when it is invoked.
When you invoke a function, you can pass arguments to it.
Arguments are the values ??you pass to the function.
::: Invoking functions :::
A function will execute your code when you call it. You call a
function by referring to its name, followed by parentheses.
____________________________________________

FunctionName();
____________________________________________
When a function is called, arguments are passed to the
function as inputs, and the function can process them to
produce an output.
::: Return functions :::
A function can have an optional return statement. The
return statement ends execution of the function and
specifies a value to be returned to the calling function.
____________________________________________

function myFunction() {
return value;
}
____________________________________________
::: Anonymous functions and function expressions :::
Functions do not need to have a name. You can create
anonymous functions or function expressions.
An anonymous function is a function without a name.
Anonymous functions are typically assigned to variables or
used as arguments to other functions.
____________________________________________

var myFunction = function() {


// code to be executed
}
____________________________________________
A function expression is similar to an anonymous function,
except that it is used as part of a larger expression, such as
an arithmetic operation or a function call.
____________________________________________

(function() {
// code to be executed
})();
____________________________________________
::: Arrow functions :::
Arrow functions are a new syntax for writing functions in
Javascript introduced in ES6. They are shorter and easier to
write than traditional functions.
____________________________________________

var myFunction = () => {


// code to be executed
}
____________________________________________
Arrow functions have some differences from normal
functions. The most notable is that the value of "this" within
an arrow function is determined by the invocation context,
not the function itself.
In summary, functions are a vital part of Javascript and are
used to encapsulate code so that it can be reused. They can
take arguments, return values, and be named or
anonymous. With the advent of ES6, we also have the
option to use arrow function syntax for more concise code
writing.
Answer the question about the previous content:

Exercise 71: Which of the


following statements is
true about functions in
Javascript?
( A ) - Functions in Javascript are defined with the "class"
keyword, followed by a name, followed by parentheses ().
( B ) - Arguments are the names listed in the function
definition.
( C ) - Arrow functions are a new syntax for writing functions
in Javascript introduced in ES6, and the value of "this" within
an arrow function is determined by the invocation context,
not the function itself.

Note: The correct answer is on the last page.


OBJECTS AND ARRAYS
IN JAVASCRIPT
Objects and arrays in JavaScript are fundamental for
manipulating data and building dynamic web applications.
They are data structures that allow you to store multiple
values ??in a single variable.
::: Objects in JavaScript :::
In JavaScript, an object is a collection of properties where
each property is made up of a name (or 'key') and a value.
The value of a property can be a function, in which case the
property is known as a method. Object in JavaScript can be
created using object literal syntax, which is the simplest and
most common.
____________________________________________
var object = {
key1: "value1",
key2: "value2",
key3: function() {
// method code
}
};
____________________________________________
Objects in JavaScript can be manipulated in many ways. You
can access, add, modify, and remove properties of an
object. To access a property of an object, you can use dot
notation or bracket notation.
____________________________________________
var value1 = object.key1; // dot notation
var value2 = object["key2"]; // bracket notation
____________________________________________
::: Arrays in JavaScript :::
An array in JavaScript is a special object that is used to store
multiple values ??in a single variable. Each value (also
called an element) in an array has a position, known as an
index, which is used to access it. The index of an array
starts at 0, which means the first element is at index 0, the
second element is at index 1, and so on.
____________________________________________
var array = ["element1", "element2", "element3"];
____________________________________________
Arrays in JavaScript can also be manipulated in several
ways. You can access, add, modify and remove elements
from an array. To access an element of an array, you use
square bracket notation with the element index.
____________________________________________
var element1 = array[0];
____________________________________________
To add an element to an array, you can use the push
method. To remove an element from an array, you can use
the pop (removes the last element), shift (removes the first
element) or splice (removes one or more elements from a
specific position) methods.
____________________________________________
array.push("element4"); // add to end
array.pop(); // remove from end
array.shift(); // remove from beginning
array.splice(1, 2); // remove 1, 2 elements from index
____________________________________________
::: Conclusion :::
Objects and arrays in JavaScript are powerful tools for
manipulating data. They allow you to store and manipulate
multiple values ??in a single variable, which is essential for
building dynamic web applications. Learning to work with
objects and arrays is a fundamental step towards becoming
a proficient front-end developer in JavaScript.
We hope this chapter has provided you with a solid
understanding of the basic concepts of objects and arrays in
JavaScript. In the next chapter, we will explore advanced
concepts of objects and arrays, including manipulating
nested objects and multidimensional arrays.
Answer the question about the previous content:

Exercise 72: What is true


about objects and arrays
in JavaScript?
( A ) - Objects and arrays in JavaScript do not allow storing
multiple values ​in a single variable.
( B ) - The index of an array in JavaScript starts at 1.
( C ) - You can access, add, modify, and remove properties
of an object and elements of an array in JavaScript.

Note: The correct answer is on the last page.


DOM AND HTML
ELEMENT
MANIPULATION WITH
JAVASCRIPT
The Document Object Model (DOM) is a programming
interface that allows scripts to be connected to the content
of a web page. It represents the structure of a web page and
can be manipulated with JavaScript to change the page's
content and layout. This chapter of our e-book will cover
manipulating the DOM and HTML elements with JavaScript.
To begin with, the DOM is a tree representation of the web
page. Every element, attribute, and text on the page is
represented by an object in the DOM. These objects are
organized in a tree structure, with the 'document' object at
the top. This object represents the web page as a whole and
is the starting point for accessing any part of the page.
Objects in the DOM have properties and methods that you
can use to manipulate them. For example, the 'document'
object has a 'getElementById' method that you can use to
get a page element by its ID. Once you have a reference to
an element, you can use its properties and methods to
change its content, style, and more.
For example, suppose we have a paragraph element on our
page with the id 'myPara'. We can get a reference to this
element and change its content as follows:
____________________________________________
var para = document.getElementById('myPara');
para.textContent = 'New content!';
____________________________________________
Here, we use the 'getElementById' method to get a
reference to the paragraph element, and then we use the
'textContent' property to change the paragraph content.
Note that the page content is immediately updated to
reflect the change.
In addition to changing the content of an element, you can
change its style. Each element has a 'style' property that
you can use to change the element's CSS style. For
example, you can change the color of our paragraph text as
follows:
____________________________________________
para.style.color = 'red';
____________________________________________
Here, we use the 'style' property to access the element's
style, and then we use the 'color' property to change the
color of the text. Again, the page updates immediately to
reflect the change.
You can also use JavaScript to add and remove elements
from the page. Each element has 'appendChild' and
'removeChild' methods that you can use to add or remove
elements. For example, you can add a new paragraph
element to the page as follows:
____________________________________________
var newPara = document.createElement('p');
newPara.textContent = 'A new paragraph!';
document.body.appendChild(newPara);
____________________________________________
Here, we use the 'createElement' method to create a new
paragraph element, and then we use the 'appendChild'
method to add the new paragraph to the body of the page.
Again, the page updates immediately to reflect the change.
In short, the DOM is a powerful programming interface that
allows you to manipulate the content and layout of a web
page with JavaScript. By learning how to use the DOM, you
will be taking a big step towards becoming an effective
front-end developer.
In the next chapter, we'll explore the DOM deeper and learn
how to use events to make our web pages more interactive.
Stay tuned!
Answer the question about the previous content:

Exercise 73: What is the


Document Object Model
(DOM) and how can it be
manipulated?
( A ) - The DOM is a search engine that allows you to find
specific information on a web page. It can be manipulated
using Python to change the page content and layout.
( B ) - The DOM is a programming interface that allows
scripts to be linked to the content of a web page. It can be
manipulated using JavaScript to change the content and
layout of the page.
( C ) - The DOM is a design tool that allows you to create
web page layouts. It can be manipulated using HTML to
change the content and layout of the page.

Note: The correct answer is on the last page.


EVENTS AND
LISTENERS IN
JAVASCRIPT

::: Chapter 24: Events and Listeners in Javascript :::


Events in Javascript are actions or occurrences that happen
in the system you are programming, be it a mouse click, a
page loading or a key press. Events are one of the main
mechanisms that allow interaction between the user and
the interface.
In terms of web development, events are triggered in the
browser, such as a mouse click, a page loading, a key press,
etc. These events can be captured and handled using
Javascript, allowing the creation of interactive and dynamic
user interfaces.
::: Event Listeners :::
Event Listeners, or event listeners, are functions that 'listen'
for some specific type of event to happen. When this event
occurs, the Event Listener is triggered and performs an
action.
To add an Event Listener to an HTML element, we use the
'addEventListener' method. This method receives two
parameters: the name of the event you want to listen to and
the function that will be executed when the event occurs.
____________________________________________

element.addEventListener('click', function() {
// Code to be executed when the event occurs
});
____________________________________________
Event Listeners are a fundamental part of Javascript
programming for the web, as they allow user interaction
with the page. Without them, the page would be completely
static and would have no way of reacting to user actions.
::: Types of Events :::
There are several types of events that can be listened to in
Javascript. Some of the most common include:

---click: triggered when the user clicks on an element;


---dblclick: triggered when the user double-clicks on an
element;
---mouseover: triggered when the mouse cursor passes
over an element;
---mouseout: triggered when the mouse cursor leaves an
element;
---keydown: triggered when the user presses a key;
---load: triggered when the page finishes loading.

::: Handling Events :::


When handling events, it is common to want to access the
element that triggered the event. This can be done through
the 'event' object which is automatically passed to the
function being executed by the Event Listener. This object
contains various information about the event, including the
element that triggered it.
____________________________________________
element.addEventListener('click', function(event) {
console.log('The element that was clicked is: ',
event.target);
});
____________________________________________
In addition, it is also possible to prevent the default behavior
of an event from happening. This is done through the
'preventDefault' method of the 'event' object.
____________________________________________

element.addEventListener('click', function(event) {
event.preventDefault();
console.log('The click will not have the default effect.');
});
____________________________________________
Events and Listeners in Javascript are a fundamental part of
web development. They enable the creation of interactive
and dynamic user interfaces, responding to user actions in
real time. Therefore, it is essential that every Front End
developer has a good understanding of them.
Answer the question about the previous content:

Exercise 74: What are


Event Listeners in
Javascript and how are
they used?
( A ) - These are functions that 'listen' for some specific type
of event to happen and when that event occurs, the Event
Listener is triggered and performs an action.
( B ) - These are HTML elements that allow the user to
interact with the page.
( C ) - These are events that happen in the system you are
programming, such as a mouse click, a page loading, or a
key press.

Note: The correct answer is on the last page.


FORMS AND DATA
VALIDATION WITH
JAVASCRIPT
Forms are an essential part of any web application. They are
the main interface between the user and the server,
allowing users to enter data that will be sent to the server
for processing. However, before submitting this data, it is
crucial to ensure that it is valid. This is where data validation
with Javascript comes in.
JavaScript offers several ways to validate form data before it
is sent to the server. This is important because it helps
ensure that the data sent to the server is accurate and
complete, which can save valuable processing time and
resources.
::: Form Validation with JavaScript :::
Form validation with JavaScript typically involves the use of
events and functions. An event is something that happens
on the page, like a click or a keypress. A function is a block
of code that is executed when it is called.
For example, you can use the "onsubmit" event to call a
validation function when the user tries to submit the form.
This validation function can then check each form field to
ensure it meets certain criteria.
Here is an example of how you can do this:
____________________________________________
<form id="myForm" onsubmit="return validateForm()">
<input type="text" id="name" name="name">
<input type="submit" value="Submit">
</form>
<script>
function validateForm() {
var x = document.forms["myForm"]["name"].value;
if (x == "") {
alert("Name must be filled out");
return false;
}
}
</script>
____________________________________________
In the example above, the validateForm() function is called
when the form is submitted. It checks if the "name" field is
empty. If it is empty, it displays an alert and prevents the
form from being submitted.
::: Data type validation :::
In addition to checking whether a field is empty, you may
also want to check whether the data you enter is the correct
type. For example, if you have a field where users must
enter a number, you can use JavaScript's isNaN() function to
check whether the entered value is actually a number.
____________________________________________
<form id="myForm" onsubmit="return validateForm()">
<input type="text" id="number" name="number">
<input type="submit" value="Submit">
</form>
<script>
function validateForm() {
var x = document.forms["myForm"]["number"].value;
if (isNaN(x)) {
alert("Must input numbers");
return false;
}
}
</script>
____________________________________________
In the example above, the validateForm() function checks
whether the value entered in the "number" field is a
number. If it is not a number, it displays an alert and
prevents the form from being submitted.
::: Data format validation :::
You may also want to check that the data you enter is in the
correct format. For example, if you have a field where users
must enter an email address, you can use a regular
expression to check whether the entered value looks like an
email address.
____________________________________________
<form id="myForm" onsubmit="return validateForm()">
<input type="text" id="email" name="email">
<input type="submit" value="Submit">
</form>
<script>
function validateForm() {
var x = document.forms["myForm"]["email"].value;
var atpos = x.indexOf("@");
var dotpos = x.lastIndexOf(".");
if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length) {
alert("Not a valid email address");
return false;
}
}
</script>
____________________________________________
In the example above, the validateForm() function checks
whether the value entered in the "email" field looks like an
email address. If it doesn't look like an email address, it
displays an alert and prevents the form from being
submitted.
These are just a few examples of how you can use
JavaScript to validate form data. Data validation is a crucial
part of web application development, and JavaScript offers
many powerful tools to help you do it effectively.
Answer the question about the previous content:

Exercise 75: What is the


role of data validation in
web forms using
JavaScript?
( A ) - Automatically send data to the server.
( B ) - Verify that the data entered is valid and complete
before being sent to the server.
( C ) - Change the web form layout.

Note: The correct answer is on the last page.


INTRODUCTION TO
JQUERY
As we reach the twenty-sixth part of our course, we are
ready to dive into the world of jQuery, a widely used
JavaScript library that simplifies HTML programming. jQuery
is a lightweight, "write less, do more", JavaScript library that
simplifies the interaction between JavaScript and HTML.
jQuery was launched in 2006 by John Resig. Since then, it
has been the tool of choice for many web developers due to
its simplicity and ease of use. It lets you do more with less
code, making the web development process more efficient
and enjoyable.
::: Why use jQuery? :::
There are several reasons why you might want to use
jQuery in your projects. First, it simplifies many common
JavaScript tasks such as DOM manipulation, event handling,
animation, and Ajax. This means you can do more with less
code, which in turn makes your code easier to understand
and maintain.
Secondly, jQuery is compatible with a wide range of
browsers, including Internet Explorer 6.0+, FF 2.0+, Safari
3.2+, Chrome and Opera 9.6+. This means you can use
jQuery without worrying about whether it will work in all
browsers.
::: How to use jQuery? :::
To start using jQuery, you need to include it in your HTML
file. You can do this by downloading the jQuery library from
the official website (jquery.com) and including it in your
HTML file using the script tag, or you can include the library
directly from a CDN (Content Delivery Network) like Google
or Microsoft.< /p>
Once jQuery is included in your HTML file, you can start
using it. The jQuery syntax is designed to make it easier to
navigate a document, select DOM elements, create
animations, handle events, and develop Ajax applications.
::: Selecting Elements with jQuery :::
One of the main advantages of jQuery is its powerful
element selection capabilities. It uses CSS syntax to select
elements, which means you can select elements the same
way you would in CSS. For example, to select all paragraph
elements in a document, you can use the following code:
____________________________________________
$('p')
____________________________________________
This will select all paragraph elements in the document. You
can then manipulate these elements using various jQuery
methods.
::: Manipulating Elements with jQuery :::
Once you have selected elements with jQuery, you can
manipulate them in several ways. For example, you can
change the content of an element using the .html() method,
change the style of an element using the .css() method, or
add and remove classes from an element using the
.addClass() and .addClass() methods. removeClass().
::: Handling Events with jQuery :::
jQuery also makes event handling easier. For example, you
can easily bind a click event to an element using the .click()
method. Similarly, you can bind mouseover, mouseout,
mousedown, mouseup, and many other events to elements.
::: Conclusion :::
In short, jQuery is a powerful tool that simplifies many
common JavaScript tasks. It lets you do more with less code,
is compatible with a wide range of browsers, and makes it
easier to select and manipulate DOM elements and handle
events. With jQuery, you can make your web projects more
interactive and user-friendly.
In the next part of our course, we'll dive deeper into jQuery
and learn how to use it to create animations, work with Ajax,
and more. So stay tuned!
Answer the question about the previous content:

Exercise 76: Who launched


jQuery and in what year?
( A ) - Steve Jobs in 2005
( B ) - Mark Zuckerberg in 2004
( C ) - John Resig in 2006

Note: The correct answer is on the last page.


EFFECTS AND
ANIMATIONS WITH
JQUERY
jQuery is an extremely popular JavaScript library that
simplifies HTML programming. It offers a variety of powerful
features, including the ability to create dynamic effects and
animations. In this chapter, we'll explore how you can use
jQuery to add some life and movement to your website or
web application.
To begin with, it's important to understand that jQuery offers
two main types of animations: those that you can apply
directly to HTML elements, such as fade and slide, and those
that you can create using the animate() function.
Fade and slide effects are simple to understand and
implement. For example, to make an element fade out, you
can use the .fadeOut() method. Here is an example:
____________________________________________
<script>
$(document).ready(function(){
$("button").click(function(){
$("p").fadeOut();
});
});
</script>
____________________________________________
In this example, when the button is clicked, all elements of
the paragraph fade out. You can control the speed of the
fade effect by passing an argument to the .fadeOut()
method.
Similarly, you can use the .slideDown() method to make an
element slide down. Here is an example:
____________________________________________
<script>
$(document).ready(function(){
$("button").click(function(){
$("p").slideDown();
});
});
</script>
____________________________________________
In this example, when the button is clicked, all paragraph
elements slide down. Again, you can control the speed of
the slide effect by passing an argument to the .slideDown()
method.
Now, let's talk about the animate() function. This function
allows you to create custom animations by modifying one or
more CSS styles of an element over time. Here is an
example:
____________________________________________
<script>
$(document).ready(function(){
$("button").click(function(){
$("div").animate({left: '250px'});
});
});
</script>
____________________________________________
In this example, when the button is clicked, the div element
moves 250 pixels to the left. You can animate almost any
CSS style using the animate() function.
One of the most powerful things about the animate()
function is that you can chain multiple animations together.
Here is an example:
____________________________________________
<script>
$(document).ready(function(){
$("button").click(function(){
$("div").animate({left: '250px'}).animate({top: '250px'});
});
});
</script>
____________________________________________
In this example, when the button is clicked, the div element
moves 250 pixels to the left and then 250 pixels up.
Animations run sequentially, one after the other.
Finally, jQuery also offers a variety of callbacks and
promises that you can use to control the flow of your
animations. For example, you can use the .done() method to
run code when an animation is complete.
In summary, jQuery offers a variety of powerful tools for
creating dynamic effects and animations. With a little
practice, you can use these tools to add some life and
movement to your website or web app. So go ahead and
give it a try - you'll be amazed at how much you can do with
just a few lines of code!
Answer the question about the previous content:

Exercise 77: What are the


two main types of
animations that jQuery
offers?
( A ) - Scrolling and zooming animations
( B ) - Animations that can be applied directly to HTML
elements and animations created using the animate()
function
( C ) - Rotation and translation animations

Note: The correct answer is on the last page.


AJAX AND HTTP
REQUESTS WITH
JAVASCRIPT
Ajax, which stands for Asynchronous JavaScript and XML, is
a web development technique that allows a web page to
update parts of its content without having to reload the
entire page. This is achieved by sending HTTP requests with
Javascript to the server and processing the response. This
chapter will delve deeper into HTTP requests with Javascript
using Ajax.
To begin with, an HTTP request is a request for a specific
resource (such as a web page, an image file, etc.) on a web
server. The request is sent by the client's browser to the
server, which then processes the request and returns the
response to the client. This is known as the request-
response cycle.
In Javascript, we can create and send HTTP requests using
the XMLHttpRequest object. This object provides us with
methods and properties that we can use to send and receive
data from the server. Here is a basic example of how to
create an HTTP request with Javascript:
____________________________________________
var xhr = new XMLHttpRequest();
xhr.open('GET', 'https://api.example.com/data', true);
xhr.send();
____________________________________________
In the example above, we first create a new instance of the
XMLHttpRequest object. We then use the open() method to
configure the request. The first argument is the HTTP
method we want to use (in this case, GET), and the second
argument is the URL we want to send the request to. The
third argument is a boolean value that indicates whether the
request should be asynchronous or not (in this case, true for
asynchronous).
After configuring the request, we use the send() method to
send it to the server. If the request is asynchronous, the
send() method returns immediately and script execution
continues. If the request is synchronous, the send() method
will not return until the response is received from the server.
We can use the 'readystatechange' event to listen for
changes in the state of the request. When the state
changes, the callback function we provided will be called.
We can then check the status of the request and process the
response if the request completes successfully. Here is an
example of how to do this:
____________________________________________
xhr.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
console.log(this.responseText);
}
};
____________________________________________
In the example above, the callback function checks if the
request status is 4 (which means the request was
completed) and if the HTTP status is 200 (which means the
request was successful). If both conditions are true, the
server's response (which is a text string) is logged to the
console.
Ajax is a powerful technique that allows you to create more
interactive and responsive web pages. By using
asynchronous HTTP requests with Javascript, we can update
parts of a web page without having to reload the entire
page. This provides a smoother and more efficient user
experience.
In summary, AJAX and HTTP requests with JavaScript are
fundamental to creating modern, interactive web
applications. Through the use of the XMLHttpRequest object,
we can send and receive data from the server
asynchronously, allowing dynamic updates to the page
without the need to reload the entire page. This leads to a
much better and more fluid user experience.
Answer the question about the previous content:

Exercise 78: What does


AJAX mean and how does
it work in web
development?
( A ) - AJAX stands for Asynchronous JavaScript and XML, it is
a technique that allows a web page to update parts of its
content without having to reload the entire page. This is
achieved by sending HTTP requests with Javascript to the
server and processing the response.
( B ) - AJAX stands for Asynchronous JavaScript and XML, it is
a technique that allows a web browser to update parts of its
content without having to reload the entire page. This is
achieved by sending HTTP requests with PHP to the server
and processing the response.
( C ) - AJAX stands for Asynchronous JavaScript and XML, it is
a technique that allows a web server to update parts of its
content without having to reload the entire page. This is
achieved by sending HTTP requests with Javascript to the
browser and processing the response.

Note: The correct answer is on the last page.


INTRODUCTION TO
REACT.JS
CHAPTER 29:
INTRODUCTION TO
REACT.JS
React.js, or simply React, is an open-source JavaScript
library created by Facebook to build complex, reactive user
interfaces. Since it was launched in 2013, React has gained
popularity due to its efficient and flexible approach to
building user interfaces in web applications. This
introduction to React.js will introduce you to the
fundamental concepts behind the library, as well as how it
fits into the front-end development ecosystem.
::: What is React.js? :::
React is a JavaScript library for building user interfaces.
Unlike other libraries and frameworks, React only focuses on
the view layer, making it an ideal choice for projects where
the business logic and user interface are complex and
interdependent. React uses a declarative programming
model, which means you describe what the UI should look
like in any state and React takes care of updating the UI to
match that state.
::: React Components :::
Components are the basic unit of code in React. A
component represents a part of the user interface and can
contain other components. Each component has its own
state and properties, which determine how the component
is rendered. When a component's state or properties
change, React automatically updates the UI to reflect those
changes.
::: JSX :::
JSX is a syntax extension for JavaScript that allows you to
write HTML directly into your JavaScript code. This makes
React code more readable and easier to write. Although JSX
is not mandatory to use React, it is highly recommended
due to its simplicity and efficiency.
::: State and Life Cycle :::
The state of a React component is a JavaScript object that
contains the data that determines the component's
rendered output. When a component's state changes, React
re-renders the component to reflect those changes. A
component's lifecycle is a series of methods that are called
at different points in a component's lifetime. These methods
can be used to control component behavior and respond to
changes in the component's state or properties.
::: React and Front-End Development :::
React is a key part of modern front-end development. It
provides an efficient and flexible way to build complex user
interfaces, making it a popular choice for large-scale
projects. Additionally, React is compatible with a number of
other libraries and development tools, including Redux for
state management, React Router for routing, and Jest for
testing.
::: Conclusion :::
This introduction to React.js presented the fundamental
concepts of the library and its importance in front-end
development. React is a powerful tool for building complex,
reactive user interfaces, and learning to use it effectively is
an essential skill for any front-end developer. In the
following chapters, we'll explore these concepts in more
detail and learn how to use React to build real web
applications.
React.js is an essential part of the modern front-end
development ecosystem and is an indispensable skill for any
developer who wants to build complex, reactive web
applications. With its component-centric approach and
rendering efficiency, React makes the development process
simpler and more manageable. If you're ready to take your
front-end development skills to the next level, start learning
React today.
Answer the question about the previous content:

Exercise 79: What is


React.js and what is its
main function?
( A ) - React.js is a programming language created by
Google to develop Android applications.
( B ) - React.js is an open-source database created by
Facebook to store user information.
( C ) - React.js is an open-source JavaScript library created
by Facebook to build complex, reactive user interfaces.

Note: The correct answer is on the last page.


COMPONENTS AND
STATE IN REACT.JS
React.js is a popular and widely used JavaScript library for
building interactive user interfaces. One of the fundamental
concepts in React.js is that of "components" and "state". To
fully understand React.js and how it works, it is crucial to
understand these concepts and how they are used in
React.js.
::: Components in React.js :::
Components are the building blocks of any React
application. They are independent, reusable units of code
that dictate what should be rendered in the user interface. A
React component can be as simple as a button or as
complex as an entire data table.
Each component in React has a lifecycle that can be
controlled by various lifecycle methods. These lifecycle
methods can be used to perform specific tasks and
manipulations on the component at different phases of the
component's lifecycle.
Components in React can be classified into two main types:
Class Components and Function Components. Class
Components are defined using ES6 class syntax and have
access to additional features such as state and lifecycle
methods. Function Components, on the other hand, are
defined as functions and are simpler and easier to write and
understand.
::: State in React.js :::
State in React is an object that contains data that can
change over time. State is private and completely controlled
by the component. This means that the state of a
component cannot be accessed or modified directly by
another component.
Any change in the state of a component leads to a re-render
of the component. This allows React to create dynamic and
interactive user interfaces. The state is initialized in the
class component's constructor and can be accessed and
modified using the 'this.setState' method.
In function components, state can be used using the
'useState' State Hook. The 'useState' Hook returns a pair of
values: the current state value and a function that can be
used to update it.
::: Components and State in Action :::
To better understand how components and state work in
React, let's consider a simple example. Suppose we are
building a to-do app. In this application we will have a list of
tasks and a button to add a new task.
We can have a 'TaskList' component that renders the list of
tasks. Each task in the list can be a 'Task' component. The
state of the 'TaskList' component can include an array of
tasks. Each time a new task is added, the state is updated
and the 'TaskList' component is re-rendered to show the new
task.
The button for adding a new task can be a separate
component called 'AddTaskButton'. When the button is
clicked, a new task is added to the state of the 'TaskList'
component.
This simple example shows how components and state are
used together to create dynamic, interactive user interfaces
in React.js. Each component has its own responsibility and
state is used to maintain and manipulate data that changes
over time.
In summary, components and state are fundamental
concepts in React.js. Components are the building blocks of
any React application and state is used to maintain data
that can change over time. Understanding these concepts is
crucial to becoming an effective React.js developer.
Answer the question about the previous content:

Exercise 80: What is the


role of state in a React.js
component?
( A ) - State is an object that contains data that never
changes.
( B ) - State is an object that contains data that can change
over time, and any change in the state of a component
leads to a re-render of the component.
( C ) - State is an object that can be accessed and modified
directly by any component.

Note: The correct answer is on the last page.


ROUTES AND
NAVIGATION IN
REACT.JS
React.js, a JavaScript library for building user interfaces, is
an incredibly powerful and flexible tool for front-end
developers. One of its most useful features is the routing
and navigation system, which allows you to create complex
and interactive single page applications (SPA). This chapter
will delve into how to configure and use routes and
navigation in React.js.
First, it is important to understand what routes and
navigation are. In a traditional web application, navigation is
done by changing pages. Every time you click on a link, the
server sends a new page to the browser. With React.js,
however, we can create single-page applications where
navigation is done without reloading the page. Instead,
different components are rendered depending on the
current route.
To start working with routes in React.js, you will need to
install the 'react-router-dom' library. This library is an
extension of React.js that allows the creation of a route
system in our applications. You can install it using the npm
package manager with the following command: 'npm install
react-router-dom'.
Once the library is installed, you can start configuring your
routes. Routes are configured in a special component called
'BrowserRouter', which should wrap around your entire
application. Inside 'BrowserRouter' you can use the 'Route'
component to define your routes. Each 'Route' has a 'path'
property that defines the URL path for the route, and a
'component' property that defines the component that
should be rendered when the route is accessed.
____________________________________________
<BrowserRouter>
<Route path="/" component={Home} />
<Route path="/about" component={About} />
<Route path="/contact" component={Contact} />
</BrowserRouter>
____________________________________________
With this code, when the user accesses the URL '/', the
'Home' component is rendered. If they access '/about', the
'About' component is rendered, and so on. You can define as
many routes as you want this way.
To navigate between routes, you can use the 'Link'
component from the 'react-router-dom' library. This
component creates a link that, when clicked, changes the
current route without reloading the page. The 'to' property
of the 'Link' defines the route to which the link should
navigate.
____________________________________________
<Link to="/about">About</Link>
<Link to="/contact">Contact</Link>
____________________________________________
With this code, when the user clicks on the 'About' link, the
route changes to '/about' and the 'About' component is
rendered. Similarly, when they click on 'Contact', the route
changes to '/contact' and the 'Contact' component is
rendered.
An important thing to note is that 'BrowserRouter' uses
browser history to keep track of the current route. This
means that the browser's back button will work as expected,
returning to the previous route.
In addition, 'react-router-dom' also provides a number of
other useful features, such as nested routes, parameterized
routes, and redirects. Nested routes allow you to have
routes within routes, which is useful for creating complex
interfaces. Parameterized routes allow you to pass data
through the URL. And redirects allow you to redirect the user
to a different route.
In summary, the React.js navigation and routing system is a
powerful tool that allows you to create complex and
interactive single-page applications. With the 'react-router-
dom' library, you can easily configure your routes and
navigate between them without reloading the page.
Additionally, 'react-router-dom' provides a number of other
useful features to further enhance your application.
Answer the question about the previous content:

Exercise 81: What library


is needed to work with
routes in React.js and how
is it installed?
( A ) - The 'react-navigation' library is required and can be
installed using the 'npm install react-navigation' command.
( B ) - The 'react-router-dom' library is required and can be
installed using the 'npm install react-router-dom' command.
( C ) - The 'react-routing' library is required and can be
installed using the 'npm install react-routing' command.

Note: The correct answer is on the last page.


INTRODUCTION TO
VUE.JS

::: Chapter 32: Introduction to Vue.js :::


Vue.js is a progressive JavaScript framework for building
user interfaces. Unlike other monolithic frameworks, Vue
was designed from the ground up to be adopted
incrementally. The core library only focuses on the
visualization layer, making it easy to integrate with other
existing libraries or projects. On the other hand, Vue is also
perfectly capable of powering sophisticated single-page
applications when used in combination with modern tools
and support libraries.
::: Why Vue.js? :::
Vue.js is a popular framework for front-end web
development that is easy to learn and use. It offers a robust
framework for building complex applications, but is also
flexible enough to be used for simpler projects. Vue.js is
known for its simplicity and ease of use. It provides a clear
structure for organizing your code and comes with a variety
of useful features that make web development more
efficient and enjoyable.
::: Vue.js Components :::
Vue.js is based on a component system. A Vue component is
a Vue instance with predefined options. Components are
one of the most powerful features of Vue.js. They help you
extend basic HTML with custom HTML tags called
components. Vue.js components are reusable and can be
nested. They provide a way to create blocks of code that
can be used and reused in multiple places in your
application.
::: Vue.js Installation :::
There are several ways to get started with Vue.js. The
easiest way is to include the Vue.js library using the script
tag in your HTML file. You can also install Vue.js using npm,
a package manager for JavaScript. Additionally, Vue.js can
also be added to any project using the Vue CLI, a command-
line interface that allows you to configure and manage
Vue.js projects.
::: Vue CLI :::
Vue CLI is a command-line tool for scaffolding and managing
Vue.js projects. It provides a complete set of features for a
rapid development workflow, such as a development server
with hot reloading, linting, unit testing, and e2e testing. Vue
CLI is fully configurable without the need to eject. This
allows you to keep your build tools up to date and
configurable, while still having the option to fine-tune your
project configuration.
::: What can you do with Vue.js? :::
Vue.js is a powerful tool for building dynamic user
interfaces. You can use Vue.js to create complex web
applications that are efficient and easy to maintain. Vue.js is
also great for building single page applications (SPA).
Additionally, Vue.js can be used to add interactivity to
existing websites or to create reusable user interface
components.
::: Conclusion :::
Vue.js is a progressive JavaScript framework that is easy to
learn and use. It offers a variety of powerful features that
can help make web development more efficient and
enjoyable. With its component-based approach, Vue.js
provides a clear and organized way to structure your code.
If you are looking for a JavaScript framework that is flexible,
easy to use, and powerful, Vue.js is definitely an option to
consider.
Answer the question about the previous content:

Exercise 82: What is the


main feature of Vue.js that
makes it a popular choice
for web development?
( A ) - Vue.js is based on a system of components that are
reusable and can be nested.
( B ) - Vue.js can only be used to create complex web
applications.
( C ) - Vue.js does not support creating single page
applications (SPA).

Note: The correct answer is on the last page.


DIRECTIVES AND
COMPONENTS IN VUE.JS
Vue.js is a progressive JavaScript framework used to build
user interfaces. It is very popular among developers due to
its ease of use, flexibility, and efficiency. In Vue.js, directives
and components are two fundamental concepts that you
need to understand to become an efficient front-end
developer. In this chapter, we will delve deeper into
understanding directives and components in Vue.js.
::: Directives in Vue.js :::
Directives are special instructions embedded in DOM
elements to apply reactive behaviors. In other words,
directives are a way to apply special effects to DOM
elements when Vue model data changes. Directives in Vue.js
are prefixed with 'v-', indicating that they are special
attributes provided by Vue.
Some of the most commonly used directives in Vue.js
include v-if, v-else, v-show, v-bind, v-model, and v-on. For
example, the v-if directive is used to conditionally render a
block. The block will be rendered only if the directive
expression returns a true value.
::: Components in Vue.js :::
Components are reusable building blocks in Vue.js. They are
Vue instances with predefined options. Components allow
you to create your own custom tags with built-in
functionality. They are especially useful when you need to
reuse the same functionality in different parts of your
application.
Components in Vue.js are defined using Vue.component(),
followed by the component name and an options object.
This options object can contain various properties such as
data, methods, computed, watch, etc.
::: How to use Directives and Components in Vue.js :::
To use a directive in Vue.js, you need to add the prefix 'v-' to
the directive name and place it as an attribute on the DOM
element. For example, to use the v-if directive, you can do
the following:
____________________________________________
<div v-if="isVisible">
Hello, World!
</div>
____________________________________________
In this example, the div will only be rendered if the 'isVisible'
property is true.
To define a component in Vue.js, you need to call
Vue.component() with the component name and an options
object. For example, to define a component called 'my-
component', you can do the following:
____________________________________________
Vue.component('my-component', {
data: function() {
return {
message: 'Hello, World!'
}
},
template: '<p>{{ message }}</p>'
});
____________________________________________
In this example, we define a component called 'my-
component'. This component has a data property called
'message' and a template that renders the value of
'message'.
::: Conclusion :::
Directives and components are fundamental concepts in
Vue.js. Directives allow you to apply reactive behaviors to
DOM elements, while components allow you to create
reusable building blocks with built-in functionality.
Understanding these concepts is crucial to becoming an
efficient front-end developer with Vue.js.
Answer the question about the previous content:

Exercise 83: What are the


fundamental concepts in
Vue.js that are essential
to becoming an efficient
front-end developer?
( A ) - Directives and Components
( B ) - DOM Elements and Building Blocks
( C ) - Prefixes and Option Objects

Note: The correct answer is on the last page.


STATE MANAGEMENT
WITH VUEX
CHAPTER 34: STATE
MANAGEMENT WITH
VUEX
State management is an essential part of developing robust
and scalable single page applications (SPA). In Vue.js, the
Vuex library is used for this purpose. Vuex is a state
management library that follows the Flux pattern, which
was proposed by Facebook and is used in libraries such as
Redux (React) and Ngrx (Angular).
The central idea of ??the Flux pattern is that state is
unidirectional; this means that actions occur in one direction
and the state changes in response to those actions. This
makes state management predictable and easy to track.
To get started with Vuex, we need to install it in our Vue.js
project. This can be done using the npm or yarn package
manager.
____________________________________________

npm install vuex --save


or
yarn add vuex
____________________________________________
Once installed, we can create a Vuex store. The Vuex store
is the heart of state management with Vuex. It contains all
of the application's state and provides methods for changing
that state.
____________________________________________

import Vue from 'vue';


import Vuex from 'vuex';
Vue.use(Vuex);
const store = new Vuex.Store({
state: {
// your status here
},
mutations: {
// your mutations here
},
actions: {
// your actions here
},
getters: {
// your getters here
}
});
____________________________________________
There are four main parts to a Vuex store: state, mutations,
actions and getters.
State is where we store the state of our application. It's a
simple JavaScript object.
Mutations are functions that change the state. They are the
only way to change state in Vuex. Mutations take the
current state and a payload as arguments.
Actions are similar to mutations, but there are some
important differences. Actions can be asynchronous, while
mutations must be synchronous. Furthermore, actions do
not change state directly. Instead, they commit mutations
that alter the state.
Getters are functions that allow us to obtain parts of our
state. They are like computed properties for our state.
When using Vuex, we must always change the state by
committing mutations, not directly. This allows us to track all
state changes, making the state predictable and easy to
debug.
Also, with Vuex, we can divide our store into modules. Each
module can have its own state, mutations, actions and
getters. This allows us to manage state in a more modular
way and keep our Vuex store organized as our application
grows.
In summary, Vuex is a powerful state management library
for Vue.js that helps us manage the state of our applications
in a predictable and efficient way. With the right use of
Vuex, we can build robust and scalable single page
applications.
In the next chapter, we'll dive deeper into how to use Vuex
in a real Vue.js project, including how to work with state,
mutations, actions, getters, and modules.
Answer the question about the previous content:

Exercise 84: What is the


function of the Vuex
library in Vue.js?
( A ) - Vuex is a library for creating user interfaces.
( B ) - Vuex is a state management library that follows the
Flux pattern.
( C ) - Vuex is a library for handling HTTP requests.

Note: The correct answer is on the last page.


INTRODUCTION TO
ANGULAR.JS
Angular.js is an open-source web application framework,
maintained by Google, that helps in creating single-page
web applications. It is a library written in JavaScript that
extends the capabilities of HTML to declare dynamic
applications. Angular.js combines the principles of
declarative design, which makes code lighter and less
complex, and imperative programming, which is used to
create business components, resulting in a robust
framework for developing web applications.
Angular.js is based on HTML, CSS and JavaScript, which are
the three main technologies used to create web
applications. HTML is used to create the basic structure of a
web page, while CSS is used to style the web page.
JavaScript, on the other hand, is used to add interactivity to
the web page. Angular.js extends the functionality of HTML,
allowing you to create custom elements and attributes
known as directives.
The Angular.js framework is made up of several
components, including modules, controllers, services,
factories, providers, directives, filters, and more. Each of
these components plays a specific role in creating a web
application.
Modules are used to organize code into logical blocks. Each
module is a container for the different components of an
application. A module can contain controllers, services,
filters, directives, etc.
Controllers are used to control the flow of data in an
application. They are responsible for receiving user input,
processing it, and sending output. Controllers are defined
using the ng-controller directive.
Services are objects that are instantiated only once during
the lifecycle of an application. They can be used to perform
tasks that are common to multiple components of an
application.
Factories are used to create and configure services. They
are similar to services, but are more flexible and can be
used to create multiple services with different
configurations.
Providers are the most flexible way to create and configure
services. They can be used to configure services during the
configuration phase of an application.
Directives are used to extend HTML with new attributes and
elements. They are used to create reusable widgets and UI
components.
Filters are used to format the data that is displayed to the
user. They can be used in view binding expressions,
directives, templates, and services.
Angular.js also provides a number of advanced features
such as dependency injection, routing, promises,
animations, and more. Dependency injection is a design
pattern that allows one object to provide the dependencies
of another object. Routing is used to create single-page web
applications. Promises are used to handle asynchronous
operations. Animations are used to add visual effects to a
web application.
In summary, Angular.js is a powerful and flexible web
application framework that allows you to create single-page
web applications. It provides a series of advanced features
and components that make it easy to create rich, interactive
web applications.
Understanding Angular.js and its various features is
essential for any front-end developer. It provides the
foundation for creating complex and robust web
applications. Therefore, learning Angular.js is an important
step on the journey to becoming a proficient front-end
developer.
Answer the question about the previous content:

Exercise 85: What is the


main function of
controllers in the
Angular.js framework?
( A ) - They are used to style the web page.
( B ) - They are used to control the flow of data in an
application, being responsible for receiving user input,
processing it and sending output.
( C ) - They are used to add interactivity to the web page.

Note: The correct answer is on the last page.


COMPONENTS AND
SERVICES IN
ANGULAR.JS
Angular.js is a powerful and flexible JavaScript framework
that is used to create single-page web applications. One of
the main concepts in Angular.js are components and
services. Components are the backbone of any Angular.js
application, while services are used to organize and share
code across your application.
::: Components in Angular.js :::
A component in Angular.js is basically a building block of an
Angular.js application. Each component is a combination of
an HTML template and a TypeScript class that controls the
template logic. The template defines the structure and
layout of the user interface, while the TypeScript class
defines the behavior of the component.
A component is defined using the @Component annotation,
which is a function that receives a configuration object. This
configuration object can have several properties, including
'selector' which defines the name of the custom HTML tag
for the component, 'templateUrl' which defines the path to
the HTML file containing the component template, and
'styleUrls' which defines the path to the CSS files that
contain the component's styles.
Components are reusable and can be incorporated into
other components to form a component tree. Each
component has its own scope and can have its own state
data, which can be passed down to its child components or
up to its parent components through data binding.
::: Services in Angular.js :::
A service in Angular.js is a class with a specific purpose. It is
used to organize and share code that can be reused in
different parts of an Angular.js application. A service can be
anything from a simple utility function to a complex class
with business logic.
A service is defined using the @Injectable annotation, which
is a function that marks the class as available to be injected
as a dependency into other components or services.
Dependency injection is a design pattern that allows a class
to receive the dependencies it needs from an external
source, rather than creating those dependencies itself. This
makes the code more modular, more testable, and easier to
maintain.
Services can be injected into components or other services
through the class constructor. Angular.js takes care of
creating and managing service instances, ensuring that
there is only a single instance of each service in the entire
application.
::: Conclusion :::
Components and services are two fundamental concepts in
Angular.js that allow you to create robust and scalable web
applications. Components provide the user interface
structure and behavior, while services provide the business
logic and code reuse functionality. By understanding and
properly utilizing these concepts, you can become a more
effective and efficient front-end developer.
Answer the question about the previous content:

Exercise 86: What defines


a component in Angular.js?
( A ) - It's a simple utility function that organizes and shares
code.
( B ) - It is a combination of an HTML template and a
TypeScript class that controls the template logic.
( C ) - It is a class that marks the class as available to be
injected as a dependency into other components or
services.

Note: The correct answer is on the last page.


FORMS AND DATA
VALIDATION WITH
ANGULAR.JS
Angular.js is a powerful JavaScript framework that is often
used to create dynamic and interactive web applications.
One of the most useful features of Angular.js is its ability to
handle forms and data validation. In chapter 37 of our e-
book, we will cover in depth how to create forms with
Angular.js and how to validate the data entered into these
forms.
Forms are an essential part of any web application. They
allow users to enter information that can be used to interact
with the application. With Angular.js, you can create
complex forms with multiple inputs, buttons, and other
elements. Additionally, Angular.js makes it easy to validate
data entered into forms.
To start working with forms in Angular.js, you first need to
create a module and a controller. The module is the
container for different parts of your application, while the
controller is where you define the behavior of your
application.
____________________________________________

var app = angular.module('myApp', []);


app.controller('formCtrl', function($scope) {
$scope.user = {name: '', email: ''};
});
____________________________________________
After creating the module and controller, you can start
creating the form. To do this, you need to use the ng-model
directive to bind the form data to the model.
____________________________________________

<form ng-controller="formCtrl">
<label>Name:</label>
<input type="text" ng-model="user.name">
<label>Email:</label>
<input type="email" ng-model="user.email">
<button>Submit</button>
</form>
____________________________________________
Data validation is a crucial part of working with forms.
Angular.js provides a series of built-in validators that you
can use to ensure that data entered into a form meets
certain criteria. For example, you can use the required
validator to ensure that a form field is populated, or the
email validator to ensure that a form field contains a valid
email address.
____________________________________________

<form ng-controller="formCtrl">
<label>Name:</label>
<input type="text" ng-model="user.name" required>
<label>Email:</label>
<input type="email" ng-model="user.email" required>
<button>Submit</button>
</form>
____________________________________________
In addition to the built-in validators, Angular.js also allows
you to create your own custom validators. This can be
useful if you need to validate data in a way that is not
covered by the built-in validators.
To create a custom validator, you need to use the ng-
directive directive. This directive allows you to create a
function that will run whenever the value of a form field
changes. If the function returns true, the form field value is
considered valid. If the function returns false, the form field
value is considered invalid.
____________________________________________

app.directive('customValidator', function() {
return {
require: 'ngModel',
link: function(scope, element, attrs, ngModel) {
ngModel.$validators.customValidator = function(value)
{
// Your validation code goes here
};
}
};
});
____________________________________________
In summary, Angular.js is a powerful tool for working with
forms and validating data. With its wide range of built-in
validators and the ability to create your own custom
validators, Angular.js makes creating and validating forms a
simple and straightforward task.
This chapter provided an overview of how to work with
forms and validate data with Angular.js. In the next
chapters, we will delve deeper into the details and explore
some of the more advanced features of Angular.js.
We hope you found this chapter informative and helpful.
Read on to learn more about how to become an effective
front-end developer with the help of our comprehensive
eBook on HTML, CSS, and Javascript.
Answer the question about the previous content:

Exercise 87: Which of the


following statements is
true about creating and
validating forms with
Angular.js?
( A ) - Angular.js does not allow the creation of custom
validators, only the use of built-in validators.
( B ) - The ng-directive directive is used to bind the form
data to the model.
( C ) - Angular.js provides a number of built-in validators and
also allows the creation of custom validators.

Note: The correct answer is on the last page.


GOOD CODING AND
PROJECT
ORGANIZATION
PRACTICES
On the journey to becoming a Front End developer, one of
the most important aspects to consider is the adoption of
good coding and project organization practices. This will not
only make your work more efficient and effective, but it will
also help ensure that your code is high quality and easy to
maintain. Here are 38 best practices you should consider.
::: 1. Comment your code :::
Comments are crucial to understanding what a given block
of code is doing. They are especially useful when you return
to a project after a long period of time or when someone
else is reviewing your code.
::: 2. Name variables and functions clearly :::
Variable and function names must be descriptive and
meaningful. This makes the code more readable and easier
to understand.
::: 3. Use indentation :::
Indentation helps improve code readability, making it more
organized and structured. This is especially useful in
languages ??like HTML and CSS where code structure is
important.
::: 4. Keep the code DRY (Don't Repeat Yourself) :::
Avoid unnecessary code duplication. If you find yourself
writing the same code multiple times, consider creating a
function or method to encapsulate that functionality.
::: 5. Embrace modularity :::
Divide your code into smaller, reusable modules. This makes
the code easier to manage and test.
::: 6. Follow coding conventions :::
Each programming language has its own coding
conventions. Following these conventions helps maintain
code consistency and quality.
::: 7. Use version control :::
Version control is essential for any development project. It
allows you to track code changes over time and makes it
easier to collaborate with other developers.
::: 8. Test your code :::
Testing your code is a fundamental practice to ensure it
works as expected. There are several testing techniques you
can use, including unit testing, integration testing, and user
acceptance testing.
::: 9. Refactor your code :::
Refactoring is the process of changing existing code to
improve it, without changing its external behavior. This may
include removing duplicate code, simplifying complex
conditions, and improving code readability.
::: 10. Use linting tools :::
Linting tools help identify and fix coding issues such as
syntax errors, incorrect variable usage, and code style
issues.
::: 11. Stay up to date :::
Development technologies and practices are always
changing. Stay up to date with the latest trends and best
practices to ensure your code is efficient and relevant.
::: 12. Practice code review :::
Code review is a great way to improve code quality and
learn from other developers. It allows you to identify and fix
problems before they become bigger problems.
::: 13. Learn and use design patterns :::
Design patterns are proven solutions to common coding
problems. Learning and using these patterns can help
improve the quality and efficiency of your code.
::: 14. Write readable code :::
Readable code is easier to maintain and debug. This
includes using descriptive variable and function names,
maintaining a clear code structure, and adhering to coding
conventions.
::: 15. Use an integrated development environment (IDE) :::
An IDE can help increase productivity by providing features
such as syntax highlighting, auto-completion, and
integrated debugging.
::: 16. Learn to debug :::
Debugging is an essential skill for any developer. This
involves identifying and fixing errors or bugs in the code.
::: 17. Use the documentation :::
Documentation is a vital part of any development project. It
provides an overview of the project, explains how the code
works, and provides instructions for future developers.
::: 18. Learn how to use the console :::
The console is a powerful tool for debugging and testing
code. It allows you to see error messages, run code, and
inspect the state of your application.
::: 19. Use version control :::
Version control is an essential practice for any development
project. It allows you to track code changes, roll back to
previous versions, and collaborate with other developers.
::: 20. Practice pair programming :::
Pair programming is a development technique in which two
developers work together on a single computer. This can
help improve code quality and development
speed.involvement.
::: 21. Use a build system :::
A build system automates common development tasks such
as compiling, testing, and deploying. This can help increase
productivity and project consistency.
::: 22. Use a linter :::
A linter is a tool that checks source code for programming
errors, bugs, style errors, and suspicious constructs. This
can help improve code quality and prevent bugs.
::: 23. Use a CSS preprocessor :::
A CSS preprocessor allows you to write more efficient and
maintainable CSS by allowing the use of variables,
functions, and mixins.
::: 24. Use a JavaScript transpiler :::
A JavaScript transpiler allows you to use the latest
JavaScript features, even in browsers that don't support
them natively. This can help improve the efficiency and
compatibility of your code.
::: 25. Use a package manager :::
A package manager allows you to manage your project's
dependencies efficiently. This can help ensure that your
project has the latest and most secure versions of all its
dependencies.
::: 26. Practice continuous integration :::
Continuous integration is a development practice where
developers integrate their code into a shared repository
multiple times a day. This can help detect and fix problems
earlier and improve code quality.
::: 27. Use a local development server :::
A local development server allows you to test your code in
an environment that mimics the production environment.
This can help detect and fix issues before they impact end
users.
::: 28. Use a framework :::
A framework provides a structure and set of conventions for
developing applications. This can help speed up
development and improve code quality.
::: 29. Use a database management system :::
A database management system allows you to manage and
manipulate data efficiently. This can help improve the
performance and scalability of your application.
::: 30. Learn and use a query language :::
A query language allows you to retrieve and manipulate
data from a database. This can help improve the efficiency
and flexibility of your application.
::: 31. Use a testing library :::
A testing library provides a set of tools for testing code. This
can help ensure your code works as expected and prevent
bugs.
::: 32. Use a content management system :::
A content management system allows you to manage your
website content efficiently. This can help improve your site's
usability and scalability.
::: 33. Use an automation server :::
An automation server allows you to automate common
development tasks such as compilation, testing, and
deployment. This can help increase productivity and project
consistency.
::: 34. Use a bug tracking system :::
A bug tracking system allows you to track and manage bugs
efficiently. This can help improve code quality and user
satisfaction.
::: 35. Use a project management system :::
A project management system allows you to manage your
project efficiently. This can help ensure the project is
completed on time and within budget.
::: 36. Use a quality control system :::
A quality control system allows you to guarantee the quality
of your code. This can help prevent bugs and improve user
satisfaction.
::: 37. Use a monitoring system :::
A monitoring system allows you to monitor the performance
and health of your application. This can help detect and fix
issues before they impact end users.
::: 38. Keep learning :::
Software development is a constantly evolving field. Keep
learning and adapting to stay up to date with the latest
trends and best practices.
In summary, adopting good coding and project organization
practices is essential to becoming an effective Front End
developer. By following these practices, you can improve
the quality of your code, increase your productivity, and
become a more valuable developer.
Answer the question about the previous content:

Exercise 88: Which of the


following is a good
practice to become a more
effective Front End
developer?
( A ) - Ignore project documentation
( B ) - Avoid using a version control system
( C ) - Comment your code
( D ) - Repeating the same code multiple times

Note: The correct answer is on the last page.


CODE VERSIONING
WITH GIT
::: Chapter 39: Code versioning with Git :::
Code versioning is an essential part of modern software
development, especially when working in teams. It allows
developers to track changes made to a project over time,
facilitating collaboration and conflict resolution. Git is one of
the most popular and widely used code versioning tools,
and is an essential skill for any front-end developer.
::: Introduction to Git :::
Git is a distributed version control system, which means that
each developer has a complete copy of the code history on
their local computer. This makes Git extremely fast and
flexible, as operations are not dependent on a network
connection. Git is also very powerful, with support for
branching and merging code, which allows developers to
work on different features or bug fixes simultaneously.
::: Installing Git :::
Before you can start using Git, you need to install it on your
computer. The installation process varies depending on the
operating system you are using. For most Unix systems,
including Linux and macOS, Git can be installed through the
native package manager. On Windows, you can download
and install Git from the official website.
::: Configuring Git :::
After installing Git, there are some settings you need to
adjust. First, you must define your name and email address,
as this information will be used in all your confirmations. You
can do this with the following commands:
____________________________________________

git config --global user.name "Your Name"


git config --global user.email "youremail@example.com"
____________________________________________
::: Git basics :::
Git has three main areas: the working directory, the index,
and the Git repository. The working directory is where you
make your code changes. The index is a staging area where
you can add your changes before committing them to the
Git repository, which is where Git stores the version history
of your code.
::: Basic Git commands :::
Here are some of the basic Git commands you'll use
regularly:

---git init: This command creates a new Git repository in


your current directory.
---git add: This command adds files to the index. For
example, "git add ." will add all modified files in the current
directory to the index.
---git commit: This command commits index changes to the
Git repository. For example, "git commit -m 'commit
message'" will commit with the given message.
---git status: This command shows the status of your
working directory and index.
---git log: This command shows the commit history of the Git
repository.
::: Git Branching and Merging :::
Git allows you to branch your code so you can work on
different features or bug fixes simultaneously. When you're
done, you can merge your branches back into the main
branch. Here are some useful commands for branching and
merging:

---git branch: This command lists all the branches in your Git
repository. If you add a branch name, for example "git
branch feature1", it will create a new branch with that
name.
---git checkout: This command switches to a different
branch. For example, "git checkout feature1" will switch to
the "feature1" branch.
---git merge: This command merges one branch into
another. For example, if you are on the main branch and you
run "git merge feature1", it will merge the "feature1" branch
into the main branch.

In summary, Git is a powerful and essential tool for code


version control. It allows you to track changes, collaborate
with others, and keep your code organized. Understanding
and using Git is a crucial skill for any front-end developer.
Answer the question about the previous content:

Exercise 89: What are the


three main areas of Git?
( A ) - Working directory, index, and Git repository.
( B ) - Working directory, index and Git command.
( C ) - Working directory, Git command, and Git repository.

Note: The correct answer is on the last page.


DEPLOYMENT OF FRONT
END APPLICATIONS
CHAPTER 40: FRONT
END APPLICATION
DEPLOYMENT
One of the most important parts of the web application
development process is deployment. Deployment is the
process by which an application is placed in a production
environment for use by end users. This chapter will explore
the concepts and techniques involved in deploying Front
End applications using HTML, CSS and Javascript.
::: What is Deploy? :::
Deploy is the term used to describe the process of
transferring a web application from the development
environment to the production environment. This process
involves several steps, including compiling the code,
configuring the server, and transferring the files to the
production server. Once the application is on the production
server, it can be accessed by end users over the internet.
::: Why is Deploy Important? :::
Deployment is a crucial step in the lifecycle of a web
application. It is the point at which the application is finally
made available to users. Without an efficient deployment
process, the application may face various problems, such as
downtime, errors, and performance issues. Furthermore, an
inefficient deployment process can lead to delays in
application delivery, which can negatively affect customer
satisfaction.
::: How to Deploy a Front End Application? :::
The process of deploying a Front End application may vary
depending on the technology and platform used. However,
there are some common steps that are generally followed.
::: 1. Code Compilation :::
The first step in the deployment process is compiling the
code. This is the process of transforming the source code
into a format that can be executed by the server. In the case
of a Front End application, this may involve minifying HTML,
CSS and Javascript code to reduce file sizes and improve
application performance.
::: 2. Server Configuration :::
The next step is server configuration. This involves
configuring the production environment to support the
application. This may include installing any necessary
software, configuring databases, and configuring any other
infrastructure required for the application.
::: 3. File Transfer :::
Once the server is configured, application files can be
transferred to the production server. This is typically done
through a file upload process, although it can also be done
through a file sync process.
::: 4. Tests :::
After transferring the files, it is important to carry out tests
to ensure that the application is working correctly. This may
include functionality testing, performance testing, and
security testing.
::: 5. Monitoring :::
Finally, after deploying the application, it is important to
monitor the application to ensure that it continues to
function correctly. This may involve monitoring application
performance, checking for errors, and monitoring users' use
of the application.
::: Conclusion :::
In summary, deployment is a crucial part of Front End
application development. It allows the application to be
made available to end users and ensures that the
application is working correctly. By understanding the
deployment process and the techniques involved, you can
ensure that your Front End applications are deployed
effectively and efficiently.
We hope this chapter has provided a clear overview of what
Front End application deployment is and how it is carried
out. In the next chapter, we will explore more about best
practices and tools that can be used to facilitate and
optimize the deployment process.
Answer the question about the previous content:

Exercise 90: What is the


deployment process in
Front End applications?
( A ) - It is the process of creating a new application using
HTML, CSS and Javascript.
( B ) - It is the process of transferring a web application from
the development environment to the production
environment, involving several steps such as code
compilation, server configuration and file transfer.
( C ) - It is the process of testing the application to ensure
that it is working correctly.

Note: The correct answer is on the last page.


UNIT AND INTEGRATION
TESTS IN JAVASCRIPT
Unit and integration testing are crucial parts of the software
development process. They ensure that the code works as
expected and that new changes do not break existing
functionality. In this chapter, we'll explore how to write and
run unit and integration tests in JavaScript, a programming
language that is a fundamental part of front-end
development.
Unit tests are tests that verify the functionality of a single
unit of code, such as a function or a method. They are
isolated from the rest of the system and only test the unit of
code under test. For example, if you have a function that
adds two numbers, a unit test for that function can verify
that the function returns the correct sum of the numbers.
Integration tests verify the functionality of several code
units working together. They test the interaction between
different parts of the system to ensure they work correctly
together. For example, if you have a system that includes a
user interface, a server, and a database, an integration test
can verify that a user action in the interface results in the
correct change to the database.
In JavaScript, there are several libraries and frameworks
that can be used to write and run unit and integration tests.
Some of the most popular include Jest, Mocha, Jasmine and
Karma. These tools provide an easy-to-use syntax for writing
tests and also include features like mocking, which allow
you to isolate the unit of code under test.
Let's use Jest as an example to demonstrate how to write a
unit test in JavaScript. Suppose we have the following
function:
____________________________________________
function sum(a, b) {
return a + b;
}
____________________________________________
We can write a unit test for this function as follows:
____________________________________________
test('sum 1 + 2 to equal 3', () => {
expect(sum(1, 2)).toBe(3);
});
____________________________________________
The above test verifies that the sum function returns the
correct value when 1 and 2 are passed as arguments. If the
function returns 3, the test passes. If not, the test will fail.
For integration testing, we can use the same Jest library, but
we need to ensure that we are testing the interaction
between different parts of the system. For example, we
might have a test that checks whether a user action results
in the correct call to an API:
____________________________________________
test('user action results in correct API call', async () => {
// Simulate the API
axios.get.mockResolvedValue({ data: { result: 'success' }
});
// Performs user action
await usuario.realizaAcao();
// Checks if the API was called correctly
expect(axios.get).toHaveBeenCalledWith('/api/acao');
});
____________________________________________
This test simulates the API using the axios-mock-adapter
library, performs a user action, and then verifies that the API
was called correctly. If the API was called with the correct
URL, the test will pass. If not, the test will fail.
In summary, unit and integration tests are valuable tools for
ensuring the quality of JavaScript code. They allow
developers to verify the functionality of code and ensure
that changes do not break existing functionality. With
libraries and frameworks like Jest, Mocha, Jasmine, and
Karma, it's easy to write and run these tests in JavaScript.
Answer the question about the previous content:

Exercise 91: What is the


difference between unit
and integration testing in
JavaScript?
( A ) - Unit tests verify the functionality of multiple units of
code working together, while integration tests verify the
functionality of a single unit of code.
( B ) - Unit and integration tests are the same thing and both
check the functionality of a single unit of code.
( C ) - Unit tests verify the functionality of a single unit of
code, while integration tests verify the functionality of
multiple units of code working together.

Note: The correct answer is on the last page.


SEO AND WEB
ACCESSIBILITY
When talking about web development, two areas that are
extremely important and often underestimated are SEO
(Search Engine Optimization) and web accessibility. Both
areas are key to ensuring that your website not only reaches
the widest possible audience, but also provides a high-
quality user experience for all visitors.
SEO is a practice of optimizing websites for search engines
like Google. The idea is to make your website more visible in
search results, which can lead to an increase in traffic to
your website. Search engine optimization involves a number
of techniques and strategies, including utilizing relevant
keywords in your content, optimizing meta tags, creating
high-quality content, and obtaining high-quality links to your
website. website.
On the other hand, web accessibility refers to the practice of
making websites and web applications accessible to all
users, including those with disabilities. This involves
ensuring that your website is easily navigable for people
using screen readers or other assistive technologies, that
your content is easily understandable for people with
cognitive disabilities, and that your website is usable for
people with physical disabilities.
So how do HTML, CSS and JavaScript fit into this? Well, all of
these technologies play a key role in both search engine
optimization and web accessibility.
When it comes to SEO, HTML is used to structure your
website's content in a way that search engines can easily
understand and index. This includes using HTML elements
like headings (h1, h2, etc.) to highlight important sections of
your content, using meta tags to provide information about
your site to search engines, and using alt attributes on
images to provide textual descriptions of them.
CSS, in turn, is used to style your content in a way that is
attractive and easy to read for users. However, it's
important to remember that search engines don't "see" your
website the same way human users do. Therefore, it's
important to ensure that your content still makes sense
without CSS. This can be done through the use of responsive
and progressive design techniques, which ensure your
content is easily accessible on a variety of devices and
screen sizes.
Finally, JavaScript is used to add interactive functionality to
your website. However, it is important to remember that not
all users will have JavaScript enabled in their browsers, and
not all assistive technologies support JavaScript. Therefore,
it is important to ensure that your site is still usable without
JavaScript, or to provide alternatives for users who cannot or
do not want to use JavaScript.
When it comes to web accessibility, HTML, CSS and
JavaScript also play important roles. HTML is used to
structure content in a way that is easily understandable for
assistive technologies. This includes using semantic HTML
elements such as article, section, and nav to indicate the
structure and purpose of your content, and using ARIA
attributes to provide additional information about the state
and behavior of your interactive elements.</ p>
CSS is used to style your content in a way that is easy to
read and navigate. This includes using contrasting colors to
ensure your content is easily visible to people with visual
impairments, and using readable font sizes to ensure your
content is easily readable to people with reading disabilities.
Finally, JavaScript is used to add interactive functionality
that is accessible to assistive technologies. This includes
using keyboard events to ensure that your interactive
elements can be operated by users who cannot use a
mouse, and using hover techniques to ensure that users can
easily navigate your site using just the keyboard.< /p>
In summary, HTML, CSS and JavaScript are essential tools
for search engine optimization and web accessibility. By
understanding how these technologies can be used to
improve the visibility and usability of your website, you will
be taking an important step towards becoming a more
effective and inclusive front-end developer.
Answer the question about the previous content:

Exercise 92: What are the


roles of HTML, CSS, and
JavaScript in search
engine optimization (SEO)
and web accessibility?
( A ) - HTML is used to add interactive functionality, CSS to
structure the content, and JavaScript to style the content.
( B ) - HTML is used to structure the content, CSS to style
the content, and JavaScript to add interactive functionality.
( C ) - HTML, CSS, and JavaScript have no role in search
engine optimization and web accessibility.

Note: The correct answer is on the last page.


WEBSITE
PERFORMANCE AND
OPTIMIZATION
::: Chapter 43: Website Performance and Optimization :::
In today's digital era, website performance and optimization
have become crucial factors in the user experience and
overall effectiveness of a website. Regardless of how
visually appealing or packed with interesting content a
website is, if it isn't optimized for performance, users are
likely to become frustrated and leave.
::: What is website performance? :::
Website performance refers to the speed at which a
website's pages load in a user's browser. This includes the
time it takes for the first byte of data to be received by the
browser (TTFB), as well as the total page load time. Website
performance can be affected by a variety of factors,
including code quality, media file size, server speed, and
user connection bandwidth.
::: What is website optimization? :::
Website optimization is the process of making adjustments
and improvements to your website to improve its
performance and efficiency. This may include reducing
image file sizes, minifying CSS and Javascript code, utilizing
browser caching, and improving server speed. Website
optimization not only improves performance, but can also
improve your website's ranking in search engines, as
website speed is one of the factors that search algorithms
take into account.
::: Why is website performance and optimization important?
:::
Website performance and optimization are important for
several reasons. First, a slow-loading website can frustrate
users and cause them to abandon your site. This can result
in lost traffic and potentially lost sales for eCommerce sites.
Second, website performance is a ranking factor for search
engines. A slow loading website can be penalized by search
engines and rank lower in search results. Third, an
optimized website can improve the user experience by
making the website faster and more enjoyable to use.
::: How to optimize website performance? :::
There are several strategies that can be used to optimize
website performance. Here are some of the most effective:
::: Minimize code :::
HTML, CSS and Javascript code can be minified to reduce
their size and improve loading speed. This involves
removing whitespace, comments, and other unnecessary
elements from the code.
::: Optimize images :::
Images can be one of the biggest contributors to a website's
loading time. Images must be optimized to reduce their size
without sacrificing quality. This can be done by using image
compression tools and choosing the appropriate image
format.
::: Use browser cache :::
Browser caching allows website visitors to store copies of
website files on their computer. This means that when they
visit the site again, the browser can load the site from the
cache instead of downloading all the files again.
::: Improve server speed :::
Server speed can be improved through various techniques,
such as using a dedicated server, optimizing the database,
and implementing a Content Delivery Network (CDN).
In short, website performance and optimization are essential
aspects of web development. A fast-loading, optimized
website not only improves user experience, but can also
improve your website's visibility in search engines and
increase your website's overall effectiveness.
Answer the question about the previous content:

Exercise 93: What is


website optimization and
why is it important?
( A ) - Website optimization is the process of making
adjustments to your website to make it more visually
appealing. It is important because it makes the website
more pleasing to the eyes of users.
( B ) - Website optimization is the process of adding more
content to your website. It's important because sites with
more content tend to rank higher in search engines.
( C ) - Website optimization is the process of making
adjustments and improvements to your website to improve
its performance and efficiency. It is important because it not
only improves website performance, but can also improve
website ranking in search engines and user experience.

Note: The correct answer is on the last page.


BROWSER
DEVELOPMENT TOOLS
Browser development tools, also known as DevTools, are a
set of programming tools that allow developers to test and
debug their website code. These tools are built into most
modern web browsers such as Google Chrome, Firefox,
Safari, and Edge. In the HTML, CSS and JavaScript course to
become a front-end developer, it is essential to have a solid
knowledge of these tools.
DevTools offer a variety of features that help developers
analyze DOM structure, inspect CSS styles, monitor network
performance, debug JavaScript, and more. Let's explore
some of these tools in detail.
::: Element Inspector :::
The Element Inspector is one of the most used tools in
DevTools. It allows developers to inspect a web page's HTML
elements and see how CSS styles are affecting those
elements. You can select any element on the page and see
its corresponding HTML and CSS code. This is extremely
useful for debugging and testing CSS styles.
::: Console :::
The console is another important tool in DevTools. It is
mainly used for JavaScript debugging. The console displays
error messages, warnings, and other diagnostic logs. You
can also use the console to run JavaScript code in real time.
::: Network :::
The Network tab in DevTools allows you to monitor all
network requests made by the web page. This includes
requests for CSS files, JavaScript, images, and more. You can
see the time each request takes to complete and the status
of the response. This is useful for performance optimization
and debugging network issues.
::: Sources :::
The Sources tab allows you to see all the files that make up
the web page. This includes HTML, CSS, JavaScript, and
media files. You can browse these files and edit the code
directly in DevTools. This is useful for making quick changes
and testing new code.
::: Performance :::
The Performance tab allows you to record page activity and
analyze performance. This includes rendering time,
JavaScript usage, and other factors that can affect page
speed. This is useful for finding performance bottlenecks
and optimizing your code.
::: Audits :::
The Audits tab, available in some versions of DevTools,
allows you to run a series of automated tests on your web
page. These tests can help identify issues with accessibility,
performance, best practices, and SEO. This is useful for
ensuring your page is optimized and accessible for all users.
In short, browser development tools are an indispensable
resource for any front-end developer. They offer a variety of
features that make it easier to debug and test your code,
helping you create more efficient and effective websites.
However, like any tool, they require practice to use
effectively. Therefore, it's important to spend some time
learning how to use each tool and experiment with them on
your own projects.
In our HTML, CSS and JavaScript course to become a front-
end developer, we cover all of these tools in detail. We
provide practical examples and exercises to help you
become familiar with the DevTools and use them in your
own work. Whether you are a complete beginner or an
experienced developer, we believe our course can help you
improve your skills and become a more effective front-end
developer.
Answer the question about the previous content:

Exercise 94: Which of the


following statements is
true about browser
development tools, also
known as DevTools?
( A ) - DevTools are only available in the Google Chrome
browser.
( B ) - DevTools do not allow debugging and testing code.
( C ) - Knowledge of DevTools is essential to become a front-
end developer.

Note: The correct answer is on the last page.


WORKING WITH APIS
AND JSON DATA
Working with APIs and JSON data is a fundamental part of
front-end development, especially when developing
interactive and dynamic web applications. Before going into
details, let's understand what APIs and JSON are.
::: What are APIs? :::
API is the acronym for Application Programming Interface,
which is basically a set of rules and protocols for building
software applications. An API defines how software
components should interact with each other. In web
development terms, an API is an interface that allows
communication between a client (typically a web browser)
and a server.
::: What is JSON? :::
JSON, or JavaScript Object Notation, is a lightweight data
format that is easy for humans to read and write and easy
for machines to parse and generate. It is a text format that
is completely language-independent, but uses conventions
that are familiar to JavaScript programmers.
::: Working with APIs :::
To work with APIs, you first need to understand the concept
of HTTP requests. An HTTP request is basically a message
that is sent by a client to a server to perform a certain
action. Actions can include retrieving, adding, updating, or
deleting data.
HTTP requests are made using methods, the most common
are GET (to retrieve data), POST (to send data), PUT (to
update data) and DELETE (to delete data).
In JavaScript, you can use the XMLHttpRequest object to
make HTTP requests. However, the more modern and easier
way to make HTTP requests is using the Fetch API, which
provides a more powerful and flexible interface.
::: Working with JSON data :::
When you make a request to an API, the response usually
comes in JSON format. JSON is a data format that is easy to
read and write and is used to transmit data between a
server and a client.
In JavaScript, you can use the JSON.parse() method to
convert a JSON string to a JavaScript object. Similarly, you
can use the JSON.stringify() method to convert a JavaScript
object to a JSON string.
::: Example of how to work with APIs and JSON data :::
Suppose you want to get data from a weather forecast API.
First, you would make a GET request to the API URL using
the Fetch API. The API would then respond with the weather
forecast data in JSON format.
____________________________________________
fetch('https://api.weatherapi.com/v1/current.json?
key=YOUR_API_KEY&q=London')
.then(response => response.json())
.then(data => console.log(data));
____________________________________________
In this example, the fetch() function makes a GET request to
the API. The then() function is used to handle the response
when the promise returned by fetch() is resolved. The
response is then converted into a JavaScript object using the
json() method. Finally, the data is logged to the console.
Working with APIs and JSON data is an essential skill for any
front-end developer. It's what allows you to create
interactive and dynamic web applications that can interact
with servers and databases.
Understanding how to work with APIs and JSON data is just
one part of becoming a front-end developer. You also need
to understand HTML, CSS, and JavaScript, as well as other
important technologies and tools. But with practice and
study, you can become a competent and confident front-end
developer.
Answer the question about the previous content:

Exercise 95: What is JSON


and what is its role in web
development?
( A ) - JSON is the acronym for JavaScript Object Notation, a
lightweight data format that is easy for humans to read and
write and easy for machines to parse and generate. It is
used to transmit data between a server and a client.
( B ) - JSON is an HTTP request method used to retrieve, add,
update, or delete data in an API.
( C ) - JSON is an API that defines how software components
should interact with each other.

Note: The correct answer is on the last page.


​INTRODUCTION TO
NODE.JS AND
EXPRESS.JS
::: Chapter 46: Introduction to Node.js and Express.js :::
In this chapter, we will delve into the world of back-end
development with Node.js and Express.js. These are two
powerful tools that every front-end developer should know
to become a full-stack developer.
::: What is Node.js? :::
Node.js is a JavaScript runtime environment built on Google
Chrome's V8 JavaScript engine. It allows developers to run
JavaScript on the server side instead of just in the browser.
This means you can use JavaScript to create web servers,
connect to databases, create RESTful APIs, and more.
Node.js is asynchronous and event-driven, which means it
can handle multiple requests simultaneously without
blocking code execution. This makes it a popular choice for
real-time web applications like chat and gaming.
::: What is Express.js? :::
Express.js is a minimalist web framework for Node.js. It
provides a robust set of features for developing RESTful web
applications and APIs. Express.js simplifies the process of
creating web servers in Node.js by providing a high-level
interface for handling routes, requests, responses, and
middleware.
With Express.js, you can create complete web applications
with dynamic routes, error handling, cookie and session
support, database integration, and much more. All this with
just a few lines of code.
::: Installing Node.js and Express.js :::
To start using Node.js and Express.js, you need to install
them on your computer. First, you need to download and
install Node.js, which comes with the npm package
manager. You can download it from the official Node.js
website.
After installing Node.js, you can install Express.js using npm.
Open the terminal and type the following command:
____________________________________________

npm install express


____________________________________________
This will install Express.js in your project and you will be
ready to start developing your web application.
::: Creating a simple web server with Node.js and Express.js
:::
Let's create a simple web server with Node.js and
Express.js. First, create a new file called app.js in your
project. Then add the following code:
____________________________________________

const express = require('express');


const app = express();
const port = 3000;
app.get('/', (req, res) => {
res.send('Hello world!');
});
app.listen(port, () => {
console.log(`Server running at http://localhost:${port}`);
});
____________________________________________
This is a basic web server that responds with "Hello world!"
when you access the root of the site. To start the server,
open the terminal and type the following command:
____________________________________________

node app.js
____________________________________________
Then open your browser and go to http://localhost:3000. You
will see the message "Hello world!".
::: Conclusion :::
Node.js and Express.js are powerful tools for back-end
development. They allow you to use JavaScript on the server
side, creating complete web applications with dynamic
routes, error handling, cookie and session support, database
integration, and more.
By understanding and practicing these tools, you will be one
step closer to becoming a full-stack developer. In the next
chapter, we will explore more about working with databases
in Node.js and Express.js.
Answer the question about the previous content:

Exercise 96: What is


Node.js and what is its
function?
( A ) - Node.js is a minimalist web framework that simplifies
the process of creating web servers.
( B ) - Node.js is a JavaScript runtime environment built on
top of Google Chrome's V8 JavaScript engine that allows
developers to run JavaScript on the server side.
( C ) - Node.js is a package manager that comes bundled
with Express.js.

Note: The correct answer is on the last page.


WEBSOCKETS AND
REAL-TIME
COMMUNICATION
Websockets are an advanced real-time communication tool
that allows two-way interaction between a client (usually a
web browser) and a server. In simple terms, a websocket is
a communication channel that remains open, allowing data
to be sent and received without the need to open new
connections for each data transmission.
This is essential for real-time applications, where latency
and efficiency are of paramount importance. Examples of
such applications include online gaming, live chat, stock
trading systems and any other application that requires
instant updates.
The WebSocket API is built on top of the WebSocket
protocol, which is different from the HTTP protocol most
commonly used on the web. HTTP is a one-way protocol,
which means that a client can request data from a server,
but a server cannot send data to a client without being
requested. This makes HTTP unsuitable for real-time
applications where data needs to be sent in both directions
almost simultaneously.
The WebSocket protocol, on the other hand, is bidirectional.
This means that both the client and the server can send
data at any time without the need for additional requests.
This makes WebSocket ideal for real-time applications.
To establish a WebSocket connection, the client sends a
protocol update request to the server. If the server supports
WebSockets, it will return a positive response, and the
WebSocket connection will be established.
Once the connection is established, data can be sent in both
directions as "messages". WebSocket messages can be any
type of data, not just text, and there is no limit to the size of
a message. This makes WebSocket extremely flexible.
In addition, the WebSocket protocol supports "ping" and
"pong" frames, which are used to check whether the
connection is still active. This is useful for keeping the
connection open even when no data is being transmitted.
In terms of security, WebSocket supports both secure
(wss://) and insecure (ws://) connections. Secure
connections use the Transport Layer Security (TLS) protocol
to encrypt transmitted data, making it safe from
interception.
In summary, WebSockets are a powerful tool for creating
real-time applications. They enable efficient two-way
communication between client and server, support the
transmission of any type of data, and can be used securely
with TLS encryption.
As a front-end developer, it's important to understand how
WebSockets work and how they can be used to improve the
user experience. Whether you're building an online game, a
live chat system, or a stock trading system, WebSockets
could be the solution you need to provide real-time updates
to your users.
So when learning HTML, CSS and JavaScript, don't forget to
take some time to understand WebSockets. They are an
essential part of any modern front-end developer's toolkit.
Answer the question about the previous content:

Exercise 97: What is


WebSocket and why is it
important for real-time
applications?
( A ) - WebSocket is a unidirectional protocol that only allows
the client to request data from the server, making it
unsuitable for real-time applications.
( B ) - WebSocket is a bidirectional protocol that allows both
the client and server to send data at any time, making it
ideal for real-time applications.
( C ) - WebSocket is a data encryption tool that protects
information transmitted between the client and the server,
being essential for real-time applications.

Note: The correct answer is on the last page.


WORKING WITH NOSQL
DATABASES: MONGODB

Working with NoSQL databases: MongoDB

::: Working with NoSQL databases: MongoDB :::


In the world of web development, data storage and
manipulation are crucial to the success of a website or
application. There are many database management systems
available, but MongoDB stands out as one of the most
popular NoSQL databases.
::: What is NoSQL? :::
NoSQL (Not Only SQL) is a term that describes a variety
of database technologies that are useful for storing and
retrieving data in a way that allows high performance,
scalability, and flexibility. Unlike SQL databases, NoSQL
databases such as MongoDB do not use the relational table
model.
::: What is MongoDB? :::
MongoDB is a document-based NoSQL database. Unlike
SQL databases, which store data in tables and rows,
MongoDB stores data in flexible documents, similar to JSON,
which means you can store any type of data with any
number of fields.
::: Why use MongoDB? :::
---Data Flexibility: As mentioned earlier, MongoDB
allows for a flexible data structure. This is especially useful
in projects where requirements can change quickly.
---Scales horizontally: MongoDB is designed to scale
horizontally, meaning you can add more machines to
increase capacity as needed.
---Performance: MongoDB is known for its high
performance. It uses indexes to improve search speed and
can cache data in memory for fast access.

::: Working with MongoDB :::


Working with MongoDB is quite simple, especially if you
are already familiar with JSON and JavaScript. Here are some
basic operations you can perform:
::: Creating a database :::
To create a database in MongoDB, you use the "use"
command. If the database does not exist, MongoDB will
create it for you.
____________________________________________
use myDatabase____________________________________________
::: Inserting documents :::
To insert documents into a collection, you can use the
"insert" method.
____________________________________________
db.myCollection.insert({name: "John", age: 30, city: "New
York"})____________________________________________
::: Searching documents :::
To search for documents in a collection, you can use the
"find" method.
____________________________________________
db.myCollection.find({name:
"John"})____________________________________________
::: Conclusion :::
MongoDB is a powerful tool for managing data in web
applications. Its flexibility, scalability, and performance
make it an excellent choice for many projects. However, like
any technology, it is important to understand its strengths
and weaknesses and when it is appropriate to use it. We
hope this guide has given you a good introduction to
MongoDB and how to get started with it.
Answer the question about the previous content:

Exercise 98: What is


MongoDB and why is it
used?
( A ) - MongoDB is a SQL database that stores data in tables
and rows, it is used for its high performance and scalability.
( B ) - MongoDB is a document-based NoSQL database that
stores data in flexible documents, similar to JSON, it is used
for its data flexibility, horizontal scalability and high
performance.
( C ) - MongoDB is a term that describes a variety of
database technologies that are useful for storing and
retrieving data in a way that allows for high performance,
scalability, and flexibility.

Note: The correct answer is on the last page.


AUTHENTICATION AND
AUTHORIZATION WITH
JWT
Authentication and authorization are critical components of
any web application. When we talk about authentication, we
are referring to the process of verifying a user's identity,
while authorization is the process of verifying what an
authenticated user is allowed to do. In the modern era of
web development, one of the most popular methods for
handling authentication and authorization is JWT, or JSON
Web Token.
JWT is an open standard (RFC 7519) that defines a compact
and secure way to transmit information between parties as
a JSON object. This information can be verified and trusted
because it is digitally signed. JWTs can be signed using a
secret (with the HMAC algorithm) or a public/private key pair
using RSA or ECDSA.
::: How does JWT work? :::
A JWT is divided into three parts: header, payload and
signature. The header usually consists of two elements: the
token type, which is JWT, and the signature algorithm, such
as HMAC SHA256 or RSA. The payload contains the claims
or statements about the user and any additional information
you want to convey. The signature is what validates the
token and is created using the header, payload, a secret,
and the algorithm specified in the header.
When a user logs into your application, you create a JWT on
the server and return it to the client. The client then stores
this token in some way, usually in a cookie or localStorage.
Then, in each subsequent request the client makes to the
server, it includes this token. The server can then check the
token for validity, consider the user to be authenticated, and
process the request.
::: Why use JWT? :::
There are several advantages to using JWTs for
authentication and authorization. Firstly, they are stateless,
meaning they don't need to be stored on the server. This is
great for scalability because no matter which server serves
the request, as long as it has the secret key it can verify the
JWT. Secondly, they are compact, which makes them quick
to stream. Thirdly, they are secure as they are signed and
can be encrypted.
::: Implementation of JWT in HTML, CSS and Javascript :::
To implement JWT in an HTML, CSS, and Javascript
application, you will need a JWT library for the backend,
such as jsonwebtoken for Node.js, and a way to store and
stream the JWT on the frontend.
On the backend, when a user logs in, you will create a JWT
like this:
____________________________________________
var jwt = require('jsonwebtoken');
var token = jwt.sign({ userID: user.id }, 'your-secret-key');
____________________________________________
Where 'user.id' is the information you want to encode in the
token and 'your-secret-key' is the key you will use to sign
the token.
On the frontend, you will store the JWT in a cookie or
localStorage and include it in all requests to the server:
____________________________________________
localStorage.setItem('token', token);
axios.defaults.headers.common['Authorization'] = 'Bearer '
+ token;
____________________________________________
Then in the backend you will check the JWT on each request:
____________________________________________
var jwt = require('jsonwebtoken');
jwt.verify(token, 'your-secret-key', function(err, decoded) {
if (err) {
// token is invalid
} else {
// token is valid, proceed with the request
}
});
____________________________________________
So you can easily implement authentication and
authorization in your HTML, CSS and Javascript application
using JWT. This is a powerful and flexible method that has
become a standard in the web development industry.
::: Conclusion :::
JWT is a powerful tool for authentication and authorization in
web applications. It is stateless, compact and secure,
making it ideal for modern applications. With a solid
understanding of how JWTs work and how to implement
them in HTML, CSS, and Javascript, you'll be well equipped
to create secure, scalable web applications.
Answer the question about the previous content:

Exercise 99: What is JWT


and how does it work in
authentication and
authorization in web
applications?
( A ) - JWT is a closed standard that defines a compact and
secure way to transmit information between parties as a
JSON object. It works by creating a token on the server when
a user logs in and returning that token to the client. The
client then stores this token and includes it in each
subsequent request to the server.
( B ) - JWT is an open standard that defines a compact and
secure way to transmit information between parties as an
XML object. It works by creating a token on the server when
a user logs in and returning that token to the client. The
client then stores this token and includes it in each
subsequent request to the server.
( C ) - JWT is an open standard that defines a compact and
secure way to transmit information between parties as a
JSON object. It works by creating a token on the server when
a user logs in and returning that token to the client. The
client then stores this token and includes it in each
subsequent request to the server.

Note: The correct answer is on the last page.


WEB SECURITY: CORS,
CSRF, XSS

Web Security: CORS, CSRF, XSS

::: Web Security: CORS, CSRF, XSS :::


In today's digital age, web security has become a primary
concern for developers and users. With the growing
dependence on web applications for a variety of tasks, from
online shopping to banking transactions, web security is an
absolute necessity. In this chapter, we will discuss three
critical web security concepts: CORS (Cross-Origin Resource
Sharing), CSRF (Cross-Site Request Forgery), and XSS
(Cross-Site Scripting).
::: CORS (Cross-Origin Resource Sharing) :::
CORS is a technique that allows restricted resources on a
web page to be requested from a domain other than the
domain serving the page. In other words, CORS allows a
website to access resources from another website. This is
useful for sharing APIs and other web resources between
different sites.
However, CORS also presents security risks. If not
configured correctly, it can allow malicious websites to
access sensitive data. Therefore, it is crucial that developers
understand how to configure CORS correctly to ensure the
security of user data.
::: CSRF (Cross-Site Request Forgery) :::
CSRF is an attack that tricks a victim into sending a
malicious HTTP request to a website that trusts it. This may
result in unauthorized actions being taken in the victim's
name. For example, an attacker could trick a user into
submitting a request to change their password, which gives
the attacker access to the user's account.
To prevent CSRF attacks, developers can use a variety of
techniques, such as CSRF tokens, which are used to verify
the authenticity of requests. Another common technique is
the use of SameSite cookies, which restrict how cookies are
sent with cross-site requests.
::: XSS (Cross-Site Scripting) :::
XSS is a type of attack in which malicious scripts are
injected into trusted websites. These scripts can then be
executed in the user's browser, resulting in data theft,
website defacement, and other types of attacks.
There are three main types of XSS attacks: Stored XSS,
Reflected XSS and DOM-based XSS. Stored XSS occurs when
malicious script is permanently stored on the server and
sent to users. Reflected XSS occurs when script is included
in the URL and reflected by the server in the response.
DOM-based XSS occurs when malicious script manipulates
the Document Object Model (DOM) of a web page.
To prevent XSS attacks, developers must implement a strict
Content Security Policy (CSP), which limits the resources a
web page can access. Additionally, user input must always
be sanitized and output must be encoded to prevent the
execution of malicious scripts.
In short, web security is an essential part of front-end
development. By understanding and implementing effective
security measures, such as correctly configuring CORS,
preventing CSRF, and preventing XSS, developers can
create secure and reliable web applications.
Answer the question about the previous content:

Exercise 100: What are


the three critical web
security concepts
discussed in the text?
( A ) - SQL Injection, Phishing and Brute Force
( B ) - CORS, CSRF and XSS
( C ) - DDoS, Man-in-the-Middle and Spoofing

Note: The correct answer is on the last page.


INTRODUCTION TO
TYPESCRIPT
CHAPTER 51:
INTRODUCTION TO
TYPESCRIPT
::: Chapter 51: Introduction to TypeScript :::

TypeScript is an open source programming language


developed by Microsoft that is based on JavaScript, one of
the most used tools in web development. TypeScript adds
static typing and class-oriented objects to JavaScript, which
can improve productivity and code quality in large projects.

::: What is TypeScript? :::

TypeScript is a superset of JavaScript that brings new


features and advantages to the world's most popular
programming language. TypeScript is a superset because all
valid JavaScript programs are also TypeScript programs.
However, TypeScript has additional features that are not
present in JavaScript, such as static typing and object-
oriented classes.

Static typing means that the type of a variable is


known at compile time, which can prevent many common
errors in JavaScript. For example, in JavaScript you might
have a bug where you try to call a method on a number, but
in TypeScript this type of error would be detected before the
code is executed.

::: Why use TypeScript? :::

There are many reasons to use TypeScript. Here are


some of the most common:

---Bug prevention: Static typing can prevent a large


number of bugs that would be difficult to detect in
JavaScript. This can save you a lot of time and frustration.
---Productivity: Development tools for TypeScript are
generally better than for JavaScript. For example,
autocompletion in a TypeScript code editor can be much
more accurate and useful.
---Scalability: TypeScript is designed to make it easier
to build and maintain large code bases. This makes it a good
choice for large projects or teams.

::: How to get started with TypeScript? :::

To get started with TypeScript, you need to install the


TypeScript compiler. This can be done with Node.js and npm,
which are standard tools for modern web development.

Once you have the TypeScript compiler installed, you


can start writing TypeScript code. TypeScript code is very
similar to JavaScript, so if you already know JavaScript, you
should be able to start writing TypeScript code with little
effort.

::: Conclusion :::

TypeScript is a powerful tool that can improve the


quality and productivity of your code. It brings static typing
and object-oriented classes to JavaScript, which can prevent
bugs and make code easier to understand and maintain. If
you're working on a large project or on a team, TypeScript
can be an excellent choice.
Answer the question about the previous content:

Exercise 101: What is


TypeScript and what are
its advantages?
( A ) - TypeScript is a text editing tool developed by
Microsoft that makes writing code easier.
( B ) - TypeScript is an open-source programming language
developed by Microsoft that builds on JavaScript by adding
static typing and object-oriented classes, which can improve
productivity and code quality in large projects.
( C ) - TypeScript is a graphic design program developed by
Microsoft that allows you to create interactive user
interfaces.

Note: The correct answer is on the last page.


WEBPACK AND BUILD
TOOLS
Webpack is an extremely powerful and crucial build tool for
any front-end developer. It allows you to package your
JavaScript, CSS, and HTML files into "packages" that can be
easily loaded and delivered to a browser. In this chapter, we
will explore Webpack and other build tools in detail.
Webpack is a static module packaging tool for modern
JavaScript applications. When Webpack processes your
application, it internally builds a dependency graph that
maps each module your application needs and generates
one or more packages. It allows you to split your code into
multiple modules and ensures they are loaded in the correct
order.
Webpack is extremely configurable, but to get started you
only need to understand four main concepts: Input, Output,
Loaders and Plugins.
The input tells Webpack where to start building the
dependency graph. The output tells Webpack where to emit
the packages it creates and how to name those files.
Loaders allow Webpack to process other file types and
convert them into valid modules that can be consumed by
your application. For example, you can use loaders to tell
Webpack how to turn TypeScript or JSX files into JavaScript
that the browser can interpret.
Plugins are the backbone of Webpack. They can be used to
perform a wide range of tasks, such as code minification,
environment variable injection, package optimization, and
more.
In addition to Webpack, there are several other build tools
that you can use in your front-end development workflow.
Some of the most popular include Gulp, Grunt and Parcel.
Gulp is a task automation tool that uses a piping system to
automate common development tasks such as minification,
concatenation, caching, testing, and image optimization.
Gulp is easy to use and highly customizable, making it a
popular choice for many developers.
Grunt is another task automation tool that is similar to Gulp
in many ways. The main difference between Grunt and Gulp
is that Grunt uses file settings to define tasks while Gulp
uses code. This makes Grunt a little harder to learn for
beginners, but also more powerful and flexible for advanced
developers.
Parcel is a Webpack alternative that calls itself an "ultra-
fast, zero-configuration web application packager." Parcel
offers incredibly fast performance thanks to its multicore
architecture and intelligent caching system. It also supports
many modern features out of the box, such as support for
ES6 modules, hot module replacement, and asynchronous
code processing.
In short, Webpack and other build tools are essential
components of the modern front-end development workflow.
They allow you to organize and optimize your code
efficiently, ensuring that your application is fast, secure and
easy to maintain.
In the next section, we'll explore how to configure and use
Webpack in a real project. We'll also compare and contrast
Webpack with other build tools to help you choose the best
tool for your specific needs. Stay tuned!
Answer the question about the previous content:

Exercise 102: What is the


main role of Webpack in
front-end development?
( A ) - Webpack's main function is to automate common
development tasks such as minification, concatenation,
caching, testing, and image optimization.
( B ) - Webpack's main function is to allow you to package
your JavaScript, CSS, and HTML files into "packages" that
can be easily loaded and delivered to a browser.
( C ) - Webpack's main function is to use file configurations
to define tasks, making it harder to learn for beginners but
more powerful and flexible for advanced developers.

Note: The correct answer is on the last page.


CSS PREPROCESSORS:
SASS AND LESS
CSS preprocessors, such as SASS and LESS, are powerful
tools that can help developers write CSS more efficiently
and with fewer errors. These preprocessors offer features
such as variables, functions, mixins and mathematical
operations that are not available in standard CSS. In this
section, we'll explore these two popular preprocessors and
how they can be used to improve your development
workflow.
::: SASS :::
SASS, which stands for Syntactically Awesome Stylesheets,
is a CSS preprocessor that allows developers to write CSS in
a cleaner, easier-to-understand way. It introduces a number
of powerful features that make writing CSS more efficient
and less error-prone.
One of the key features of SASS is the ability to use
variables. Variables allow you to store values ??that you
want to reuse throughout your CSS, such as colors, font
sizes, or spacing. This can be extremely useful for
maintaining consistency throughout your design and making
your code more maintainable.
SASS also supports the creation of mixins, which are blocks
of CSS code that can be reused throughout your project.
This can be useful for styles that are used frequently, such
as buttons or form elements. Mixins can even accept
arguments, allowing you to customize the style each time
the mixin is used.
In addition, SASS allows the use of mathematical operations
in your CSS. This can be useful for calculating sizes,
spacing, or other properties that depend on dynamic values.
::: LESS :::
LESS, which stands for Leaner CSS, is another popular CSS
preprocessor. It offers many of the same features as SASS,
including variables, mixins, and mathematical operations.
However, there are some key differences that may make it
more attractive to some developers.
One of the main differences between LESS and SASS is the
syntax. While SASS offers two different syntaxes, one that is
similar to CSS and another that is more concise and uses
indentation to delimit blocks of code, LESS only uses one
syntax that is very similar to CSS. This can make LESS a
little easier to learn for developers who are already familiar
with CSS.
Another difference is that LESS is written in JavaScript and
can be run in the browser, while SASS is written in Ruby and
needs to be compiled into CSS before being used in the
browser. This can make LESS a little easier to integrate into
projects that are already using JavaScript.
::: Choosing between SASS and LESS :::
Both SASS and LESS are excellent tools that can
significantly improve your CSS development workflow.
Choosing between the two often comes down to personal
preference and the specific needs of your project.
If you value a syntax that is very similar to CSS and the
ability to run its preprocessor in the browser, then LESS may
be the best choice for you. On the other hand, if you prefer
a more concise syntax and the ability to use features like
loops and conditionals, then SASS may be a better option.
Regardless of which preprocessor you choose, the important
thing is that you are taking a step towards improving the
efficiency and quality of your CSS code. With practice, you'll
find that these tools can save you a lot of time and help you
avoid common CSS mistakes.
In conclusion, CSS preprocessors like SASS and LESS are
powerful tools that every front-end developer should
consider. They offer a number of features that can make
writing CSS more efficient and less error-prone, and they
can be easily integrated into most development workflows.
So if you're not already using a CSS preprocessor, now
might be the time to start.
Answer the question about the previous content:

Exercise 103: What are


the main differences
between SASS and LESS
CSS preprocessors?
( A ) - Both have the same syntax and both are written in
JavaScript.
( B ) - SASS is written in Ruby and needs to be compiled into
CSS before being used in the browser, while LESS is written
in JavaScript and can be run in the browser. Additionally,
SASS offers two different syntaxes, while LESS only uses one
syntax that is very similar to CSS.
( C ) - LESS allows the use of variables, mixins and
mathematical operations, while SASS does not offer these
features.

Note: The correct answer is on the last page.


CSS FRAMEWORKS:
MATERIALIZE, BULMA,
TAILWIND
CSS frameworks are powerful tools that help developers
create responsive, attractive designs easily and efficiently.
In this article, we will discuss three popular CSS frameworks:
Materialize, Bulma, and Tailwind.
::: Materialize :::
Materialize is a modern and responsive CSS framework
based on Material Design from Google. It is built with HTML,
CSS, and JavaScript and offers a variety of pre-built
components, such as buttons, cards, navigation bars, and
forms, that follow Material Design design guidelines.
With Materialize, you can quickly create elegant, functional
user interfaces with less code. It also offers advanced
features like animations and transitions that can add a
touch of sophistication to your website. Additionally,
Materialize is fully customizable, allowing you to modify
colors, fonts, and other design elements to suit your brand.
Materialize also has extensive documentation and an active
community, making it a great option for developers of all
skill levels.
::: Bulma :::
Bulma is a lightweight and modular CSS framework based
on Flexbox. It is fully responsive and allows you to create
modern and elegant user interfaces with ease. Bulma offers
a variety of pre-built components such as buttons, forms,
cards, and navigation bars that can be customized to fit
your brand.
One of the main benefits of Bulma is its simplicity. It has an
easy-to-understand syntax and logical structure, making it a
great option for beginners. Plus, Bulma is fully modular,
meaning you can import only the components you need,
keeping your code clean and efficient.
Additionally, Bulma has detailed documentation and an
active community, which can be very helpful if you
encounter any issues or need help understanding how to
use a certain feature.
::: Tailwind :::
Tailwind is a low-level CSS framework that allows you to
build custom designs directly in your markup. Instead of
offering pre-built components like buttons or cards, Tailwind
provides utility classes that you can combine to create
unique designs.
This makes Tailwind a very powerful and flexible tool, as it
gives you full control over your website design. However,
this flexibility can also make it a little more difficult to learn
and use, especially for beginners.
Despite this, Tailwind has extensive documentation and an
active community, which can be very helpful if you need
help understanding how to use a certain feature or if you
encounter any issues.
In conclusion, Materialize, Bulma, and Tailwind are three
powerful CSS frameworks that can help you create
responsive and attractive designs easily and efficiently. Each
of them has its own strengths and weaknesses, so choosing
between them will depend on your specific needs and
preferences.
Answer the question about the previous content:

Exercise 104: Which of the


following statements is
TRUE about the
Materialize, Bulma, and
Tailwind CSS frameworks?
( A ) - Materialize does not allow customization, while Bulma
and Tailwind allow you to modify design elements.
( B ) - Bulma does not have an active community and
extensive documentation, unlike Materialize and Tailwind.
( C ) - Tailwind does not offer pre-built components like
buttons or cards, instead it provides utility classes that can
be combined to create unique designs.

Note: The correct answer is on the last page.


FRONT END SOFTWARE
ARCHITECTURE: MVC,
MVVM
Software architecture is fundamental to the effective
development of a software system. It provides a structure
that allows understanding of the software system. Software
architecture is especially important for front-end
development as it provides the framework for the user
interface and user experience. Among the most common
front-end software architectures are Model-View-Controller
(MVC) and Model-View-View-Model (MVVM).
::: Model-View-Controller (MVC) :::
MVC is a software architecture that separates business
logic, user interface, and input control into three distinct
components: the Model, View, and Controller.
The Model is the representation of data and business rules.
It encapsulates data and provides methods to access and
manipulate that data. Vision is the visual representation of
data. It provides the user interface, which allows the user to
interact with the data. The Controller is the bridge between
the Model and the Vision. It receives user input through the
View, processes the input, and updates the Model and View
accordingly.
One of the main advantages of MVC is the separation of
responsibilities. Each MVC component has a specific
responsibility, which makes the system easier to
understand, maintain, and expand. Furthermore, the
separation of responsibilities allows different parts of the
system to be developed and tested independently of each
other.
::: Model-Vision-Model (MVVM) :::
MVVM is an extension of MVC that introduces a new
component: the View Model. The Vision Model is an abstract
representation of the Vision. It provides a bridge between
the Model and the View that allows two-way data binding.
This means that changes to Model data are automatically
reflected in the View and vice versa.
One of the main advantages of MVVM is bidirectional data
binding. It simplifies updating the user interface and
synchronizing data between the user interface and the data
model. Additionally, two-way data binding allows you to
create more dynamic and responsive user interfaces.
Another advantage of MVVM is the separation of
responsibilities. Like MVC, MVVM separates business logic,
user interface, and input control into distinct components.
However, MVVM goes one step further and also separates
the presentation logic from the user interface. This makes
the system even easier to understand, maintain and
expand.
::: Conclusion :::
Software architecture is a crucial aspect of front-end
development. It provides the framework for the user
interface and user experience. MVC and MVVM are two of
the most common front-end software architectures. Both
offer a separation of responsibilities that makes the system
easier to understand, maintain, and expand. However,
MVVM offers the additional advantage of two-way data
binding, which simplifies updating the user interface and
synchronizing data between the user interface and the data
model.
Therefore, when developing a front-end software system, it
is important to consider the appropriate software
architecture. The choice of software architecture can have a
significant impact on the effectiveness and efficiency of the
software system.
Answer the question about the previous content:

Exercise 105: Which of the


following statements
about front-end software
architectures is true?
( A ) - MVC and MVVM do not allow separation of
responsibilities in the software system.
( B ) - Model-View-Controller (MVC) does not provide a
framework for the user interface and user experience.
( C ) - Model-View-Model View (MVVM) offers the additional
advantage of two-way data binding, which simplifies
updating the user interface and synchronizing data between
the user interface and the data model.

Note: The correct answer is on the last page.


JAVASCRIPT DESIGN
PATTERNS
Design patterns are reusable solutions to problems
commonly encountered in software development. In
JavaScript, there are several design patterns that can be
used to improve code structure and efficiency. They provide
a structured approach to solving software problems and are
an essential tool for any JavaScript developer.
Design patterns in JavaScript can be categorized into three
main types: creation patterns, structural patterns, and
behavioral patterns.
::: Creation Standards :::
Creation patterns deal with creating objects in a way that
suits the specific scenario. They are used when a decision
must be made at the time of creating an object. Some of the
most common creation patterns in JavaScript include the
Factory Pattern, the Constructor Pattern, and the Singleton
Pattern.
::: Factory Default :::
The Factory Pattern involves creating an object without
exposing the creation logic to the client. Instead, a common
function is used to create the object. This pattern helps to
create different objects of the same class.
::: Builder Pattern :::
The Builder Pattern is used to create a complex object step
by step. It separates the construction of a complex object
from its representation, so that the same construction
process can create different representations.
::: Singleton Pattern :::
The Singleton Pattern ensures that a class has only one
instance and provides a global access point to it. This
pattern is useful when we need to ensure that only one
object is created and shared among all components of an
application.
::: Structural Patterns :::
Structural patterns deal with the composition of classes or
objects. They help ensure that when one part of the system
changes, the entire system does not need to change. The
most common structural patterns in JavaScript include the
Adapter Pattern, the Decorator Pattern, and the Facade
Pattern.
::: Adapter Pattern :::
The Adapter Pattern converts the interface of a class into
another interface that the client expects. It allows classes
with incompatible interfaces to work together.
::: Decorator Pattern :::
The Decorator Pattern adds new features to an object
dynamically, without changing its structure. It is an
alternative to inheritance to extend functionality.
::: Facade Pattern :::
The Facade Pattern provides a simplified interface to a
complex system. It hides the complexity of the system and
provides an easy interface for the customer.
::: Behavioral Patterns :::
Behavioral patterns deal with communication between
objects and how they interact and distribute functionality.
Some of the most common behavioral patterns in JavaScript
include the Observer Pattern, the Strategy Pattern, and the
Command Pattern.
::: Observer Pattern :::
The Observer Pattern defines a one-to-many dependency
between objects, so that when an object changes state, all
its dependents are notified and updated automatically.
::: Strategy Pattern :::
The Strategy Pattern defines a family of algorithms,
encapsulates each of them and makes them
interchangeable. It allows the algorithm to vary
independently of the customers using it.
::: Command Pattern :::
The Command Pattern encapsulates a request as an object,
allowing you to parameterize clients with queues, requests,
and operations. It also enables support for reversible
operations.
In conclusion, JavaScript design patterns are an essential
tool for all developers. They provide structured solutions to
common software development problems and help improve
code quality and efficiency. Therefore, it is important to
learn and understand these patterns to become an effective
JavaScript developer.
Answer the question about the previous content:

Exercise 106: What are


the three main types of
design patterns in
JavaScript?
( A ) - Factory patterns, builder patterns and singleton
patterns.
( B ) - Creation patterns, structural patterns and behavioral
patterns.
( C ) - Adapter patterns, decorator patterns and facade
patterns.

Note: The correct answer is on the last page.


FUNCTIONAL
PROGRAMMING IN
JAVASCRIPT
Functional programming is a programming paradigm that
treats computation as an evaluation of mathematical
functions and avoids state change and mutable data. In
JavaScript, this is made easier by the fact that functions are
first-class objects, meaning they can be passed as
arguments to other functions, returned as values ??from
other functions, and assigned to variables.
Functional programming in JavaScript generally involves the
use of pure functions, which are functions that give the
same result for the same arguments and have no side
effects. This means that they do not modify any state or
variable outside the function. This makes its behavior
predictable and easy to test.
For example, consider the following pure function:
____________________________________________
function sum(a, b) {
return a + b;
}
____________________________________________
This function will always return the same result for the same
arguments and will not modify any external state.
Another important concept in functional programming is
immutability, which is the idea that once a variable is
created, its value cannot be changed. Instead, any
modification to a variable will result in a new variable. This
is useful to avoid side effects and make the code more
predictable.
____________________________________________
let a = 1;
let b = a + 1; // b is now 2, but a is still 1
____________________________________________
High-order functions are another pillar of functional
programming. These are functions that operate on other
functions, either taking them as arguments or returning
them as a result. In JavaScript, high-order functions are
commonly used with array methods such as map, filter, and
reduce.
____________________________________________
let numbers = [1, 2, 3, 4, 5];
let doubled = numbers.map(function(n) {
return n * 2;
}); // [2, 4, 6, 8, 10]
let pairs = numbers.filter(function(n) {
return n % 2 === 0;
}); // [2, 4]
let sum = numbers.reduce(function(total, n) {
return total + n;
}, 0); // 15
____________________________________________
Using higher order functions like these can make code more
concise and readable.
Finally, function composition is another common technique
in functional programming. This involves creating complex
functions by combining simpler functions. In JavaScript, this
can be done using the compose function, which can be
implemented as:
____________________________________________
function compose(f, g) {
return function(x) {
return f(g(x));
};
}
____________________________________________
With this function, you can create new functions by
combining other functions. For example, you could create a
function to double and then add 1 to a number:
____________________________________________
let foldEAdd1 = compose(function(n) { return n + 1; },
function(n) { return n * 2; });
foldAndAdd1(4); // 9
____________________________________________
In summary, functional programming is a powerful paradigm
that can make code more predictable, easier to test, and
easier to understand. While it may be a little different than
what you're used to if you come from an imperative or
object-oriented background, it's worth learning and using in
your JavaScript code.
Answer the question about the previous content:

Exercise 107: Which of the


following concepts is NOT
a pillar of functional
programming in
JavaScript?
( A ) - Immutability
( B ) - Function composition
( C ) - High order functions
( D ) - Class inheritance

Note: The correct answer is on the last page.


REACTIVE
PROGRAMMING WITH
RXJS
Reactive programming is a programming paradigm focused
on data flows and the propagation of changes. This means
that, instead of dealing with values ??that change over time,
as is common in imperative programming, in reactive
programming we deal with sequences of events over time.
In this chapter, we will discuss reactive programming with
RxJS in front-end development.
RxJS is a library for composing asynchronous and event-
based programs using observable sequences. It's perfect for
handling events, especially when you need to handle a large
amount of events arriving over time. RxJS allows you to
create a stream of events and react to them declaratively,
without worrying about low-level details.
To get started with RxJS, we first need to understand the
concept of Observables. An Observable is a representation
of any set of values ??over any amount of time. It can be a
single value, a sequence of values, or a continuous stream
of values. Observables are the foundation of reactive
programming with RxJS.
An Observable by itself does nothing. It needs an Observer
to react to the values ??it emits. An Observer is just an
object with three methods: next, error and complete. The
next method is called to receive the next value from the
Observable, the error method is called if there is an error
during value generation and the complete method is called
when there are no more values ??to be generated.
To create an Observable, you can use the RxJS create
function. For example, to create an Observable that outputs
numbers from 1 to 5, you could do the following:
____________________________________________

const source$ = Rx.Observable.create(observer => {


for (let i = 1; i <= 5; i++) {
observer.next(i);
}
observer.complete();
});
____________________________________________
To subscribe to an Observable and start receiving values,
you use the Observable's subscribe method. For example, to
print the values ??from the Observable we just created, you
would do the following:
____________________________________________

source$.subscribe(
value => console.log(value),
error => console.error(error),
() => console.log('Complete')
);
____________________________________________
In addition to creating Observables from scratch, you can
also turn other things into Observables, such as events,
promises, arrays, and so on. RxJS provides many utility
functions for this, called operators.
Operators are functions that allow you to manipulate
Observables in various ways. For example, you can filter
values, map values ??to other values, combine multiple
Observables into one, and so on. Operators are the main
tool you use to compose logic in RxJS.
To use an operator, you call the Observable's pipe method
and pass the operator to it. For example, to filter the even
values ??of our Observable, you could do the following:
____________________________________________

const even$ = source$.pipe(


Rx.operators.filter(value => value % 2 === 0)
);
even$.subscribe(value => console.log(value)); // logs 2, 4
____________________________________________
In summary, reactive programming with RxJS is a powerful
way to handle events and data flows in front-end
applications. With Observables and operators, you can
express complex logic in a declarative and manageable way.
Answer the question about the previous content:

Exercise 108: What is the


main role of an Observer
in reactive programming
with RxJS?
( A ) - Emit events to the Observable.
( B ) - Manipulate Observables in various ways.
( C ) - React to values ​emitted by the Observable.

Note: The correct answer is on the last page.


GRAPHQL AND APOLLO
CLIENT
CHAPTER 59: GRAPHQL
AND APOLLO CLIENT
::: Chapter 59: GraphQL and Apollo Client :::
GraphQL is a data query language developed by
Facebook. It allows customers to define the structure of their
data responses. This makes GraphQL a powerful tool for
working with real-time data as you can get exactly what you
need and nothing more. Additionally, GraphQL allows you to
group multiple queries into a single request, which can save
bandwidth and improve application performance.
Apollo Client is a popular library that makes it easy to use
GraphQL in your JavaScript applications. It provides an easy
way to search, modify, and observe data, all right from your
front-end application.
::: Why use GraphQL? :::
Compared to traditional REST APIs, GraphQL has several
advantages. Firstly, it allows customers to specify exactly
what data they need, which can reduce the amount of data
that needs to be transferred over the network. Secondly,
GraphQL allows you to do multiple queries and mutations in
a single request, which can improve application
performance. Finally, GraphQL has a strong type system,
which can help prevent errors and make your code easier to
understand.
::: Why use Apollo Client? :::
Apollo Client makes it much easier to use GraphQL in
your JavaScript applications. It provides an easy way to
search, modify, and observe data, all right from your front-
end application. Additionally, Apollo Client has a large
community and a wide range of useful features such as
smart caching, pagination support, integration with popular
development tools such as React and Angular, and much
more.
::: How to use GraphQL and Apollo Client :::
To get started with GraphQL and Apollo Client, you first
need to install the Apollo Client package in your project. This
can be done using npm or yarn. Once you have the Apollo
Client installed, you can start writing GraphQL queries and
mutations.
GraphQL queries are used to fetch data, while mutations
are used to modify data. Both are written in the GraphQL
query language, which is a declarative query language. This
means you specify what you want and GraphQL takes care
of the rest.
After you write your queries and mutations, you can use
them with the Apollo Client to fetch and modify data. The
Apollo Client will take care of sending the requests to your
GraphQL server, receiving the responses, and updating the
local data cache.
In addition, Apollo Client also provides several other
useful features such as the ability to observe real-time data,
pagination support, integration with other popular front-end
libraries such as React and Angular, and much more.< /p>
::: Conclusion :::
In short, GraphQL is a powerful data query language that
lets you get exactly the data you need, when you need it.
Apollo Client is a library that makes it easy to use GraphQL
in your JavaScript applications. Together, they can help you
build more efficient and powerful front-end applications.
This chapter provided an overview of GraphQL and the
Apollo Client and discussed why you might want to use
them in your projects. In the next chapters, we'll dive
deeper into these topics and show you how you can start
using GraphQL and Apollo Client in your own projects.
Answer the question about the previous content:

Exercise 109: What role


does Apollo Client play in
relation to GraphQL in
JavaScript applications?
( A ) - Apollo Client allows you to create graphical interfaces
for JavaScript applications.
( B ) - Apollo Client makes GraphQL easy to use by providing
an easy way to fetch, modify, and observe data directly
from your front-end application.
( C ) - The Apollo Client is responsible for developing the
JavaScript code for the application.

Note: The correct answer is on the last page.


WEB COMPONENTS
AND SHADOW DOM
Web Components and Shadow DOM are two fundamental
concepts in front-end development, especially when it
comes to building robust and scalable web applications.
Both concepts allow developers to encapsulate and reuse
code, thereby improving code maintainability and scalability.
::: Web Components :::
Web Components is a set of web technologies that allow
developers to create reusable HTML widgets. With Web
Components, you can create custom HTML tags with specific
functionality that can be reused in different parts of a web
application.
Web Components are made up of three main technologies:
Custom Elements, Shadow DOM and HTML Templates.
Custom Elements allow developers to define and use new
HTML elements. Shadow DOM allows developers to
encapsulate the style and behavior of a component,
separating it from the rest of the code. HTML Templates
allow developers to declare HTML fragments that can be
used and reused in different parts of the application.
Web Components offer several advantages. They promote
code reuse, improve code maintainability, and enable
greater separation of concerns. Additionally, because Web
Components are based on web standards, they are
compatible with a wide range of modern browsers.
::: Shadow DOM :::
Shadow DOM is a technology that allows developers to
encapsulate the HTML, CSS and JavaScript code of a
component, separating it from the main DOM. This means
that the code in one component does not affect the rest of
the page, and vice versa.
With Shadow DOM, each component has its own DOM,
which is isolated from the main DOM. This allows developers
to style and behave their components without worrying
about style or behavior conflicts with other elements on the
page.
Shadow DOM also offers several benefits. It improves
performance since the browser only needs to render a
component's DOM when it is actually needed. It also
improves code maintainability since each component is
independent and can be modified without affecting other
components. Additionally, because Shadow DOM is based
on web standards, it is compatible with a wide range of
modern browsers.
::: Conclusion :::
Web Components and Shadow DOM are two powerful
technologies that can significantly improve the quality and
scalability of your front-end code. By learning to use these
technologies, you can build more robust, maintainable, and
efficient web applications.
However, like any technology, Web Components and
Shadow DOM have their own complexities and challenges.
Therefore, it is important that you invest time to learn and
understand these technologies before you start using them
in your projects.
In our HTML, CSS, and JavaScript course, we cover these
concepts in detail, providing practical examples and
exercises to help you become a more effective front-end
developer. By the end of the course, you will have a solid
understanding of how to use Web Components and Shadow
DOM to build modern, robust web applications.
Answer the question about the previous content:

Exercise 110: What are


the three main
technologies that make up
Web Components?
( A ) - HTML, CSS and JavaScript
( B ) - Custom Elements, Shadow DOM and HTML Templates
( C ) - Web Components, Shadow DOM and HTML

Note: The correct answer is on the last page.


PROGRESSIVE WEB
APPS (PWA)
CHAPTER 61:
PROGRESSIVE WEB
APPS (PWA)
::: Chapter 61: Progressive Web Apps (PWA) :::
Progressive Web Apps (PWA) are a new generation of web
applications that offer a user experience similar to native
applications. They combine the best features of web apps
and mobile apps to create a unique and engaging user
experience.
PWAs are built using standard web technologies like HTML,
CSS, and JavaScript, but incorporate modern web features
and design patterns that allow them to provide a user
experience similar to that of a native app. This includes the
ability to work offline, send push notifications, and be
installed on the user's device home screen.
::: What makes a web app progressive? :::
There are three main characteristics that define a PWA:

---Reliable: PWAs should load instantly and never show the


network error screen, even in uncertain network conditions.
---Fast: They should respond quickly to user interactions
with smooth animations and no janky scrolling.
---Engaging: They should look like a native app on the
device's home screen, and users should be able to interact
with them as they would with a native app.
::: How are PWAs built? :::
PWAs are built using a combination of modern web
technologies and techniques, including:

---Service Workers: Service workers are scripts that the


browser runs in the background, separate from a web page,
opening the door to features that don't need a web page or
user interaction . They are key to enabling PWAs to work
offline and provide push notifications.
---Web App Manifest: The Web App Manifest is a JSON file
that provides information about the application (such as
name, author, icon, and description) in a way that devices
can easily recognize and display.
---HTTPS: To ensure user security, PWAs must be served
over a secure connection.

::: Benefits of PWAs :::


PWAs offer several benefits over traditional web apps and
native mobile apps, including:

---User experience: PWAs offer a user experience similar to


that of a native app, including the ability to work offline,
send push notifications, and be installed on the home
screen of the user's device.< /li>
---Reach: Because PWAs are built using web technologies,
they are accessible on any device with a web browser. This
means they have a potentially much greater reach than
native mobile apps, which need to be developed separately
for different platforms.
---Maintenance: Maintaining a PWA is generally easier and
cheaper than maintaining a native mobile app, as you only
need to maintain one codebase.

::: Challenges of PWAs :::


Despite their many benefits, PWAs also present some
challenges, including:

---Browser Compatibility: Although most modern browsers


support the technologies used to build PWAs, there are still
some differences between browsers in terms of what
features they support.
---Finding: Because PWAs are hosted on the web, they do
not appear in app stores. This can make it harder for users
to discover your app.

Despite these challenges, PWAs represent an exciting


opportunity for developers to create high-quality, engaging
user experiences using web technologies. They offer the
potential to reach a wider audience, reduce maintenance
costs, and provide a native app-like user experience.
Answer the question about the previous content:

Exercise 111: Which of the


following statements is
true about Progressive
Web Apps (PWA)?
( A ) - PWAs cannot be installed on the user's device home
screen.
( B ) - PWAs cannot work offline or send push notifications.
( C ) - PWAs combine the best features of web apps and
mobile apps to create a unique and engaging user
experience.

Note: The correct answer is on the last page.


MOBILE DEVELOPMENT
WITH REACT NATIVE
Mobile development has been an area in constant growth
and evolution, and one of the main protagonists of this
scenario is React Native. React Native is a mobile app
development framework created by Facebook. It's based on
React, the JavaScript library used to create user interfaces,
but instead of targeting the browser, it targets mobile
platforms. With React Native, you can develop mobile apps
that are indistinguishable from apps developed using
Objective-C or Java. React Native uses the same
fundamental UI components used by regular iOS and
Android apps.
React Native is not an attempt to write once and run
anywhere; rather, it's a way to learn once and write
anywhere. This means that although you can use the same
code to create iOS and Android apps, you will still have to
make some changes to optimize your app for each platform.
However, this is a lot less work than having to write the
same application twice in two different languages.
One of the main benefits of React Native is its efficiency. As
a developer, you can create an app once in JavaScript and
have an app that works on both iOS and Android. This saves
significant time and resources compared to the traditional
approach of developing separate applications for each
platform. Plus, because React Native allows you to create
reusable components, you can easily update and improve
your app without having to rewrite all the code.
Another advantage of React Native is its performance. Apps
written in React Native compile to native code, which means
they are as fast and responsive as any other native app.
Additionally, React Native supports live updates, which
means you can publish updates to your app without having
to go through the App Store or Google Play Store approval
process.
Additionally, React Native is supported by a large
community of developers. This means there are a wealth of
learning resources available, including tutorials,
documentation, and discussion forums. Plus, if you
encounter a problem or have a question, chances are
someone in the community can help you.
To start developing with React Native, you will need to have
a solid understanding of JavaScript and React. However, if
you're already a front-end developer with experience in
HTML, CSS, and JavaScript, the learning curve for React
Native won't be too steep. In fact, many of the concepts you
already know from React, like components and state, are
transferable to React Native.
In short, React Native is a powerful mobile app development
framework that allows you to build high-performance iOS
and Android apps with JavaScript and React. With its
efficiency, performance and community support, React
Native is an excellent choice for any front-end developer
looking to enter the world of mobile development.
To master React Native, it's important to understand the
fundamentals of React and JavaScript. This includes
understanding how to work with JSX, the React component
system, managing state with Redux, and much more.
Additionally, you will need to familiarize yourself with the
specifics of mobile development, such as handling touch
gestures, rendering lists of data, and integrating with the
device's native APIs.
Once you have a solid understanding of these concepts, you
will be well equipped to start building your own applications
with React Native. And with the growing popularity of React
Native, there is a growing demand for developers who can
use this framework effectively. Therefore, learning React
Native will not only expand your skills as a developer, but it
can also open up new career opportunities.
Answer the question about the previous content:

Exercise 112: Which of the


following statements is
true about React Native?
( A ) - React Native is a mobile app development framework
that allows you to build high-performance iOS and Android
apps with JavaScript and React.
( B ) - React Native is a mobile app development framework
that allows you to build iOS and Android apps with just
Objective-C or Java.
( C ) - React Native is a mobile app development framework
that allows you to create iOS and Android apps without any
knowledge of JavaScript and React.

Note: The correct answer is on the last page.


GAME DEVELOPMENT
WITH PHASER.JS
::: Game Development with Phaser.js :::
Phaser.js is a free, fast, open source framework for creating
HTML5 games. It offers a robust and flexible development
environment for creating 2D web games. This chapter of our
course will introduce you to the basics of game
development with Phaser.js, as well as provide a practical
example of how to create a simple game.
::: What is Phaser.js? :::
Phaser.js is a JavaScript library that makes it easy to create
games for the web. It offers a host of features that make
creating games easier, including graphics rendering,
collision detection, user input handling, and more. Phaser.js
uses the Pixi.js library for rendering, which means games
created with Phaser.js can run in any modern browser
without the need for plugins or extensions.
::: Why use Phaser.js for game development? :::
There are several reasons why you might want to use
Phaser.js for game development. Firstly, it is a very powerful
library that offers a lot of out-of-the-box functionality. This
means you can focus on creating your game, rather than
having to worry about implementing basic functionality.
Secondly, Phaser.js is very easy to learn and use, even for
developers who don't have much experience in game
programming. The documentation is extensive and there
are many examples and tutorials available to help you get
started.
Finally, Phaser.js is a very active and well-maintained library.
This means you can expect regular updates, bug fixes and
new features.
::: How to get started with Phaser.js :::
To get started using Phaser.js, you will need to include the
library in your project. You can do this by downloading the
library from the official Phaser website and including it in
your HTML file with a script tag, like this:
____________________________________________
<script src="phaser.min.js"></script>
____________________________________________
Once the library is included in your project, you can start
using Phaser's features to create your game.
::: Example game with Phaser.js :::
Let's create a simple game to demonstrate how to use
Phaser.js. In this game, the player will control a character
who must collect coins while avoiding obstacles.
First, let's create a new instance of Phaser.Game. This will
create a new game with a specific width and height:
____________________________________________
var game = new Phaser.Game(800, 600, Phaser.AUTO, '', {
preload: preload, create: create, update: update });
____________________________________________
Next, we will load the assets we will need for our game in
the preload function:
____________________________________________
function preload() {
game.load.image('player', 'assets/player.png');
game.load.image('coin', 'assets/coin.png');
game.load.image('obstacle', 'assets/obstacle.png');
}
____________________________________________
After that, we will create our player, coins and obstacles in
the create function:
____________________________________________
function create() {
player = game.add.sprite(50, game.world.height - 150,
'player');
coins = game.add.group();
obstacles = game.add.group();
}
____________________________________________
Finally, we will update our player's position and check for
collisions in the update function:
____________________________________________
function update() {
player.body.velocity.x = 0;
if (game.input.keyboard.isDown(Phaser.Keyboard.LEFT)) {
player.body.velocity.x = -150;
} else if
(game.input.keyboard.isDown(Phaser.Keyboard.RIGHT)) {
player.body.velocity.x = 150;
}
game.physics.arcade.overlap(player, coins, collectCoin,
null, this);
game.physics.arcade.overlap(player, obstacles,
hitObstacle, null, this);
}
____________________________________________
This is just a simple example of how you can use Phaser.js
to create a game. The library offers many more features
that you can explore to create more complex and interesting
games.
::: Conclusion :::
Phaser.js is an excellent choice for anyone interested in web
game development. With its wide range of features,
extensive documentation, and active community, you'll
have everything you need to start creating your own games
in no time.
Answer the question about the previous content:

Exercise 113: What is


Phaser.js and why is it
used for game
development?
( A ) - Phaser.js is a JavaScript library that makes it easy to
create games for the web by providing features such as
graphics rendering, collision detection, and user input
handling. Furthermore, it is easy to learn and use, has
extensive documentation and receives regular updates.
( B ) - Phaser.js is a browser extension that allows you to
play online games. It is used because it is compatible with
all modern browsers and does not require the installation of
additional plugins.
( C ) - Phaser.js is 3D game creation software. It is widely
used because of its ability to create realistic and complex
graphics.

Note: The correct answer is on the last page.


WEBVR AND VIRTUAL
REALITY ON THE WEB
One of the most exciting and futuristic topics we can cover
in our HTML, CSS and Javascript course is WebVR and virtual
reality on the web. WebVR is an incredible technology that
allows developers to create virtual reality (VR) experiences
on the web. With WebVR, users can explore 3D virtual
environments directly from the browser, without the need
for additional software.
WebVR is based on JavaScript and uses the WebGL API to
render 3D graphics. This means you can use the same skills
you're already learning in our course to create amazing VR
experiences. Furthermore, WebVR is an open specification,
which means anyone can contribute to its development and
improve it for the future.
To get started with WebVR, you'll need a compatible virtual
reality headset. There are many available on the market,
from the Oculus Rift and HTC Vive to Google Cardboard and
Samsung Gear VR. Once you have one of these, you can
start creating your own VR experiences.
The first step to creating a VR experience is setting up the
scene. This is done using a combination of HTML and
JavaScript. You'll need to create a <canvas> element to
render the scene, and then use JavaScript to create 3D
objects, configure the lighting, and set the camera position.
Once the scene is set up, you can start adding interactivity.
This can be done using WebVR input events, which allow
you to track the user's head movement, hand positioning,
and button clicks. You can use this information to move the
user around the scene, select objects, or even create
interactive games.
One of the most amazing things about WebVR is that it
allows you to create experiences that are accessible to
anyone with a web browser. This means you can reach a
much larger audience than would be possible with
traditional VR apps. Additionally, because WebVR is based
on standard web technologies, it is compatible with a wide
range of devices and browsers.
However, it is important to note that WebVR is still an
emerging technology. This means that it is constantly
evolving and may have some bugs or incompatibilities.
Additionally, creating VR experiences can be challenging as
it requires a solid understanding of 3D and physics. But with
practice and patience, you can create incredible
experiences that will surprise your users.
In conclusion, WebVR is an exciting technology that is
opening up new possibilities for the web. With it, you can
create VR experiences that are accessible to anyone with a
web browser, and use the same skills you're learning in our
course to do so. While WebVR can be challenging to master,
the potential it offers makes it a valuable skill for any front-
end developer.
So if you're ready to take the next step in your learning
journey and start exploring the world of virtual reality, join
us on this course. Let's dive into WebVR and show how you
can use HTML, CSS, and JavaScript to create amazing VR
experiences. We look forward to seeing what you create!
Answer the question about the previous content:

Exercise 114: What is


WebVR and how is it used
to create virtual reality
experiences on the web?
( A ) - WebVR is an HTML-based technology that allows
developers to create virtual reality experiences on the web,
using a compatible VR headset and the WebGL API to render
3D graphics.
( B ) - WebVR is a Python-based technology that allows
developers to create virtual reality experiences on the web,
using a compatible VR headset and the WebGL API to render
3D graphics.
( C ) - WebVR is a JavaScript-based technology that allows
developers to create virtual reality experiences on the web,
using a compatible VR headset and the WebGL API to render
3D graphics.

Note: The correct answer is on the last page.


WEBASSEMBLY AND
WEB PERFORMANCE
WebAssembly, also known as Wasm, is a binary format of
machine code that is designed to run in a web browser. It
offers a significant improvement in web performance,
making it an important topic for any front-end developer
looking to improve their HTML, CSS, and JavaScript skills.
Before going into detail about WebAssembly, it is important
to understand the context in which it was created.
Traditionally, JavaScript has been the only language that can
run directly in a browser. This has limited the speed and
capabilities of web applications, as JavaScript is not as fast
or efficient as compiled languages ??such as C++ or Rust.
WebAssembly was created to solve these problems. It is a
low-level code format that can run at speeds close to native
machine code. This allows developers to write code in
languages ??like C++ or Rust, compile that code to
WebAssembly, and then run it in a web browser. The result
is significantly improved performance for web applications.
Web performance is a critical consideration for front-end
developers. A page's loading speed can have a direct
impact on a website's user experience and conversion rate.
Therefore, any technology that can improve web
performance is of great interest to front-end developers.
WebAssembly offers several performance advantages. First,
as mentioned earlier, it allows code to run at speeds close
to native machine code. This can result in a significant
improvement in code execution speed.
Second, WebAssembly is designed to be compact and
efficient. This means that WebAssembly files are generally
smaller than their JavaScript equivalents, which can result in
faster page load times.
Additionally, WebAssembly is designed to be secure. It runs
in a sandbox and goes through a type checking process
during compilation, which helps prevent many types of bugs
and security vulnerabilities.
Although WebAssembly offers many advantages, there are
also challenges associated with its use. One of these
challenges is that WebAssembly is more difficult to debug
than JavaScript. This is because WebAssembly is a low-level
code format, which means it is further removed from the
original source code and can be more difficult to
understand.
Also, although WebAssembly support is improving, there are
still browsers that do not fully support it. This means that
developers who want to use WebAssembly may need to
provide a fallback version of their JavaScript code.
Despite these challenges, WebAssembly is an exciting
technology that has the potential to significantly improve
web performance. For front-end developers looking to
improve their HTML, CSS, and JavaScript skills, learning
about WebAssembly can be a valuable way to stay up to
date with the latest trends and technologies on the web.
In conclusion, WebAssembly is an important technology for
web performance. It allows developers to run high-
performance code directly in a browser, improving the
speed and efficiency of web applications. While there are
challenges associated with its use, WebAssembly's potential
to improve web performance makes it an important topic for
any front-end developer.
Answer the question about the previous content:

Exercise 115: What is


WebAssembly and what
are its advantages and
challenges?
( A ) - WebAssembly is a programming language that
replaces JavaScript and allows you to create more secure
websites, but it is more difficult to debug and not all
browsers fully support it.
( B ) - WebAssembly, also known as Wasm, is a binary
format of machine code that is designed to run in a web
browser. It significantly improves web performance by
allowing code to run at speeds close to native machine
code. However, it is more difficult to debug than JavaScript
and not all browsers fully support it.
( C ) - WebAssembly is a technology that replaces HTML,
CSS and JavaScript, making websites faster and more
secure, but it is more complex and requires a high level of
programming skill.

Note: The correct answer is on the last page.


ARTIFICIAL
INTELLIGENCE ON THE
WEB WITH
TENSORFLOW.JS
Artificial intelligence (AI) has revolutionized several
industries and the web is no exception. One of the most
powerful tools that is enabling the integration of AI on the
web is TensorFlow.js. This is an open-source JavaScript
library developed by Google that allows you to train and
deploy machine learning (ML) models directly in the browser
or in Node.js.
TensorFlow.js was designed to be easy to use for JavaScript
developers, but also powerful enough for data scientists and
ML researchers. It allows you to build and train ML models in
the browser without needing any specialized software. This
opens up a world of possibilities for creating AI-rich web
applications.
::: Why is TensorFlow.js important for the web? :::
TensorFlow.js brings AI to the web in a way that is
accessible, efficient, and secure. By allowing ML models to
be trained and deployed directly in the browser, it removes
the need for expensive and complex backend servers. This
not only reduces costs, but also improves user privacy as
data can be processed locally without having to be sent to a
server.
Additionally, TensorFlow.js is built on top of WebGL, a 3D
graphics API for the web. This allows it to leverage the
processing power of GPUs, which can significantly speed up
the training and inference of ML models.
::: TensorFlow.js applications on the web :::
TensorFlow.js can be used for a wide range of web
applications. Here are just a few examples:

---Image recognition: TensorFlow.js can be used to create


web applications that can identify objects in images, detect
faces, recognize facial expressions, and more.
---Natural language processing: TensorFlow.js can be used to
analyze and understand text, enabling applications such as
chatbots, machine translation, text summarization, and
more.
---Personalized recommendations: TensorFlow.js can be used
to create personalized recommendation systems that can
suggest products, articles, music or movies based on user
preferences.
---Time series forecasting: TensorFlow.js can be used to
analyze and forecast time series, which can be useful for
applications such as weather forecasting, market trend
analysis, and more.< /li>

::: How to get started with TensorFlow.js? :::


TensorFlow.js is a JavaScript library, so if you already know
JavaScript, you already have a good foundation to start with.
However, it is also useful to have some knowledge of ML.
There are many free online resources for learning ML,
including TensorFlow's own website.
To get started with TensorFlow.js, you can install the library
via npm or include it directly in your HTML using a tag
script. The TensorFlow.js documentation is a great place to
start as it contains detailed tutorials, guides, and examples.
In summary, TensorFlow.js is a powerful tool that is making
AI accessible for the web. With it, you can create AI-rich web
applications that are efficient, secure, and easy to use. If
you're a web developer looking to add AI to your skill set,
TensorFlow.js is definitely something you should consider
learning.
Answer the question about the previous content:

Exercise 116: How


important is TensorFlow.js
for the web?
( A ) - TensorFlow.js is important because it enables the
creation of high-quality online games.
( B ) - TensorFlow.js is important because it allows you to
train and deploy machine learning models directly in the
browser, eliminating the need for expensive and complex
backend servers and improving user privacy.
( C ) - TensorFlow.js is important because it allows you to
create attractively designed websites.

Note: The correct answer is on the last page.


WEB SCRAPING WITH
PUPPETEER
::: 67. Web Scraping with Puppeteer :::
Puppeteer is a Node.js library that provides a high-level API
for controlling Chrome or Chromium via the DevTools
Protocol. It is a powerful tool for performing web scraping,
which is the process of extracting data from websites. In this
chapter, we'll explore how you can use Puppeteer to
become a more effective front-end developer.
::: What is Web Scraping? :::
Web Scraping is a technique used to extract large amounts
of data from websites. Data on websites is unstructured.
Web Scraping allows you to convert this data into a
structured form. Web Scraping is a very powerful technique
for extracting useful information from websites and can be
used in various areas such as data analysis, marketing,
product development and more.
::: What is Puppeteer? :::
Puppeteer is a Node.js library that provides a high-level API
for controlling Chrome or Chromium-based browsers via the
command-line interface. It lets you do almost everything
you can do manually in a browser, including generating
screenshots and PDFs of pages, creating content pre-
rendering for SPAs, and automating form interactions.</p >
::: Why use Puppeteer for Web Scraping? :::
Puppeteer has several advantages over other web scraping
libraries. First, it's maintained by Chrome's own developers,
ensuring it's always up to date with the browser's latest
features. Secondly, Puppeteer can be used to automate user
interactions with the website, such as clicking buttons,
filling out forms, and navigating from page to page. This
makes it an ideal tool for testing website functionality.
::: How to use Puppeteer for Web Scraping :::
To start using Puppeteer, you need to install it in your
Node.js project. You can do this by running the following
command in the terminal:
____________________________________________
npm i puppeteer
____________________________________________
Once you have Puppeteer installed, you can start writing
web scraping scripts. Here's a basic example of how you can
use Puppeteer to extract the title of a web page:
____________________________________________
const puppeteer = require('puppeteer');
(async() => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://example.com');
const title = await page.title();
console.log(title);
await browser.close();
})();
____________________________________________
In this example, we first launch a new browser instance
using puppeteer.launch(). We then open a new page using
browser.newPage() and navigate to the desired URL with
page.goto(). Finally, we extract the page title with
page.title() and register it in the console.
::: Conclusion :::
Puppeteer is a powerful tool for web scraping. It allows you
to automate user interactions with a website and extract
valuable data. If you're looking for an efficient way to scrape
data from the web, Puppeteer is definitely a tool you should
consider.
Web Scraping is an essential skill for any front-end
developer as it allows you to efficiently collect and analyze
data from the web. With Puppeteer, you can automate this
process and make it more efficient and effective. So if you're
looking to become a more effective front-end developer,
learning how to use Puppeteer for web scraping is definitely
a step in the right direction.
Answer the question about the previous content:

Exercise 117: What is


Puppeteer and How is it
Used for Web Scraping?
( A ) - Puppeteer is a data analysis tool that automates the
collection of information from websites.
( B ) - Puppeteer is a Node.js library that provides a high-
level API for controlling Chrome or Chromium-based
browsers, making it a powerful tool for web scraping.
( C ) - Puppeteer is a DevTools protocol that allows you to
extract large amounts of data from websites.

Note: The correct answer is on the last page.


INTRODUCTION TO
DOCKER AND
CONTAINERS
While Docker and containers may seem a little out of place
in a front-end development course, they are extremely
useful tools that can help improve your workflow and make
you a more efficient and versatile developer. In this section,
we'll dive into the world of Docker and containers and see
how they can be used in front-end development.
::: What is Docker? :::
Docker is an open source platform that automates the
deployment, scaling, and execution of containerized
applications. Containers are a type of operating system-
level abstraction that allows you to run multiple isolated
applications on a single host system. Docker allows you to
package an application and its dependencies in a virtual
container that can be run on any Linux, Windows or MacOS
system that has Docker installed.
::: Why use Docker? :::
There are several reasons why developers love Docker. First,
it solves the "works on my machine" problem. By packaging
the application and its dependencies in a container, you can
be sure that the application will work in any environment
that has Docker installed, regardless of the specific
configurations of the host system.
Secondly, Docker allows you to isolate your applications.
Each Docker container is an autonomous entity that has its
own file system, its own network, and its own isolated
environment. This means you can run multiple versions of
the same application on the same host without conflicts.
Thirdly, Docker makes it easy to scale your applications. You
can easily create multiple instances of a container and
distribute them across a cluster of hosts. Docker also has a
rich ecosystem of tools and services that facilitate large-
scale container orchestration.
::: How does Docker apply to front-end development? :::
Although Docker is most often associated with back-end
development and application deployment, it also has
several useful applications in front-end development. Here
are some ways you can use Docker as a front-end
developer:

---Consistent development environments: Docker allows


you to create a development environment that is identical
to the production environment. This means that you can
develop and test your applications in an environment that is
exactly the same as the environment in which the
application will ultimately be deployed. This reduces the
chance of errors and bugs that are difficult to reproduce and
fix.
---Dependency isolation: With Docker, you can package
each application with its own dependencies. This means
that you can have multiple applications that depend on
different versions of the same library or framework, and
they can coexist peacefully on the same host system.
---Continuous integration and continuous delivery (CI/CD):
Docker is an excellent tool for CI/CD. You can use Docker to
create a CI/CD pipeline that builds, tests, and deploys your
applications in an automated way. This helps detect and fix
bugs earlier and makes the deployment process smoother
and more predictable.

::: Conclusion :::


Docker and containers are powerful tools that can
drastically improve your development workflow. They allow
you to create consistent development environments, isolate
dependencies, and automate the process of building and
deploying your applications. Although there is a learning
curve to get familiar with Docker, the investment is worth it
for the increased efficiency and quality of your work.
In the next section, we'll dive deeper into Docker and see
how you can start using it in your own front-end
development projects. We'll cover installing Docker, creating
Docker images, running containers, and more. So stay
tuned!
Answer the question about the previous content:

Exercise 118: Which of the


following statements
about Docker is true?
( A ) - Docker is a closed platform that does not allow
applications to be run in containers.
( B ) - Docker is an open source platform that automates the
deployment, scaling, and running of containerized
applications.
( C ) - Docker can only run on Linux systems.

Note: The correct answer is on the last page.


INTRODUCTION TO
DEVOPS AND CI/CD
::: 69. Introduction to DevOps and CI/CD :::
DevOps is a software engineering philosophy that combines
Software Development (Dev) and IT Operations (Ops). The
main goal of DevOps is to help an organization produce
high-quality software and IT services quickly and efficiently.
To achieve this, DevOps emphasizes strong collaboration
and communication between development and operations
teams.
CI/CD, on the other hand, is a DevOps practice that refers to
Continuous Integration (CI) and Continuous Delivery (CD). CI
is a development process that involves integrating new
code into an existing code repository several times a day.
This is done to enable early detection of problems and
facilitate resolution of code conflicts.
CD, on the other hand, is an approach that involves using
automation to release application changes to production
quickly and safely. This is done to enable fast and efficient
delivery of new features and updates to end users.
::: Importance of DevOps and CI/CD :::
Adopting the DevOps philosophy and CI/CD practices can
provide several benefits to an organization. First, it can
improve collaboration between development and operations
teams, which can lead to greater efficiency and productivity.
This can result in faster and higher quality development of
software and IT services.
Second, DevOps and CI/CD can help reduce development
cycle time. This is crucial in a world where demand for new
features and updates is high and competition is fierce. With
DevOps and CI/CD, organizations can deliver new features
and updates to their end users quickly and efficiently.
Third, DevOps and CI/CD can improve the reliability and
quality of software and IT services. This is possible because
CI/CD allows for early detection and resolution of problems,
while DevOps promotes collaboration and communication,
which can lead to better understanding and resolution of
problems.
::: DevOps and CI/CD implementation :::
The implementation of DevOps and CI/CD requires a cultural
change in the organization. This involves promoting
collaboration and communication between development and
operations teams, and adopting automation practices for
continuous integration and delivery.
First, it is important to establish a culture of collaboration
and communication between the development and
operations teams. This can be done through regular
meetings, brainstorming sessions and joint training.
Additionally, it is crucial that both teams understand each
other's goals and challenges so they can work together to
achieve the organization's goals.
Second, it is important to adopt automation practices for
continuous integration and delivery. This can be done
through the use of CI/CD tools such as Jenkins, Travis CI and
CircleCI. These tools can automate the integration and
delivery process, making it faster, more efficient, and less
error-prone.
Finally, it is important to monitor and measure DevOps and
CI/CD performance. This can be done through the use of
metrics and performance indicators, such as development
cycle time, deployment failure rate and user satisfaction.
These metrics can help your organization identify areas for
improvement and make informed decisions about your
DevOps and CI/CD practices.
In conclusion, DevOps and CI/CD are important practices
that can help organizations develop and deliver high-quality
software and IT services quickly and efficiently. However,
successfully implementing DevOps and CI/CD requires a
cultural change in the organization, the adoption of
automation practices, and continuous monitoring and
measurement of performance.
Answer the question about the previous content:

Exercise 119: What is


CI/CD in the context of
DevOps and what are its
benefits?
( A ) - CI/CD is a development process that involves
integrating new code into an existing code repository
several times a day and releasing application changes to
production quickly and safely. code conflicts, fast and
efficient delivery of new features and updates to end users.
( B ) - CI/CD is a software engineering philosophy that
combines Software Development (Dev) and IT Operations
(Ops). Its benefits include improving collaboration between
development and operations teams, producing high-quality
software and IT services.
( C ) - CI/CD is a DevOps practice that refers to Continuous
Integration (CI) and Continuous Delivery (CD). Its benefits
include improving collaboration between development and
operations teams, producing high-quality software and IT
services.

Note: The correct answer is on the last page.


WORKING WITH
CONTENT
MANAGEMENT SYSTEM
::: Chapter 70: Working with Content Management System
:::
Content Management System (CMS) is an essential tool for
any front-end developer. It allows developers and users to
manage and edit website content without the need for
advanced technical knowledge. In this chapter, we will
discuss how to work with a CMS, highlighting the role of a
front-end developer.

::: Understanding CMS :::


A CMS is a web application that allows the creation, editing,
organization and publication of digital content. It is designed
to allow users with little programming knowledge to create
and manage websites. However, for a front-end developer, a
CMS offers more than just an intuitive user interface for
managing website content.

::: Choosing the right CMS :::


There are many CMSs available on the market, each with its
own characteristics and functionalities. Some of the most
popular include WordPress, Drupal, Joomla, among others.
Choosing the right CMS depends on the needs of the
project. For example, WordPress is an excellent choice for
small to medium-sized blogs and websites, while Drupal is
better suited for large-scale, complex websites.

::: Integrating HTML, CSS and JavaScript with CMS :::


As a front-end developer, it is essential to know how to
integrate HTML, CSS and JavaScript with your chosen CMS.
Most CMSs allow you to customize your website design and
functionality using these technologies.

For example, in WordPress, you can create a custom theme


using HTML and CSS to define the site's structure and style.
Additionally, you can use JavaScript to add interactivity to
your website, such as sliders, pop-ups, forms, and more.

::: Working with plugins and modules :::


Most CMSs offer the option to add plugins or modules to
extend the site's functionality. These plugins can range from
simple SEO tools to complex eCommerce systems.

As a front-end developer, you need to know how to install


and configure these plugins. Additionally, you may need to
customize the design and functionality of these plugins to
suit your website design and requirements.

::: Performance considerations :::


Website performance is an important consideration when
working with a CMS. You need to ensure that the website
loads quickly and offers a smooth user experience. This may
involve optimizing images, minifying CSS and JavaScript
files, and implementing caching techniques.
::: Conclusion :::
Working with a CMS as a front-end developer involves more
than just managing content. You need to understand how to
integrate HTML, CSS and JavaScript with the CMS, how to
work with plugins and modules and how to optimize website
performance. With these skills, you will be able to create
powerful and effective websites that meet your customers'
needs.
Answer the question about the previous content:

Exercise 120: What is the


role of a Content
Management System
(CMS) in front-end
development?
( A ) - The CMS is only used to create and edit content on a
website.
( B ) - CMS is only used to manage website performance.
( C ) - CMS allows developers to manage and edit website
content, integrate HTML, CSS and JavaScript, work with
plugins and modules and optimize website performance.

Note: The correct answer is on the last page.


INTRODUCTION TO SEO
AND WEBSITE
OPTIMIZATION
Search engine optimization, better known as SEO (Search
Engine Optimization), is a crucial part of web development
and essential for any front-end developer. In this section, we
will dive into the world of SEO and understand how it can be
used to optimize websites.
::: What is SEO? :::
SEO is the process of optimizing a website so that it is easily
found by search engines such as Google, Bing and Yahoo.
This is done through a variety of techniques, including using
relevant keywords, creating high-quality content, and
ensuring the site is easy to navigate.
::: Why is SEO important? :::
SEO is important because most internet users rely on search
engines to find information. If your website is not optimized
for search engines, you are likely to miss out on a significant
amount of traffic. Additionally, sites that appear higher up in
a search tend to be seen as more trustworthy and
authoritative, which can make users more likely to click
through to your site.
::: How does SEO work? :::
SEO works through a series of techniques that help improve
your website's visibility in search engine results. Some of
these techniques include:

---Keywords: Keywords are terms that users type into search


engines when they are looking for information. By including
relevant keywords in your content, you can help search
engines understand what your site is about and show your
site to users who are looking for this information.
---High-quality content: Search engines value content that is
useful and relevant to users. By creating high-quality
content, you can improve your website's ranking in search
engine results.
---Internal and external links: Links help search engines
understand the structure of your site and determine your
site's relevance for certain search terms. Internal links are
links that point to other pages on your website, while
external links are links that point to other websites.

::: Website optimization :::


Website optimization involves a series of techniques that
are used to improve the functionality, speed and user
experience of a website. Some of these techniques include:

---Image Optimization: Images can have a huge impact on a


website's loading time. By optimizing your images, you can
reduce your website's loading time and improve user
experience.
---Code Minification: Code minification is the process of
removing all unnecessary characters from your code without
changing its functionality. This may include whitespace, line
breaks, and comments. Code minification can help reduce
your file size and your site's loading speed.
---CDN Usage: A content delivery network (CDN) is a
network of servers that are used to deliver content to users
based on their geographic location. By using a CDN, you can
improve your website's loading speed for users in different
parts of the world.

In summary, search engine optimization and website


optimization are essential components of web development.
By understanding and applying these techniques, you can
improve your website's visibility, increase traffic, and
provide a better experience for your users.
Answer the question about the previous content:

Exercise 121: How


important is search engine
optimization (SEO) in web
development?
( A ) - SEO is important because it allows developers to
create more visually appealing websites.
( B ) - SEO is important because it helps ensure that
websites are easily found by search engines like Google,
Bing, and Yahoo, which can increase website traffic and
visibility.
( C ) - SEO is important because it helps ensure that
websites are compatible with all web browsers.

Note: The correct answer is on the last page.


ANALYTICS AND
WEBSITE MONITORING
::: Chapter 72: Analytics and Website Monitoring :::
A crucial element in the journey to becoming an efficient
Front End developer is understanding and applying website
analysis and monitoring tools. These tools provide valuable
insights into user behavior, site performance, and areas for
improvement.
::: What is Analytics? :::
The term 'Analytics' refers to the systematic analysis of data
or statistics. In the context of web development, Analytics is
used to collect, report, and analyze website data. This helps
you understand user behavior and optimize the user
experience, leading to better conversion rates and greater
user satisfaction.
::: What is Website Monitoring? :::
Website monitoring is the process of testing and verifying
that end users can interact with a website or web
application as expected. Companies use website monitoring
to ensure that website performance and functionality are
maintained at acceptable levels.
::: Importance of Analytics and Website Monitoring :::
Analytics and website monitoring are vital to the success of
any website. They provide detailed information about site
traffic, how users interact with the site, which pages are
most popular, and where users are abandoning the site. This
information can be used to improve user experience,
increase conversion rates, and improve overall website
effectiveness.
::: Analytics and Website Monitoring Tools :::
There are several tools available for Analytics and website
monitoring. The most popular is Google Analytics, which
provides a wide range of data about website traffic,
including where visitors are coming from, time spent on the
website, pages visited, and more. Other popular tools
include Google Search Console, which helps monitor and
resolve SEO issues, and website monitoring tools such as
Pingdom and Uptime Robot, which monitor website
availability and uptime.
::: Integrating Analytics and Website Monitoring in Front End
Development :::
As a Front End developer, it's important to understand how
to integrate analytics and website monitoring tools into your
work. This may involve adding tracking code to your
website, setting up alerts to monitor website uptime, and
analyzing data reports to identify areas for improvement.
::: Conclusion :::
Analytics and website monitoring are essential components
of Front End development. They provide valuable insights
that can be used to improve the user experience and overall
website effectiveness. By becoming familiar with these tools
and learning how to integrate them into your work, you can
become a more efficient and effective Front End developer.
In our next chapter, we will explore more about SEO best
practices and how they can be applied to Front End
development. Stay tuned!
Answer the question about the previous content:

Exercise 122: How


important is Analytics and
Website Monitoring in
Front End development?
( A ) - They are irrelevant and do not affect the effectiveness
of the site.
( B ) - They provide detailed information about website
traffic, how users interact with the website, which pages are
most popular, and where users are abandoning the website.
This information can be used to improve user experience,
increase conversion rates, and improve overall website
effectiveness.
( C ) - They are only used to monitor website uptime and
have no impact on the user experience or effectiveness of
the website.

Note: The correct answer is on the last page.


UX/UI DESIGN FOR
DEVELOPERS
::: Chapter 73: UX/UI Design for Developers :::
As a front-end developer, one of the most important skills
you can acquire is a solid understanding of UX/UI design.
Although development and design are different fields, they
are closely linked and a good developer must understand
the basic principles of UX/UI design.
::: What is UX/UI Design? :::
UX (User Experience) and UI (User Interface) design are two
fundamental aspects of the design of a digital product. UX
refers to the overall experience a user has when interacting
with a product, while UI is about how the product is
presented and how the user interacts with it.
::: Why is UX/UI design important for developers? :::
Front-end developers are responsible for turning a product's
design into a functional reality. Therefore, having a solid
understanding of UX/UI design can help developers create
products that not only work well but also provide a pleasant
user experience. Furthermore, understanding UX/UI design
can facilitate communication between developers and
designers, improving efficiency and quality of work.
::: Basic principles of UX/UI design :::
Although UX/UI design is a vast field with many different
principles and techniques, here are some of the most
fundamental concepts that every developer should know:
::: 1. Focus on the user :::
The main purpose of UX/UI design is to provide a pleasant
experience for the user. Therefore, it is essential to consider
user needs and wants at every stage of the design process.
This may involve conducting user research, creating user
personas, and conducting usability testing.
::: 2. Consistency :::
Consistency is the key to good UX/UI design. This means
that similar elements must be designed in a similar way and
that the design must be consistent across all parts of the
product. Consistency helps make the product more
predictable and easier to use.
::: 3. Simplicity :::
Good UX/UI design is simple and intuitive. This does not
mean that the design should be boring or bland, but that it
should be easy for the user to understand and use. A simple
design can help reduce the learning curve and increase user
satisfaction.
::: 4. Feedback :::
Feedback is a crucial part of UX/UI design. This may involve
providing clear error messages when something goes
wrong, or visually indicating that an action was successful.
Feedback helps the user understand what is happening and
what they should do next.
::: Conclusion :::
Understanding UX/UI design is a valuable skill for any front-
end developer. Not only can this improve the quality of your
work, but it can also make you a more valuable member of
your team. Remember, UX/UI design isn't just about making
things pretty - it's about creating products that people
actually enjoy using.
Answer the question about the previous content:

Exercise 123: How


important is UX/UI design
for front-end developers?
( A ) - UX/UI design is irrelevant to developers as they are
only responsible for coding.
( B ) - UX/UI design is important for front-end developers
because it can help them create products that work well and
provide a pleasant user experience, as well as facilitate
communication between developers and designers.
( C ) - UX/UI design is only important for designers, not
developers.

Note: The correct answer is on the last page.


PROJECT MANAGEMENT
WITH AGILE AND
SCRUM
Project management with Agile and Scrum is an essential
approach for any front-end developer who wants to excel in
the field. This chapter of our e-book will cover the
importance of Agile and Scrum project management, as well
as provide an overview of how they work.
First, let's define what Agile and Scrum are. Agile is a project
management methodology that focuses on continually
improving product quality by encouraging ongoing
communication and collaboration among team members.
On the other hand, Scrum is a specific framework within
Agile that focuses on dividing a project into small,
manageable parts, called 'sprints'.
The Agile methodology is based on four fundamental values,
as established in the Agile Manifesto. These are: individuals
and interactions over processes and tools; working software
on top of comprehensive documentation; customer
collaboration above contract negotiation; and responding to
change over following a plan. The idea is that by focusing on
these values, the development team can produce high-
quality software more efficiently and effectively.
Scrum, on the other hand, is a specific way of implementing
Agile. It divides the project into work cycles called 'sprints',
which generally last two to four weeks. Each sprint begins
with a planning meeting, where the team determines what
will be done in the sprint. At the end of each sprint, the
team meets again to review the work and plan the next
sprint.
So why should a front-end developer care about Agile and
Scrum? Well, there are several reasons. First, Agile and
Scrum are widely used in the software development
industry. Having a solid understanding of these
methodologies will not only make you a more effective
member of any development team, but it will also make you
more attractive to potential employers.
In addition, Agile and Scrum can help improve the quality of
your work. By dividing a project into sprints, you can focus
on a small part of the project at a time. This makes it easier
to keep track of what you're doing and allows you to make
adjustments as needed to ensure the final product is the
best it can be.
Finally, Agile and Scrum can make the development process
more enjoyable. By encouraging ongoing communication
and collaboration, these methodologies can help create a
more positive and productive work environment.
Additionally, by dividing the project into sprints, you can feel
a regular sense of accomplishment, which can be very
motivating.
In summary, project management with Agile and Scrum is
an essential skill for any front-end developer. If you're
looking to improve the quality of your work, make yourself
more attractive to potential employers, or simply make the
development process more enjoyable, then learning about
Agile and Scrum is a great place to start.
We hope this chapter has provided a good introduction to
project management with Agile and Scrum. In the next
chapter, we'll dive deeper into how to implement these
methodologies in your own projects. Stay tuned!
Answer the question about the previous content:

Exercise 124: What is the


main difference between
Agile and Scrum in project
management?
( A ) - Agile focuses on breaking down a project into small,
manageable parts, while Scrum focuses on continually
improving product quality.
( B ) - Scrum is a project management methodology, while
Agile is a specific framework within Scrum.
( C ) - Agile is a project management methodology that
encourages continuous communication and collaboration,
while Scrum is a specific framework that divides the project
into 'sprints'.

Note: The correct answer is on the last page.


JOB INTERVIEW AND
CAREER DEVELOPMENT
FRONT END
::: Front End Development Job and Career Interview :::
If you're interested in becoming a Front End Developer,
you're on the right path to a rewarding career. With
companies' increasing dependence on technology and
online presence, the demand for Front End developers is on
the rise. However, as with any career, preparation and study
are necessary to stand out in a job interview and to achieve
career success.
::: Preparation for the Interview :::
Before going into the interview, it is essential that you have
a solid understanding of the three main programming
languages ??for Front End development: HTML, CSS and
Javascript. HTML is the markup language used to create the
structure and layout of a website, CSS is used to style the
website, and Javascript is used to make the website
interactive.
In addition to technical knowledge, it is important to have a
solid portfolio to show interviewers. Your portfolio should
include examples of your work that demonstrate your HTML,
CSS, and Javascript skills. This can include sites you've
created from scratch, as well as projects you've contributed
to.
::: Job Interview :::
During the interview, you will be asked about your
knowledge and experience in HTML, CSS and Javascript. You
may be asked to provide examples of problems you have
solved using these programming languages. Additionally,
you may be asked about your problem-solving skills and
your ability to work in a team.
It's important to remember that an interview is not just an
opportunity for the interviewer to evaluate you, but also an
opportunity for you to evaluate the company. Ask questions
about the company culture, growth opportunities, and how
the company supports its employees' professional
development.
::: Career in Front End Development :::
A career in Front End development can be very rewarding.
As a Front End developer, you will have the opportunity to
create and improve the user experience on websites and
applications. This may include making a website more
visually appealing, improving a website's functionality, or
making a website more accessible for users with disabilities.
In addition, as a Front End developer, you will have the
opportunity to work in a variety of sectors. This can include
technology companies, advertising agencies, nonprofits, and
more. This means you will have the opportunity to work on
projects that are meaningful to you.
Finally, a career in Front End development offers many
opportunities for professional growth. With experience and
continued education, you can advance to leadership roles or
specialize in areas such as user interface design, mobile app
development, or game development.
In conclusion, a career in Front End development is an
attractive option for those interested in technology and
design. With the right preparation and study, you can stand
out in a job interview and have a rewarding career as a
Front End developer.
Answer the question about the previous content:

Exercise 125: How


important are HTML, CSS
and Javascript
programming languages ​
for a Front End developer?
( A ) - HTML, CSS and Javascript are important for creating
the structure and layout of a website, styling the website
and making it interactive.
( B ) - HTML, CSS and Javascript are only important for
mobile app development.
( C ) - HTML, CSS and Javascript are only used to make a
website visually appealing.

Note: The correct answer is on the last page.


ALL ANSWERS
Exercise 1: ( A )
Exercise 2: ( C )
Exercise 3: ( C )
Exercise 4: ( C )
Exercise 5: ( B )
Exercise 6: ( B )
Exercise 7: ( C )
Exercise 8: ( C )
Exercise 9: ( A )
Exercise 10: ( B )
Exercise 11: ( A )
Exercise 12: ( B )
Exercise 13: ( A )
Exercise 14: ( C )
Exercise 15: ( C )
Exercise 16: ( B )
Exercise 17: ( C )
Exercise 18: ( B )
Exercise 19: ( B )
Exercise 20: ( C )
Exercise 21: ( A )
Exercise 22: ( C )
Exercise 23: ( A )
Exercise 24: ( B )
Exercise 25: ( B )
Exercise 26: ( A )
Exercise 27: ( B )
Exercise 28: ( C )
Exercise 29: ( A )
Exercise 30: ( C )
Exercise 31: ( B )
Exercise 32: ( B )
Exercise 33: ( B )
Exercise 34: ( B )
Exercise 35: ( A )
Exercise 36: ( C )
Exercise 37: ( B )
Exercise 38: ( B )
Exercise 39: ( B )
Exercise 40: ( B )
Exercise 41: ( A )
Exercise 42: ( C )
Exercise 43: ( B )
Exercise 44: ( B )
Exercise 45: ( C )
Exercise 46: ( A )
Exercise 47: ( A )
Exercise 48: ( B )
Exercise 49: ( B )
Exercise 50: ( A )
Exercise 51: ( B )
Exercise 52: ( B )
Exercise 53: ( B )
Exercise 54: ( B )
Exercise 55: ( C )
Exercise 56: ( B )
Exercise 57: ( C )
Exercise 58: ( C )
Exercise 59: ( A )
Exercise 60: ( B )
Exercise 61: ( A )
Exercise 62: ( B )
Exercise 63: ( B )
Exercise 64: ( A )
Exercise 65: ( B )
Exercise 66: ( B )
Exercise 67: ( A )
Exercise 68: ( B )
Exercise 69: ( A )
Exercise 70: ( C )
Exercise 71: ( C )
Exercise 72: ( C )
Exercise 73: ( B )
Exercise 74: ( A )
Exercise 75: ( B )
Exercise 76: ( C )
Exercise 77: ( B )
Exercise 78: ( A )
Exercise 79: ( C )
Exercise 80: ( B )
Exercise 81: ( B )
Exercise 82: ( A )
Exercise 83: ( A )
Exercise 84: ( B )
Exercise 85: ( B )
Exercise 86: ( B )
Exercise 87: ( C )
Exercise 88: ( C )
Exercise 89: ( A )
Exercise 90: ( B )
Exercise 91: ( C )
Exercise 92: ( B )
Exercise 93: ( A )
Exercise 94: ( C )
Exercise 95: ( A )
Exercise 96: ( B )
Exercise 97: ( B )
Exercise 98: ( B )
Exercise 99: ( C )
Exercise 100: ( B )
Exercise 101: ( B )
Exercise 102: ( B )
Exercise 103: ( B )
Exercise 104: ( C )
Exercise 105: ( C )
Exercise 106: ( B )
Exercise 107: ( D )
Exercise 108: ( C )
Exercise 109: ( B )
Exercise 110: ( B )
Exercise 111: ( C )
Exercise 112: ( A )
Exercise 113: ( A )
Exercise 114: ( C )
Exercise 115: ( B )
Exercise 116: ( B )
Exercise 117: ( B )
Exercise 118: ( B )
Exercise 119: ( A )
Exercise 120: ( C )
Exercise 121: ( B )
Exercise 122: ( B )
Exercise 123: ( B )
Exercise 124: ( C )
Exercise 125: ( A )
End.
To get Premium access to the Cursa app, follow these steps:

1 - Download the application through the QR CODE on the


cover of this e-book;
2 - Register normally;
3 - Send an email to contato@cursa.app informing the email
you used to register in the Cursa app.
4 - Okay, now you have access to the applications Premium
features.

Author:Adrian Medeiros Dantas


Brazilian company: Medeiros Tecnologia LTDA - CNPJ:
24.471.978/0001-08

You might also like