The Absolute Beginner's Guide to HTML and CSS: A Step-by-Step Guide with Examples and Lab Exercises 1st Edition Kevin Wilson - Read the ebook online or download it to own the complete version
The Absolute Beginner's Guide to HTML and CSS: A Step-by-Step Guide with Examples and Lab Exercises 1st Edition Kevin Wilson - Read the ebook online or download it to own the complete version
com
https://ebookmeta.com/product/the-absolute-beginners-guide-
to-html-and-css-a-step-by-step-guide-with-examples-and-lab-
exercises-1st-edition-kevin-wilson/
OR CLICK HERE
DOWLOAD EBOOK
https://ebookmeta.com/product/using-publisher-2019-the-step-by-step-
guide-to-using-microsoft-publisher-2019-1st-edition-kevin-wilson/
ebookmeta.com
https://ebookmeta.com/product/java-a-step-by-step-guide-for-absolute-
beginners-1st-edition-daniel-bell/
ebookmeta.com
https://ebookmeta.com/product/quality-enhancement-in-madrasa-
education-an-exploratory-study-1st-edition-k-mohammed-basheer/
ebookmeta.com
Culture and Psychology 6th Edition David Matsumoto
https://ebookmeta.com/product/culture-and-psychology-6th-edition-
david-matsumoto/
ebookmeta.com
https://ebookmeta.com/product/the-law-of-fundraising-2021-cumulative-
supplement-5th-edition-hopkins/
ebookmeta.com
https://ebookmeta.com/product/evidence-based-critical-care-a-case-
study-approach-robert-c-hyzy/
ebookmeta.com
https://ebookmeta.com/product/the-taking-of-house-westwood-the-
chronicles-of-muurland-book-1-1st-edition-trent-evans/
ebookmeta.com
https://ebookmeta.com/product/i-think-and-write-therefore-you-are-
confused-tehnical-writing-and-the-language-interface-1st-edition-
vahid-paeez/
ebookmeta.com
Sustainability Transformations, Social Transitions and
Environmental Accountabilities Beth Edmondson
https://ebookmeta.com/product/sustainability-transformations-social-
transitions-and-environmental-accountabilities-beth-edmondson/
ebookmeta.com
The Absolute
Beginner’s Guide
to HTML and CSS
A Step-by-Step Guide with
Examples and Lab Exercises
—
Kevin Wilson
The Absolute
Beginner’s Guide to
HTML and CSS
A Step-by-Step Guide
with Examples and
Lab Exercises
Kevin Wilson
The Absolute Beginner’s Guide to HTML and CSS: A Step-by-Step Guide
with Examples and Lab Exercises
Kevin Wilson
WIDNES, UK
Introduction���������������������������������������������������������������������������������������xiii
iii
Table of Contents
iv
Table of Contents
Adding Lists��������������������������������������������������������������������������������������������������������69
Unordered List�����������������������������������������������������������������������������������������������69
Ordered List���������������������������������������������������������������������������������������������������70
Structuring Your Web Page���������������������������������������������������������������������������������70
Lab Exercises������������������������������������������������������������������������������������������������������72
Summary������������������������������������������������������������������������������������������������������������73
v
Table of Contents
Chapter 6: Multimedia����������������������������������������������������������������������135
Adding Video�����������������������������������������������������������������������������������������������������135
Adding Audio�����������������������������������������������������������������������������������������������������139
Adding Image Maps������������������������������������������������������������������������������������������140
Lab Exercises����������������������������������������������������������������������������������������������������145
Summary����������������������������������������������������������������������������������������������������������146
vi
Table of Contents
Lab Exercises����������������������������������������������������������������������������������������������������166
Summary����������������������������������������������������������������������������������������������������������167
Index�������������������������������������������������������������������������������������������������235
vii
About the Author
With over 20 years of experience in the computer industry, Kevin Wilson
has made a career out of technology and is showing others how to use it.
After earning a master’s degree in computer science, software engineering,
and multimedia systems, Kevin has held various positions in the IT
industry including graphic and web design, digital film and photography,
programming and software engineering, developing and managing
corporate networks, building computer systems, and IT support. He
currently teaches computer science at college and works as an IT trainer in
England while researching for his Ph.D.
ix
About the Technical Reviewer
Jonathon Simpson is a product owner and engineer living in the UK. He
graduated from UCL in 2015. With many years of experience, he has
developed and run many successful projects both independently and in
large companies. He produces a popular software engineering blog called
fjolt.com and posts regular newsletters about the latest developments and
trends in JavaScript and web development.
xi
Introduction
The aim of this book is to provide a first course in the use of HTML
and CSS.
It provides a foundation for those who wish to develop their own
websites, and because the book is intended to be a primer, it allows the
beginner to become comfortable with basic HTML and CSS coding.
As it is a first course, no previous experience of computer
programming is assumed.
Throughout the book, we’ll explore HTML and CSS with worked
examples and lab exercises for you to complete yourself. We’ll also
introduce JavaScript and how it can be used to add interactivity to a
website, as well as using content management systems such as WordPress.
For this purpose, we’ve included all the source code for this book in
the following repository: https://github.com/Apress/The-Absolute-
Beginner-s-Guide-to-HTML-and-CSS
xiii
CHAPTER 1
Getting Started
Originally developed in the early 1990s by Tim Berners-Lee, HTML stands
for HyperText Markup Language and is a language used to lay out and
format documents for the World Wide Web that are designed to be displayed
in a web browser. In other words, the HTML code describes the structure of
a web page. HTML can be used with other technologies such as Cascading
Style Sheets (CSS) to style and format the document and scripting languages
such as JavaScript to provide functionality and interactive elements.
Basic knowledge of HTML is essential for students and anyone working
in web development. This will help you
2
Chapter 1 Getting Started
What Is a URL?
Each website on the World Wide Web has an address called a URL
(Figure 1-2) or Uniform Resource Locator.
The URL itself can be broken down into its basic elements. Let’s take a
closer look at an example:
https://www.ellumitechacademy.com
3
Chapter 1 Getting Started
mail.ellumitechacademy.com
shop.ellumitechacademy.com
www.ellumitechacademy.com/courses
www.ellumitechacademy.com/courses/html
If we want to access a web page or a file for download, we add the path
and file name of the file or document:
www.ellumitechacademy.com/aboutus.html
www.ellumitechacademy.com/downloads/menu.pdf
4
Chapter 1 Getting Started
Of course, these files and directories would need to exist in the public_
html or htdocs directory on the web server (Figure 1-3). Here, we can see
the courses and downloads directories on the server.
Index Pages
Websites are built inside directories on a web server. The index file is the
default page displayed if no other page is specified when a visitor enters
the URL into their web browser. This index file could be index.html, index.
php, or index.py depending on which language you’re using to develop
your site. For now, we’ll use index.html.
In our example, we have a directory structure on our web server
(Figure 1-4).
5
Chapter 1 Getting Started
www.ellumitechacademy.com/courses
the web server will look in the directory for the index.html file:
www.ellumitechacademy.com/courses/index.html
If the index.html file is missing, the web server will attempt to display a
list of files, or you’ll see an error message (Figure 1-5).
6
Chapter 1 Getting Started
HTML5
HTML5 brings device independence, meaning websites can be developed
for all different types of platforms, from PCs to smartphones, without the
need to endlessly install plugins on your browser or develop multiple
versions of a website for mobile devices as we can see in Figure 1-6.
HTML5 also introduces some new tags to handle page structure such
as <section>, <head>, <nav>, <aside>, and <footer> and some tags to
handle media such as <audio> or <video>.
We’ll take a look at some of the new HTML5 features later in this guide.
What Is CSS?
Cascading Style Sheets (CSS) are used to define and customize the styles
and layout for your web pages. This means you can create style sheets to
alter the design, layout, and responsiveness to different screen sizes on
various devices from computers to smartphones.
7
Chapter 1 Getting Started
You can either add your CSS declarations to the <head> section of
your HTML document between the <style>…</style> tags or add your CSS
declarations to a separate style.css file and add a link in the <head> section
of your HTML document using
This is a better way since it allows you to change the styles in one place
rather than in each HTML page you create.
We’ll take a closer look at CSS later in Chapter 4 of this book.
8
Chapter 1 Getting Started
Hosting
For hosting your website, you have three options:
aprelium.com/downloads
9
Chapter 1 Getting Started
Select the Windows version (or the Mac version if you’re using a Mac)
(Figure 1-9).
10
Chapter 1 Getting Started
Choose a directory where you want to install Abyss Web Server files.
Click “Install” (Figure 1-11).
On your start menu, click “Abyss Web Server X1” (Figure 1-12).
11
Chapter 1 Getting Started
Create your login details – don’t forget these. Enter a login username
(e.g., admin) and a password (Figure 1-14). Click OK when you’re done.
12
Chapter 1 Getting Started
When the browser asks you for a username and password, enter the
username and password you chose earlier (Figure 1-15).
13
Chapter 1 Getting Started
The server will appear in the system area on the bottom right-hand
side (Figure 1-17).
14
Chapter 1 Getting Started
Local Machine
If you have installed Abyss Web Server on your local machine, any pages
you develop on your website will be saved into the following folder:
You’ll find the folder in File Explorer on the C drive (Figure 1-18).
15
Chapter 1 Getting Started
Once the server is running, you’ll be able to access your web page from
a web browser by navigating to
http://localhost/pagename.html
or
http://127.0.0.1/pagename.html
http://localhost/index.html
http://localhost/store.html
filezilla-project.org/download.php
16
Chapter 1 Getting Started
Click “New site,” then enter the FTP hostname or IP address, then add
your username and password (Figure 1-20).
17
Chapter 1 Getting Started
In the pane on the left-hand side, navigate to the folder where you save
all your HTML files into. In the pane on the right-hand side, navigate to the
htdocs or public_html folder on the web server (Figure 1-21).
18
Chapter 1 Getting Started
wiki.filezilla-project.org/Documentation
19
Chapter 1 Getting Started
Another popular IDE is Visual Studio Code or VS Code for short. You
can download VS Code from the following website:
code.visualstudio.com
In Figure 1-24, we can see VS Code on the left-hand side showing our
HTML code with a browser preview open on the right showing the output
of the HTML code.
20
Chapter 1 Getting Started
Another code editor to try is Brackets. Brackets is a free editor that you
can download from the developer’s website:
www.brackets.io
In Figure 1-25, you can see the Brackets window open on the left-hand
side, and it makes quite a nice little editor for coding. On the right-hand
side, you can open up your live preview to see what your page looks like as
you’re writing your code.
21
Chapter 1 Getting Started
You can use any of these tools to write your code. Some of these IDEs
can be quite complex, so while you are learning, I suggest you stick with
Notepad and write the code manually so you can understand the structure
and meaning without distractions.
Throughout this book, we’ll be using Notepad/TextEdit to write our
code as shown in Figure 1-26; however, you can use any code editor you
like such as VS Code if you prefer.
22
Chapter 1 Getting Started
Lab Demo
In this demo, we’re going to explore how web servers work.
In Figure 1-27, the machine on the right has our web server installed.
A web server is a program that runs on the machine and serves web
pages (such as Abyss that we installed earlier). The web server software is
bound to a port. A port is a number used to identify a service running on a
machine. In this case, the service is a web server and is bound to port 80.
This machine is connected to a small network using cat5 cables through a
network switch.
23
Chapter 1 Getting Started
The web server running on the machine on the right is pointing at the
public_html or htdocs directory stored on the machine’s hard drive. Here,
we can see we have an index.html file in the public_html directory on our
server (Figure 1-28). This is called the document root.
• IP address: 192.168.0.100
• Port: 80
24
Chapter 1 Getting Started
This laptop connects to the web server using the IP address allocated
to the machine running the web server. On the laptop, we can type this
IP address into the address bar at the top of the browser: 192.168.0.100
(Figure 1-30).
The laptop will connect to the web server using the server’s IP address
through port 80 (Figure 1-31).
25
Chapter 1 Getting Started
The IP address and the port number form a socket. There will be a
socket on the server and one on the laptop (client). Each socket is unique
and bidirectional, so applications can send and receive data (Figure 1-33).
26
Chapter 1 Getting Started
27
Chapter 1 Getting Started
Your computer (i.e., the laptop) then uses this IP address to connect to
the web server as before.
Lab Exercises
1. Set up your personal web server on your computer
or get access to a web host to host your HTML files.
3. What is hypertext?
4. What is a URL?
5. What is HTML?
28
Chapter 1 Getting Started
6. What is CSS?
9. What is an IP address?
Summary
• Web pages are all linked together using clickable text or
images, called hyperlinks.
• VS Code
• Dreamweaver
• Brackets
29
Another Random Scribd Document
with Unrelated Content
"Ah", kuiskasi kreivi, "ah!"
239.
Lupaukset.
"En lupaa teille olla iloinen", vastasi nuori mies, "mutta olkaa
varma, etten kuluta hetkeäkään teitä ajattelematta, en hetkeäkään,
sen vannon, ellen ole kuollut."
"Mutta", esteli Raoul vielä, "ethän voi näin jättää herra kreiviä
yksikseen; kreivin luota et ole koskaan poistunut?"
Sekä isä että poika tunsivat kuitenkin, että heidän kulkunsa oli
päättymässä julmaan tuskaan. Tuli se kauhea hetki, jolloin sotilaat
jättääkseen rannan hietikon vaihtoivat perheittensä ja ystäviensä
kanssa viimeiset suudelmat, haikea eronhetki, jolloin taivaan
puhtaasta sinestä, auringon helteestä, ilman kiehtovista tuoksuista,
suonissa virtaavasta suloisesta elämästä huolimatta kaikki näyttää
mustalta, kaikki tuntuu karvaalta, kaikki saattaa epäilemään Jumalan
olemassaoloa Jumalasta puhuessaankin.
Oli tavallista, että amiraali seurueineen astui laivaan viimeisenä.
Kanuuna odotteli ilmoittaakseen peloittavalla mylvähdyksellä, että
päällikkö oli saapunut lippulaivan kannelle.
240.
Naisten parissa.
Hän kuuli, että kuningas oli näiden parin viikon ajan esiintynyt
hyvin synkkänä. Leskikuningatar sairasteli pahoin ja tuntui ihan
murtuneelta. Orléansin herttua oli kääntynyt harrasmieliseksi;
Madame poti heikkohermoisuutta, ja kreivi de Guiche oli
matkustanut eräälle maatilalleen.
"Ja laivaston?"
"Kaikki."
"Onko meillä siellä ystäviämme?" uteli neiti de Tonnay-Charente
kylmäkiskoisesti, mutta saaden harkittua painoa viime sanalle.
La Vallière vaaleni.
"Keltaisia!"
"Ja jos hän siis kuolee", jatkoi leppymätön, "niin sinä olet hänet
tappanut; se on kamala teko."
"Tallessaan, sire."
Kuningas kalpeni.
D'Artagnan kumarsi.
"Ahaa!"
Uusi äänettömyys.
"Bretagnessa."
"Luonnollisesti."
"Minä kuuntelen."
"Huomattavimpien?"
"Niin."
"Niin."
"Herra Letellierin?"
"Niin."
"Herra de Briennen?"
"Niin."
"Kyllä, sire."
241.
Ehtoollinen.
D'Artagnan hymyili.
"Minne lähtisin?"
"Minä jään", päätti Fouquet; "enkähän toki ole ihan vailla turvaa."