Nicolas Feer
Wifi: 3DK_4G-CA_WIFI-B9A2
Password: bowlings
Nicolas Feer
An introduction to HTML, CSS & JavaScript
Nicolas Feer
Ask for help when needed & have fun!
because you can :
to build a website :
content
+ structure
design
behavior
HTML is a markup language.
It structures the content of a web page.
Cause in order to design and animate its elements,
we have to organize them first
The Internet is REAL and it's made by us.
<!DOCTYPE html>
<!-- end of file --><!DOCTYPE html>
<html>
<!-- your content (text, images,...)
and all the other html tags
to structure this content goes here -->
</html>
<!-- end of file --><!DOCTYPE html>
<html>
<head>
<!-- intelligence (meta-data) -->
</head>
<body>
<!-- stuff to be displayed on your web page -->
</body>
</html>
<!-- end of file --><!DOCTYPE html>
<html>
<head>
<title>My first web page</title>
<!-- text appearing in the tab + used by Google in its search results -->
<meta charset="utf-8"/>
<!-- to display properly the special characters -->
</head>
<body>
<!-- stuff to display in the page -->
</body>
</html>
<!-- end of file --><!DOCTYPE html>
<html>
<head>
<title>Hello world</title>
<!-- Text appearing in the tab + used by Google in its search results -->
<meta charset="utf-8"/>
<!-- To display properly the special characters -->
</head>
<body>
<h1>Hello buddies!</h1>
<!-- Stuff to display in the page -->
</body>
</html>
<!-- end of file --><element_name>element_content</element_name>
opening tag
closing tag
-------------
---------------
<element_name attribute_name="attribute_value">element_content</element_name>
opening tag
closing tag
-------------------------------------------
---------------
result => Le Wagon
QUIZ:
<h1>[...]</h1> <!-- Only one per page! SEO important -->
<h2>[...]</h2>
<h3>[...]</h3>
<h4>[...]</h4>
<h5>[...]</h5>
<h6>[...]</h6>titles
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
But the painful truth resilience at all by any law
inventor worse for them or just leave offices
there is nothing, which is an impediment to the time to follow?
</p>paragraphs
<h2>Shopping List</h2>
<ul>
<li>Milk</li>
<li>Butter</li>
</ul>
<h2>World Cup 2014</h2>
<ol>
<li>Germany</li>
<li>Argentina</li>
<li>Netherlands</li>
<li>Brazil</li>
</ol>lists
<img src="logo.png" alt="Le Wagon logo"/>images
graphical icons
You can get these icons both in :
<a href="http://www.lewagon.org" target="_blank">Le Wagon</a>links
<!DOCTYPE html>
<html>
<head>
</head>
<body>
</body>
</html>
<!-- end of file -->Setup your web page's overall html structure
<head>
<title>Hello world</title>
<!-- text appearing in the tab + used by Google in its search results -->
<meta charset="utf-8"/>
<!-- to display properly the special characters -->
</head>Setup your web page's head
<body>
<h1>My playground app</h1>
<p>A toy app to play with HTML and CSS</p>
<h2>Fast</h2>
<p>A fast app, <strong>very fast</strong> app</p>
<img src="#" alt="quick">
<h2>Simple</h2>
<p>A simple app, <strong>very simple</strong> app</p>
<img src="#" alt="simple">
<p>This page was coded by me!</p>
</body>Setup your web page's body
<img src="rocket.png">resources
CSS is used to add some style properties
to specific HTML elements
What would this website workuper.com look like without any CSS ?
For your CSS stylesheet to be taken into account, you need to
add a link to it in the head of the HTML document
/* syntax 1 : color name in English */
body {
color: orange;
}color
/* syntax 2 : hexadecimal color reference */
body {
color: # FFA500;
}color
/* syntax 3-a : RGB color reference */
body {
color: rgb(255, 165, 0);
}color
/* syntax 3-b : RGBA color & opacity reference */
body {
color: rgba(255, 165, 0, 0.8);
}color
RGBA has a 4th parameter: opacity
(which may vary between 0 and 1)
color tools
text color vs
background color
background image
fonts - family (1)
fonts - family (2)
fonts - family (3)
fonts - size & spacing
fonts - color
fonts - decoration
fonts - alignment
Google Fonts is a collection of beautiful web fonts that Google makes available for anyone for free
<h1><i class="fa fa-cutlery"></i> MY RESTAURANT</h1><link href="style.css" rel="stylesheet">body{
margin: 0px;
color: green;
background: rgb(245,245,245);
}
h1 {
font-family: courier;
color: rgb(212,57,43);
}
p {
font-size: 30px;
line-height: 20px;
}<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<ul>
<li>
<a href="#"> <i class="fa fa-facebook"></i> </a>
</li>
<li>
<a href="#"> <i class="fa fa-twitter"></i> </a>
</li>
<li>
<a href="#"> <i class="fa fa-youtube"></i> </a>
</li>
<li>
<a href="#"><i class="fa fa-pinterest"></i></a>
</li>
</ul>
<p>This page was coded by me!</p>picture size & shape
divisions and box model
Any modern website...
... is made of <div>
divisions and box model
=> structure your HTML code with <div> elements,
to group all the contents that fits together
divisions and box model
<div>
<h1>My Playground App</h1>
<p>A toy to play with HTML and CSS</p>
</div>
<div>
<h2>Fast</h2>
<img src="fast.png" alt="A rocket">
<p>A fast app, <strong>very fast app</strong> </p>
</div>
<div>
<h2>Simple</h2>
<img src="simple.png" alt="A cloud">
<p>A simple app, <strong>very simple</strong> app</p>
</div>Add a div around your footer too!
the box model
syntax and shorcuts
id and class
in your HTML file
div{
border-top: 1px solid red;
border-right: 2px dotted black;
border-bottom: 1px dashed green;
border-left: 2px dotted black;
}borders
id and class
To add some style only to :
divisions and box model
div{
background: white;
border: 1px solid lightgrey;
padding: 20px;
margin: 30px;
}you can make the box structure more visible
by adding some CSS rules on this <div>
#header {
text-align: center;
background-image: url("http://lorempixel.com/1300/1000");
background-size: cover;
padding: 150 0 500 0;
color: white;
text-shadow: 1px 1px 3px black;
}
.feature {
padding: 50px;
font-weight: 300px;
}Go to lewagon.com/learn/copenhagen and learn much more about coding for free!