Documente Academic
Documente Profesional
Documente Cultură
Howdoyoucreatewebsites?BuildyourwebsitewithHTML5andCSS3
Welcome to OpenClassrooms! By continuing on the site, you are agreeing to our use of cookies. Read more
OK
Home
Course
20 hours
Easy
License
https://openclassrooms.com/courses/buildyourwebsitewithhtml5andcss3/howdoyoucreatewebsites
1/14
11/10/2016
Howdoyoucreatewebsites?BuildyourwebsitewithHTML5andCSS3
With a browser, you can visit any website. Here, for example, is a browser displaying the famous Wikipedia website (see
next figure).
A website: Wikipedia
I'm sure you're used to using a web browser! Everyone now knows how to surf on the Web... but who really knows how the
Web works? How to design websites like this one?
I've heard of HTML and CSS. Do they have something to do with how websites work?
Absolutely!
They are computer languages for creating websites. All websites are based on these languages, which are now essential
and used everywhere. They are the very foundation of the Web. HTML was first invented by Tim Berners-Lee in 1991...
Tim Berners-Lee still closely follows Web developments. He created the World Wide Web Consortium (W3C) that defines
new versions of these languages. More recently, he also created the World Wide Web Foundation, which analyses and
tracks Web developments.
Many people wrongly confuse the Internet and the Web. You should know that the Web is part of the Internet.
The Internet is thus a large system that includes, among other things: the Web, e-mails, instant messaging, etc.
Tim Berners-Lee thus did not invent the Internet, but "only" the Web.
The HTML and CSS languages are the basis of how all websites work. When you visit a website with your browser, you
should know that behind the scenes wheels are turning to allow the website to be displayed. The computer bases itself on
what was explained to it in HTML and CSS to know what to display (see next figure).
https://openclassrooms.com/courses/buildyourwebsitewithhtml5andcss3/howdoyoucreatewebsites
2/14
11/10/2016
Howdoyoucreatewebsites?BuildyourwebsitewithHTML5andCSS3
HTML and CSS are two "languages" you have to know how to speak to create websites. The web browser does the
translation between these programming languages and what you see on the screen.
You're probably wondering why you need to know two languages to create websites? I'll answer that straight away!
To create a website, you have to give instructions to the computer. It's not enough to simply type the text you want to put
in your website (as you would in a word processor such as Word, for example). You also have to show it where to put text,
insert images, create links between pages, etc.
https://openclassrooms.com/courses/buildyourwebsitewithhtml5andcss3/howdoyoucreatewebsites
3/14
11/10/2016
Howdoyoucreatewebsites?BuildyourwebsitewithHTML5andCSS3
Why were two languages created? Wouldn't just one have been enough?
You are probably thinking that handling two languages is going to be twice as complex and take twice as long to learn... but
this is not so! I can assure you, if there are two languages, this was designed to make things easier. We'll be dealing with
two languages that complement each other as they have dierent roles:
HTML (HyperText Markup Language): first appeared in 1991 when the Web was launched. Its role is to manage and
organize content. You thus use HTML to write what you want the page to display: text, links, images, etc. You might
say for example: "This is my title, this is my menu, here's the main text of the page, here's an image to be displayed,
etc.".
CSS(Cascading Style Sheets): the role of CSS is to manage the look of the website (layout, positioning, design, color,
text size, etc.). This language was introduced to complement HTML in 1996.
You may also have heard of the XHTML language. This is a variant of HTML that is more rigorous and thus a bit
trickier to handle.
Simply put, HTML appeared first in 1991. At the start of 2000, the W3C launched XHTML indicating that it
represented the future... but XHTML was not as successful as hoped. So it was back to basics in 2009: the W3C
abandoned XHTML and decided to return to, and upgrade, HTML.
There is much confusion about these languages, as they are very similar. Neither one is really better than the other.
It's just two dierent ways of doing things. In this course, we are going to work with the latest version of HTML
(HTML5) which is now the language of the future that everyone is encouraged to use.
You can quite well create a website in HTML only, but it won't look very nice: the information will be displayed "granularly".
This is why the CSS language is always used to complete it.
To give you an idea of this, the next figure shows how the same page looks without CSS and then with CSS.
https://openclassrooms.com/courses/buildyourwebsitewithhtml5andcss3/howdoyoucreatewebsites
4/14
11/10/2016
Howdoyoucreatewebsites?BuildyourwebsitewithHTML5andCSS3
HTML defines the content (as you can see, it's rough around the edges!). CSS is used to arrange the content and define the
presentation: color, background image, margins, text size, etc.
As you can imagine, CSS needs an HTML page to work. This is why we are first going to learn the basics of HTML before
going on to deal with the decoration aspect in CSS.
As a result, your first pages won't be very nice to look at, but who cares! This won't last very long.
https://openclassrooms.com/courses/buildyourwebsitewithhtml5andcss3/howdoyoucreatewebsites
5/14
11/10/2016
Howdoyoucreatewebsites?BuildyourwebsitewithHTML5andCSS3
improvements in forms etc. More importantly, this version for the first time allowed the use of style sheets, our
famous CSS!
HTML 5: this is THE latest version. Still not very widespread, it attracts a lot of attention as it provides many
improvements such as the ability to include videos easily, a better layout of content, new features for forms, etc.
This is the version that we are going to find out about together.
CSS versions
CSS 1: from 1996, the first version of CSS was used. It laid the foundations of this language which allows you to
display your web page, with colors, margins, fonts, etc.
CSS 2: appeared in 1999 and was then completed by CSS 2.1. This new version of CSS added numerous options. We
can now use very accurate positioning techniques to display items where we want them on the page.
CSS 3: this is the latest version, which added eagerly awaited features such as rounded edges, gradients, shadows,
etc.
Note that HTML5 and CSS3 are not versions that have been fully finalized by the W3C. However, even though there
may be minor changes to these languages, I highly recommend that you start with these new versions today. They
make many contributions and are worth while. Also, many professional websites are now built using these latest
versions.
https://openclassrooms.com/courses/buildyourwebsitewithhtml5andcss3/howdoyoucreatewebsites
6/14
11/10/2016
Howdoyoucreatewebsites?BuildyourwebsitewithHTML5andCSS3
Strange but true: you can quite well design a website just using Notepad, the text editing soware included as default in
Windows. I have to admit that this is how I started myself a few years ago.
However, more powerful soware is now available and no one really uses Notepad any more. These website design
programs can be classified as two categories:
WYSIWYG (What You See Is What You Get): these are programs that are very easy to use and allow you to create
websites without learning any particular language. The best known of them include: Nvu, Microso Expression Web,
Dreamweaver... and even Word! Their main drawback is the quality of the HTML and CSS code that is automatically
generated by these tools, and which is oen of rather poor quality. A good website designer will sooner or later have
to know HTML and CSS, and this is why I do not recommend the use of these tools.
Text editors: these are programs for writing code. They can generally be used for other languages, not just HTML
and CSS. They are proving to be powerful allies for website designers!
As you've gathered, I'm going to get you to use a text editor in this course. Here are a few tips, according to whether you're
running Windows, Mac OS X or Linux.
In Windows
There are plenty of text editors and I don't intend to mention them all. However, do have a look at Notepad++, one of the
most widely used text editors in Windows. This program is simple to use and free.
Notepad++ website
Here is what Notepad++ looks like when you launch it (see next image).
https://openclassrooms.com/courses/buildyourwebsitewithhtml5andcss3/howdoyoucreatewebsites
7/14
11/10/2016
Howdoyoucreatewebsites?BuildyourwebsitewithHTML5andCSS3
Notepad++
I suggest you follow these steps: choose the Language > H > HTML . This will tell the soware that HTML language is
about to be typed.
When you use the soware, it will color your code to allow you to identify it more easily:
https://openclassrooms.com/courses/buildyourwebsitewithhtml5andcss3/howdoyoucreatewebsites
8/14
11/10/2016
Howdoyoucreatewebsites?BuildyourwebsitewithHTML5andCSS3
Colors in Notepad++
For the time being, do not worry about what all this gibberish means. I just wanted to give you an overview of what
the soware can do.
Other publishers are available in Windows. If you don't like Notepad++, you can try:
jEdit;
PSpad;
ConTEXT;
... and many others by just searching for "Text editor" on the Web.
In Mac OS X
You can try one of the following programs:
jEdit;
Smultron ;
TextWrangler.
In Linux
There are many Text editors in Linux. Some of them are installed as default, while others can be easily downloaded from
the Download Center (in Ubuntu in particular) or via commands like aptget and aptitude . Here are some programs
that you can test:
https://openclassrooms.com/courses/buildyourwebsitewithhtml5andcss3/howdoyoucreatewebsites
9/14
11/10/2016
Howdoyoucreatewebsites?BuildyourwebsitewithHTML5andCSS3
gEdit;
Kate;
vim;
Emacs;
jEdit.
Browsers
Why a browser is important
A browser is a program that lets you see websites. If you can read this, it means that your browser is open and you are
displaying it. As I explained earlier, a browser's job is to read the HTML and CSS code to display a visual result on the
screen. If your CSS code says "The titles are in red," the browser will display the titles in red. The browser's role is thus
essential!
You wouldn't think so, but a browser is an extremely complex program. Understanding HTML and CSS code is indeed no
small matter. The main problem, as you will quickly realize, is that browsers do not display all websites in exactly the same
way! You'll have to get used to this and get into the habit of regularly checking that your website works properly on most
browsers.
Browsers on computers
Downloading browsers
There are many dierent browsers. The main ones you should know are shown in the next figure.
Browser
OS
Download
Comments
Google Chrome
Windows
Download
Mac
Linux
Google Chrome
Mozilla Firefox
Windows
Mac
Linux
Download
Firefox Logo
https://openclassrooms.com/courses/buildyourwebsitewithhtml5andcss3/howdoyoucreatewebsites
10/14
11/10/2016
Howdoyoucreatewebsites?BuildyourwebsitewithHTML5andCSS3
Browser
OS
Download
Comments
Internet
Windows
Download
(Pre-installed in
Windows)
PCs.
I use it frequently to test my websites.
Windows
Mac
Download
(Pre-installed in Mac OS
X)
Windows
Mac
Linux
Download
Explorer
IE9
Safari
Safari Logo
Opera
Opera Logo
It is advisable to install several browsers on your computer to make sure that your website works properly on each
one. In general, I recommend you test your website regularly on Google Chrome, Mozilla Firefox and Internet
Explorer at least.
Note that Safari and Google Chrome display websites in much the same way. You do not necessarily need to test
your website on both Safari and Google Chrome, although it is always safer.
In the next figure, you can see a preview of some of these main browsers on the Google homepage.
11/14
11/10/2016
Howdoyoucreatewebsites?BuildyourwebsitewithHTML5andCSS3
There's a program called IETester in Windows which allows you to test your website in various versions of Internet
Explorer. Note that while this program is relatively unstable (it oen crashes), at least it exists.
https://openclassrooms.com/courses/buildyourwebsitewithhtml5andcss3/howdoyoucreatewebsites
12/14
11/10/2016
Howdoyoucreatewebsites?BuildyourwebsitewithHTML5andCSS3
Touch pads are provided with the same browsers, but the screen is just wider. Thus, the iPad is provided with
Safari Mobile for example.
Summing up
The Web was invented by Tim Berners-Lee in the early 90's.
To create websites we use two computer languages:
HTML, which lets you write and organise the content of your page (paragraphs, titles...);
CSS, which lets you format the page (color, size...).
There has been multiple versions of HTML and CSS. The last ones are HTML5 and CSS3
A web browser is a soware which displays websites. It reads HTML and CSS languages to know what it must
display.
Lots of dierent web browsers exist: Google Chrome, Mozilla Firefox, Internet Explorer, Safari, Opera... Each one will
display websites slightly dirently than the others.
In this course, we will learn how to use HTML and CSS languages. We will work in a soware called a "text editor"
(Notepad++, jEdit, vim...).
https://openclassrooms.com/courses/buildyourwebsitewithhtml5andcss3/howdoyoucreatewebsites
13/14
11/10/2016
Howdoyoucreatewebsites?BuildyourwebsitewithHTML5andCSS3
The authors
Mathieu Nebra
Entrepreneur plein temps, auteur plein temps et co-fondateur d'OpenClassrooms :o)
Emily Reese
Emily's from New York City and lives in Paris, France. She's a web developer (formerly at Kickstarter), teacher at
OpenClassrooms, and more!
Premium
eBook
OpenClassrooms
Partnerships
Learn more
Follow us
Who we are
Business
Terms of Use
OpenClassrooms blog
Contact us
Espaol
https://openclassrooms.com/courses/buildyourwebsitewithhtml5andcss3/howdoyoucreatewebsites
Franais
14/14