SlideShare une entreprise Scribd logo
1  sur  29
HTML
Introduction to webdesign:
the basic web page
with practice suggestions
Online Publishing
CSS
• Cascading Stylesheets
• To apply layout to a HTML page, in a way that clearly separates
layout from content
• Selectors: indicate to what you want to apply formatting
• Cascading: Styles are inherited
• 3 ways to implement:
• Inline styles
• In the HTML Header
• In a separate CSS file
CSS Selectors
• Any HTML Element
• body
• h1
• p
• a
• li
• …
• id selector: #myparagraph1 #mainimage
• class selector: .citation .french .highlight
CSS Box Model
• The CSS box model is essentially a box that wraps around HTML
elements, and it consists of: margins, borders, padding, and the
actual content.
Example CSS Box Model
• div.ex
• {
• width:220px;
• padding:10px;
• border:5px solid gray;
• margin:0px;
• }
CSS Examples
• Inline styles
• <p style="color:blue;margin-left:20px;">This is a paragraph.</p>
• In Header Element
• <head>
<style type="text/css">
body {background-color:yellow;}
p {color:blue;}
</style>
</head>
<style type="text/css">
body { background-color:#FFD700; font: calibri, sans-serif; }
h1 {margin-bottom:20px;padding: 10px; background-color:#FFA555; font: 32px bold
calibri, sans-serif;}
#container { padding:10px; }
#header { background-color:#FFA500;padding:10px; }
#menu { background-color:#FFE700;height:100%;width:20%;float:left;
padding:10px; }
#content { background-color:#00DDEE;height:100%;width:70%;float:left;
padding:10px; }
p { font: 14px calibri, sans-serif;
.english { color: green; }
.dutch { color: blue; }
</style>
/* unvisited link */
a:link {
color: red;
}
/* visited link */
a:visited {
color: green;
}
/* mouse over link */
a:hover {
color: yellow;
}
/* selected link */
a:active {
color: orange;
}
<body>
<div id="container">
<div id="header">
<h1 >Stylesheet with divisions</h1>
</div>
<div id="menu">
<p><b>Menu</b><br /><br />
<a href="http://www.kuleuven.be">KU leuven</a><br />
<a href="http://www.france.fr">France</a><br />
<a href="http://www.belgium.be">Belgium</a> </p></div>
<div id="content">
<p class="english">Content goes here</p>
<p class="dutch">Inhoud komt hier</p>
</div>
</div>
HTML 5 nav
• <div id="menu">
• <p><b>Menu</b></p>
• <nav>
• <a href="http://www.kuleuven.be">KU leuven</a> |
• <a href="http://www.france.fr">France</a> |
• <a href="http://www.belgium.be">Belgium</a>
• </nav>
• </div>
CSS Examples
• External Stylesheet File (.css)
• Link in HTML:
• <head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
• Stylesheet contents:
• body {background-color:yellow;}
• p {color:blue;}
• a {text-decoration:none;}
• a:link {color:#FF0000;} /* unvisited link */
• a:visited {color:#00FF00;} /* visited link */
Customizing WordPress CSS
• https://en.support.wordpress.com/custom-design/editing-
css/
• https://dailypost.wordpress.com/2013/06/21/css-intro/
• https://dailypost.wordpress.com/2013/08/29/css-matched-
rule-pane/
HTML color codes
• http://www.w3schools.com/colors/colors_picker.asp
• http://htmlcolorcodes.com/color-picker/
Forms
• Forms are an easy way to implement interactivity on a
website
• You need 2 pages (you can combine it in one):
• the actual HTML page with Form elements
• A server-side or client-side script that will parse the form
Form element example
Form Example Code
<form id="form1" name="form1" method="post"
action="processthisform.php">
<p>
<label for="Name">Name</label>
<input type="text" name="Name" id="Name" />
</p>
<p>Study programme:
<select name="Programme" id="Programme">
<option value="1">Master of Arts in Cultural
Studies</option>
<option value="2">Master of Arts in History</option>
<option value="3">Master of Science in Information
Management</option>
</select>
</p>
Form Example Code
<p>Gender: </p>
<p>
<label>
<input type="radio" name="Gender" value="M" id="Gender_0" />
Male</label>
<br />
<label>
<input type="radio" name="Gender" value="F" id="Gender_1" />
Female</label>
<br />
</p>
<p>I wil attend on: </p>
<p>
<label>
<input type="checkbox" name="Attend" value="fri" id="Attend_0" />
Friday</label>
<br />
<label>
<input type="checkbox" name="Attend" value="sat" id="Attend_1" />
Saturday</label>
</p>
Form Example Code
<p>Comments:</p>
<p><textarea name="Comments" id="Comments"
cols="60" rows="5"></textarea>
</p>
<p>
<input type="submit" name="Submit" id="Submit"
value="Submit" />
<br />
</p>
</form>
Form Example Code
<h1>Calculate your BMI</h1>
<form name="myform" action="" method="get">
<p>height<br />
<input type="text" name="height" value="">
<p>weight<br />
<input type="text" name="weight" value="">
<p>
<input type="button" name="button" Value="Click" onClick="testResults(this.form)">
</form>
<p><script language="JavaScript">
function testResults (form) {
var TestVar = eval(form.weight.value) / (eval(form.height.value) / 100);
// document.write ("<p><b>Your bmi: " + TestVar + "</b></p>");
document.getElementById("answer").innerHTML = "<p><b>Your bmi: " + TestVar +
"</b></p>";
}
</script>
<p id="answer"></p>
HTML 5 Datalist
• <form action="action_page.php">
• <input list="browsers" name="browser">
• <datalist id="browsers">
• <option value="Internet Explorer">
• <option value="Firefox">
• <option value="Chrome">
• <option value="Opera">
• <option value="Safari">
• </datalist>
• <input type="submit">
• </form>
HTML 5 Output
• <form action="action_page.php"
oninput="x.value=parseInt(a.value)+parseInt(b.value)">
0
<input type="range" id="a" name="a" value="50">
100 +
<input type="number" id="b" name="b" value="50">
=
<output name="x" for="a b"></output>
<br><br>
<input type="submit">
</form>
HTML 5
• Main features
• Back to HTML
• Semantic elements
• Graphics
• Multimedia
• New API’s
• Obsolete tags removed
• Optimized for Mobile
• Increased importance of JavaScript
• HTML5 Canvas
What you need to learn
• HTML Box Model & CSS
• Understand the HTML DOM
• HTML Forms
• Javascript & jQuery
Some links
• Notepad++
• EasyPHP: http://www.easyphp.org
• http://html5demos.com/file-api
• http://www.sitepoint.com/html5-ajax-file-upload/
Semantic Elements
Graphics
• Canvas
• Drawing graphics on the fly using Javascript
• SVG
• You can now directly define SVG graphics in HTML
Multimedia
• Video tag
• <video width="320" height="240" controls>
<source src="movie.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>
• Audio tag
• <audio controls>
<source src="horse.ogg" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
• Iframe tag for Youtube
• <iframe width="420" height="315"
src="http://www.youtube.com/embed/XGSy3_Czz8k?autoplay=1">
</iframe>
API’s
• HTML Drag & Drop
• Local Storage
• Geolocation

Contenu connexe

Tendances

Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSSdanpaquette
 
Html5 elements-Kip Academy
Html5 elements-Kip AcademyHtml5 elements-Kip Academy
Html5 elements-Kip Academykip academy
 
Web Design Course: CSS lecture 4
Web Design Course: CSS  lecture 4Web Design Course: CSS  lecture 4
Web Design Course: CSS lecture 4Gheyath M. Othman
 
CSS Frameworks
CSS FrameworksCSS Frameworks
CSS FrameworksMike Crabb
 
Web Design Bootcamp - Day1
Web Design Bootcamp - Day1Web Design Bootcamp - Day1
Web Design Bootcamp - Day1Aslam Najeebdeen
 
关于 Html5 那点事
关于 Html5 那点事关于 Html5 那点事
关于 Html5 那点事Sofish Lin
 
Cascading Style Sheets - Part 02
Cascading Style Sheets - Part 02Cascading Style Sheets - Part 02
Cascading Style Sheets - Part 02Hatem Mahmoud
 
Web Design Course: CSS lecture 3
Web Design Course: CSS lecture 3Web Design Course: CSS lecture 3
Web Design Course: CSS lecture 3Gheyath M. Othman
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTMLAmit Tyagi
 
Introduction to Html by Ankitkumar Singh
Introduction to Html by Ankitkumar SinghIntroduction to Html by Ankitkumar Singh
Introduction to Html by Ankitkumar SinghAnkitkumar Singh
 
HTML5 - Just the basics
HTML5 - Just the basicsHTML5 - Just the basics
HTML5 - Just the basicsJames VanDyke
 
iPhone Web Applications: HTML5, CSS3 & dev tips for iPhone development
iPhone Web Applications: HTML5, CSS3 & dev tips for iPhone developmentiPhone Web Applications: HTML5, CSS3 & dev tips for iPhone development
iPhone Web Applications: HTML5, CSS3 & dev tips for iPhone developmentEstelle Weyl
 

Tendances (19)

CSS Best practice
CSS Best practiceCSS Best practice
CSS Best practice
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
 
Html5 elements-Kip Academy
Html5 elements-Kip AcademyHtml5 elements-Kip Academy
Html5 elements-Kip Academy
 
Slicing the web
Slicing the webSlicing the web
Slicing the web
 
Web Design Course: CSS lecture 4
Web Design Course: CSS  lecture 4Web Design Course: CSS  lecture 4
Web Design Course: CSS lecture 4
 
Html5 101
Html5 101Html5 101
Html5 101
 
Html5 101
Html5 101Html5 101
Html5 101
 
6. CSS
6. CSS6. CSS
6. CSS
 
CSS Frameworks
CSS FrameworksCSS Frameworks
CSS Frameworks
 
Web Design Bootcamp - Day1
Web Design Bootcamp - Day1Web Design Bootcamp - Day1
Web Design Bootcamp - Day1
 
Bootstrap [part 2]
Bootstrap [part 2]Bootstrap [part 2]
Bootstrap [part 2]
 
关于 Html5 那点事
关于 Html5 那点事关于 Html5 那点事
关于 Html5 那点事
 
HTML5 Essentials
HTML5 EssentialsHTML5 Essentials
HTML5 Essentials
 
Cascading Style Sheets - Part 02
Cascading Style Sheets - Part 02Cascading Style Sheets - Part 02
Cascading Style Sheets - Part 02
 
Web Design Course: CSS lecture 3
Web Design Course: CSS lecture 3Web Design Course: CSS lecture 3
Web Design Course: CSS lecture 3
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTML
 
Introduction to Html by Ankitkumar Singh
Introduction to Html by Ankitkumar SinghIntroduction to Html by Ankitkumar Singh
Introduction to Html by Ankitkumar Singh
 
HTML5 - Just the basics
HTML5 - Just the basicsHTML5 - Just the basics
HTML5 - Just the basics
 
iPhone Web Applications: HTML5, CSS3 & dev tips for iPhone development
iPhone Web Applications: HTML5, CSS3 & dev tips for iPhone developmentiPhone Web Applications: HTML5, CSS3 & dev tips for iPhone development
iPhone Web Applications: HTML5, CSS3 & dev tips for iPhone development
 

En vedette

Amen et l'Afnic : Choisir son adresse internet.
Amen et l'Afnic : Choisir son adresse internet.Amen et l'Afnic : Choisir son adresse internet.
Amen et l'Afnic : Choisir son adresse internet.Amen.fr
 
Bien débuter avec une plateforme e-commerce
Bien débuter avec une plateforme e-commerceBien débuter avec une plateforme e-commerce
Bien débuter avec une plateforme e-commerceEnzo
 
IAB European Agency Snapshot Study
IAB European Agency Snapshot StudyIAB European Agency Snapshot Study
IAB European Agency Snapshot Studypolenumerique33
 
Les applications iOS (iPhone & iPad) et Android
Les applications iOS (iPhone & iPad) et AndroidLes applications iOS (iPhone & iPad) et Android
Les applications iOS (iPhone & iPad) et AndroidNeedeo
 
Stratégie Product Listing Ads Google AdWords (2013)
Stratégie Product Listing Ads Google AdWords (2013)Stratégie Product Listing Ads Google AdWords (2013)
Stratégie Product Listing Ads Google AdWords (2013)Damien Marchois
 
Comment choisir son nom de domaine avec Amen
Comment choisir son nom de domaine avec AmenComment choisir son nom de domaine avec Amen
Comment choisir son nom de domaine avec AmenAmen.fr
 
Amen.fr - Afnic Nouveaux GTLD
Amen.fr - Afnic Nouveaux GTLDAmen.fr - Afnic Nouveaux GTLD
Amen.fr - Afnic Nouveaux GTLDAmen.fr
 
Améliorez votre présence en ligne pour attirer vos clients
Améliorez votre présence en ligne pour attirer vos clientsAméliorez votre présence en ligne pour attirer vos clients
Améliorez votre présence en ligne pour attirer vos clientspolenumerique33
 
Amen - Introduction au référencement (SEO)
Amen - Introduction au référencement (SEO)Amen - Introduction au référencement (SEO)
Amen - Introduction au référencement (SEO)Amen.fr
 
Amen.fr - Choisir le nom de domaine le mieux adapté pour votre identité numér...
Amen.fr - Choisir le nom de domaine le mieux adapté pour votre identité numér...Amen.fr - Choisir le nom de domaine le mieux adapté pour votre identité numér...
Amen.fr - Choisir le nom de domaine le mieux adapté pour votre identité numér...Amen.fr
 
présentation wordpress
présentation wordpressprésentation wordpress
présentation wordpressmonsieurpixel
 
Découvrez le nouveau plugin pour la solution ecommerce Shopware
Découvrez le nouveau plugin pour la solution ecommerce ShopwareDécouvrez le nouveau plugin pour la solution ecommerce Shopware
Découvrez le nouveau plugin pour la solution ecommerce ShopwareLengow
 
Conseils et outils gratuits pour démarrer
Conseils et outils gratuits pour démarrer Conseils et outils gratuits pour démarrer
Conseils et outils gratuits pour démarrer Needeo
 
Choisir une adresse internet, quelles sont les questions à se poser?
Choisir une adresse internet, quelles sont les questions à se poser?Choisir une adresse internet, quelles sont les questions à se poser?
Choisir une adresse internet, quelles sont les questions à se poser?Amen.fr
 
I tourisme amen donuts webinar july 15
I tourisme amen donuts webinar july 15I tourisme amen donuts webinar july 15
I tourisme amen donuts webinar july 15Amen.fr
 
Adobe Digital Index "Best of the Best Benchmark 2014"
Adobe Digital Index "Best of the Best Benchmark 2014"Adobe Digital Index "Best of the Best Benchmark 2014"
Adobe Digital Index "Best of the Best Benchmark 2014"polenumerique33
 
Optimisez votre référencement sur Internet pour améliorer la visibilité de vo...
Optimisez votre référencement sur Internet pour améliorer la visibilité de vo...Optimisez votre référencement sur Internet pour améliorer la visibilité de vo...
Optimisez votre référencement sur Internet pour améliorer la visibilité de vo...polenumerique33
 
Optimisez votre Référencement sur Internet pour améliorer la visibilité de v...
Optimisez votre Référencement sur Internet pour améliorer  la visibilité de v...Optimisez votre Référencement sur Internet pour améliorer  la visibilité de v...
Optimisez votre Référencement sur Internet pour améliorer la visibilité de v...polenumerique33
 
Comment travailler sur des projets WordPress pour de gros clients
Comment travailler sur des projets WordPress pour de gros clientsComment travailler sur des projets WordPress pour de gros clients
Comment travailler sur des projets WordPress pour de gros clientsEmilie LEBRUN
 

En vedette (20)

Amen et l'Afnic : Choisir son adresse internet.
Amen et l'Afnic : Choisir son adresse internet.Amen et l'Afnic : Choisir son adresse internet.
Amen et l'Afnic : Choisir son adresse internet.
 
Bien débuter avec une plateforme e-commerce
Bien débuter avec une plateforme e-commerceBien débuter avec une plateforme e-commerce
Bien débuter avec une plateforme e-commerce
 
IAB European Agency Snapshot Study
IAB European Agency Snapshot StudyIAB European Agency Snapshot Study
IAB European Agency Snapshot Study
 
Les applications iOS (iPhone & iPad) et Android
Les applications iOS (iPhone & iPad) et AndroidLes applications iOS (iPhone & iPad) et Android
Les applications iOS (iPhone & iPad) et Android
 
Stratégie Product Listing Ads Google AdWords (2013)
Stratégie Product Listing Ads Google AdWords (2013)Stratégie Product Listing Ads Google AdWords (2013)
Stratégie Product Listing Ads Google AdWords (2013)
 
Comment choisir son nom de domaine avec Amen
Comment choisir son nom de domaine avec AmenComment choisir son nom de domaine avec Amen
Comment choisir son nom de domaine avec Amen
 
Amen.fr - Afnic Nouveaux GTLD
Amen.fr - Afnic Nouveaux GTLDAmen.fr - Afnic Nouveaux GTLD
Amen.fr - Afnic Nouveaux GTLD
 
Améliorez votre présence en ligne pour attirer vos clients
Améliorez votre présence en ligne pour attirer vos clientsAméliorez votre présence en ligne pour attirer vos clients
Améliorez votre présence en ligne pour attirer vos clients
 
Amen - Introduction au référencement (SEO)
Amen - Introduction au référencement (SEO)Amen - Introduction au référencement (SEO)
Amen - Introduction au référencement (SEO)
 
Amen.fr - Choisir le nom de domaine le mieux adapté pour votre identité numér...
Amen.fr - Choisir le nom de domaine le mieux adapté pour votre identité numér...Amen.fr - Choisir le nom de domaine le mieux adapté pour votre identité numér...
Amen.fr - Choisir le nom de domaine le mieux adapté pour votre identité numér...
 
Initiation html css
Initiation html cssInitiation html css
Initiation html css
 
présentation wordpress
présentation wordpressprésentation wordpress
présentation wordpress
 
Découvrez le nouveau plugin pour la solution ecommerce Shopware
Découvrez le nouveau plugin pour la solution ecommerce ShopwareDécouvrez le nouveau plugin pour la solution ecommerce Shopware
Découvrez le nouveau plugin pour la solution ecommerce Shopware
 
Conseils et outils gratuits pour démarrer
Conseils et outils gratuits pour démarrer Conseils et outils gratuits pour démarrer
Conseils et outils gratuits pour démarrer
 
Choisir une adresse internet, quelles sont les questions à se poser?
Choisir une adresse internet, quelles sont les questions à se poser?Choisir une adresse internet, quelles sont les questions à se poser?
Choisir une adresse internet, quelles sont les questions à se poser?
 
I tourisme amen donuts webinar july 15
I tourisme amen donuts webinar july 15I tourisme amen donuts webinar july 15
I tourisme amen donuts webinar july 15
 
Adobe Digital Index "Best of the Best Benchmark 2014"
Adobe Digital Index "Best of the Best Benchmark 2014"Adobe Digital Index "Best of the Best Benchmark 2014"
Adobe Digital Index "Best of the Best Benchmark 2014"
 
Optimisez votre référencement sur Internet pour améliorer la visibilité de vo...
Optimisez votre référencement sur Internet pour améliorer la visibilité de vo...Optimisez votre référencement sur Internet pour améliorer la visibilité de vo...
Optimisez votre référencement sur Internet pour améliorer la visibilité de vo...
 
Optimisez votre Référencement sur Internet pour améliorer la visibilité de v...
Optimisez votre Référencement sur Internet pour améliorer  la visibilité de v...Optimisez votre Référencement sur Internet pour améliorer  la visibilité de v...
Optimisez votre Référencement sur Internet pour améliorer la visibilité de v...
 
Comment travailler sur des projets WordPress pour de gros clients
Comment travailler sur des projets WordPress pour de gros clientsComment travailler sur des projets WordPress pour de gros clients
Comment travailler sur des projets WordPress pour de gros clients
 

Similaire à Lecture 03 HTML&CSS Part 2

TOSSUG HTML5 讀書會 新標籤與表單
TOSSUG HTML5 讀書會 新標籤與表單TOSSUG HTML5 讀書會 新標籤與表單
TOSSUG HTML5 讀書會 新標籤與表單偉格 高
 
What you need to know bout html5
What you need to know bout html5What you need to know bout html5
What you need to know bout html5Kevin DeRudder
 
2022 HTML5: The future is now
2022 HTML5: The future is now2022 HTML5: The future is now
2022 HTML5: The future is nowGonzalo Cordero
 
HTML CSS and Web Development
HTML CSS and Web DevelopmentHTML CSS and Web Development
HTML CSS and Web DevelopmentRahul Mishra
 
HTML CSS Best Practices
HTML CSS Best PracticesHTML CSS Best Practices
HTML CSS Best Practiceshoctudau
 
The project gutenberg e book, fairy tales from brazil, by elsie spicer
The project gutenberg e book, fairy tales from brazil, by elsie spicerThe project gutenberg e book, fairy tales from brazil, by elsie spicer
The project gutenberg e book, fairy tales from brazil, by elsie spicerAndrei Hortúa
 
BITM3730 9-12.pptx
BITM3730 9-12.pptxBITM3730 9-12.pptx
BITM3730 9-12.pptxMattMarino13
 
Top 10 HTML5 features every developer should know!
Top 10 HTML5 features every developer should know!Top 10 HTML5 features every developer should know!
Top 10 HTML5 features every developer should know!Gill Cleeren
 
Layout with CSS
Layout with CSSLayout with CSS
Layout with CSSMike Crabb
 
Creating HTML Pages
Creating HTML PagesCreating HTML Pages
Creating HTML PagesMike Crabb
 
Bootstrap 3 Cheat Sheet PDF Reference
Bootstrap 3 Cheat Sheet PDF ReferenceBootstrap 3 Cheat Sheet PDF Reference
Bootstrap 3 Cheat Sheet PDF ReferenceBootstrap Creative
 
Css for Development
Css for DevelopmentCss for Development
Css for Developmenttsengsite
 

Similaire à Lecture 03 HTML&CSS Part 2 (20)

TOSSUG HTML5 讀書會 新標籤與表單
TOSSUG HTML5 讀書會 新標籤與表單TOSSUG HTML5 讀書會 新標籤與表單
TOSSUG HTML5 讀書會 新標籤與表單
 
HTML5 & CSS3 Flag
HTML5 & CSS3 FlagHTML5 & CSS3 Flag
HTML5 & CSS3 Flag
 
Lecture 2 - HTML Basics
Lecture 2 - HTML BasicsLecture 2 - HTML Basics
Lecture 2 - HTML Basics
 
What you need to know bout html5
What you need to know bout html5What you need to know bout html5
What you need to know bout html5
 
2022 HTML5: The future is now
2022 HTML5: The future is now2022 HTML5: The future is now
2022 HTML5: The future is now
 
HTML CSS and Web Development
HTML CSS and Web DevelopmentHTML CSS and Web Development
HTML CSS and Web Development
 
HTML CSS Best Practices
HTML CSS Best PracticesHTML CSS Best Practices
HTML CSS Best Practices
 
Html coding
Html codingHtml coding
Html coding
 
The project gutenberg e book, fairy tales from brazil, by elsie spicer
The project gutenberg e book, fairy tales from brazil, by elsie spicerThe project gutenberg e book, fairy tales from brazil, by elsie spicer
The project gutenberg e book, fairy tales from brazil, by elsie spicer
 
BITM3730 9-12.pptx
BITM3730 9-12.pptxBITM3730 9-12.pptx
BITM3730 9-12.pptx
 
HTML5
HTML5HTML5
HTML5
 
Print this
Print thisPrint this
Print this
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
 
Top 10 HTML5 features every developer should know!
Top 10 HTML5 features every developer should know!Top 10 HTML5 features every developer should know!
Top 10 HTML5 features every developer should know!
 
Layout with CSS
Layout with CSSLayout with CSS
Layout with CSS
 
Layout & css lecture
Layout & css lectureLayout & css lecture
Layout & css lecture
 
[O'Reilly] HTML5 Design
[O'Reilly] HTML5 Design[O'Reilly] HTML5 Design
[O'Reilly] HTML5 Design
 
Creating HTML Pages
Creating HTML PagesCreating HTML Pages
Creating HTML Pages
 
Bootstrap 3 Cheat Sheet PDF Reference
Bootstrap 3 Cheat Sheet PDF ReferenceBootstrap 3 Cheat Sheet PDF Reference
Bootstrap 3 Cheat Sheet PDF Reference
 
Css for Development
Css for DevelopmentCss for Development
Css for Development
 

Dernier

ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseCeline George
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptxmary850239
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxDhatriParmar
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsPooky Knightsmith
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDhatriParmar
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQuiz Club NITW
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxkarenfajardo43
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
week 1 cookery 8 fourth - quarter .pptx
week 1 cookery 8  fourth  -  quarter .pptxweek 1 cookery 8  fourth  -  quarter .pptx
week 1 cookery 8 fourth - quarter .pptxJonalynLegaspi2
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmStan Meyer
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptxDhatriParmar
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvRicaMaeCastro1
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfPrerana Jadhav
 

Dernier (20)

ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 Database
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx
 
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptxINCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young minds
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
week 1 cookery 8 fourth - quarter .pptx
week 1 cookery 8  fourth  -  quarter .pptxweek 1 cookery 8  fourth  -  quarter .pptx
week 1 cookery 8 fourth - quarter .pptx
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and Film
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdf
 

Lecture 03 HTML&CSS Part 2

  • 1. HTML Introduction to webdesign: the basic web page with practice suggestions Online Publishing
  • 2. CSS • Cascading Stylesheets • To apply layout to a HTML page, in a way that clearly separates layout from content • Selectors: indicate to what you want to apply formatting • Cascading: Styles are inherited • 3 ways to implement: • Inline styles • In the HTML Header • In a separate CSS file
  • 3. CSS Selectors • Any HTML Element • body • h1 • p • a • li • … • id selector: #myparagraph1 #mainimage • class selector: .citation .french .highlight
  • 4. CSS Box Model • The CSS box model is essentially a box that wraps around HTML elements, and it consists of: margins, borders, padding, and the actual content.
  • 5. Example CSS Box Model • div.ex • { • width:220px; • padding:10px; • border:5px solid gray; • margin:0px; • }
  • 6. CSS Examples • Inline styles • <p style="color:blue;margin-left:20px;">This is a paragraph.</p> • In Header Element • <head> <style type="text/css"> body {background-color:yellow;} p {color:blue;} </style> </head>
  • 7. <style type="text/css"> body { background-color:#FFD700; font: calibri, sans-serif; } h1 {margin-bottom:20px;padding: 10px; background-color:#FFA555; font: 32px bold calibri, sans-serif;} #container { padding:10px; } #header { background-color:#FFA500;padding:10px; } #menu { background-color:#FFE700;height:100%;width:20%;float:left; padding:10px; } #content { background-color:#00DDEE;height:100%;width:70%;float:left; padding:10px; } p { font: 14px calibri, sans-serif; .english { color: green; } .dutch { color: blue; } </style>
  • 8. /* unvisited link */ a:link { color: red; } /* visited link */ a:visited { color: green; } /* mouse over link */ a:hover { color: yellow; } /* selected link */ a:active { color: orange; }
  • 9. <body> <div id="container"> <div id="header"> <h1 >Stylesheet with divisions</h1> </div> <div id="menu"> <p><b>Menu</b><br /><br /> <a href="http://www.kuleuven.be">KU leuven</a><br /> <a href="http://www.france.fr">France</a><br /> <a href="http://www.belgium.be">Belgium</a> </p></div> <div id="content"> <p class="english">Content goes here</p> <p class="dutch">Inhoud komt hier</p> </div> </div>
  • 10.
  • 11. HTML 5 nav • <div id="menu"> • <p><b>Menu</b></p> • <nav> • <a href="http://www.kuleuven.be">KU leuven</a> | • <a href="http://www.france.fr">France</a> | • <a href="http://www.belgium.be">Belgium</a> • </nav> • </div>
  • 12. CSS Examples • External Stylesheet File (.css) • Link in HTML: • <head> <link rel="stylesheet" type="text/css" href="mystyle.css"> </head> • Stylesheet contents: • body {background-color:yellow;} • p {color:blue;} • a {text-decoration:none;} • a:link {color:#FF0000;} /* unvisited link */ • a:visited {color:#00FF00;} /* visited link */
  • 13. Customizing WordPress CSS • https://en.support.wordpress.com/custom-design/editing- css/ • https://dailypost.wordpress.com/2013/06/21/css-intro/ • https://dailypost.wordpress.com/2013/08/29/css-matched- rule-pane/
  • 14. HTML color codes • http://www.w3schools.com/colors/colors_picker.asp • http://htmlcolorcodes.com/color-picker/
  • 15. Forms • Forms are an easy way to implement interactivity on a website • You need 2 pages (you can combine it in one): • the actual HTML page with Form elements • A server-side or client-side script that will parse the form
  • 17. Form Example Code <form id="form1" name="form1" method="post" action="processthisform.php"> <p> <label for="Name">Name</label> <input type="text" name="Name" id="Name" /> </p> <p>Study programme: <select name="Programme" id="Programme"> <option value="1">Master of Arts in Cultural Studies</option> <option value="2">Master of Arts in History</option> <option value="3">Master of Science in Information Management</option> </select> </p>
  • 18. Form Example Code <p>Gender: </p> <p> <label> <input type="radio" name="Gender" value="M" id="Gender_0" /> Male</label> <br /> <label> <input type="radio" name="Gender" value="F" id="Gender_1" /> Female</label> <br /> </p> <p>I wil attend on: </p> <p> <label> <input type="checkbox" name="Attend" value="fri" id="Attend_0" /> Friday</label> <br /> <label> <input type="checkbox" name="Attend" value="sat" id="Attend_1" /> Saturday</label> </p>
  • 19. Form Example Code <p>Comments:</p> <p><textarea name="Comments" id="Comments" cols="60" rows="5"></textarea> </p> <p> <input type="submit" name="Submit" id="Submit" value="Submit" /> <br /> </p> </form>
  • 20. Form Example Code <h1>Calculate your BMI</h1> <form name="myform" action="" method="get"> <p>height<br /> <input type="text" name="height" value=""> <p>weight<br /> <input type="text" name="weight" value=""> <p> <input type="button" name="button" Value="Click" onClick="testResults(this.form)"> </form> <p><script language="JavaScript"> function testResults (form) { var TestVar = eval(form.weight.value) / (eval(form.height.value) / 100); // document.write ("<p><b>Your bmi: " + TestVar + "</b></p>"); document.getElementById("answer").innerHTML = "<p><b>Your bmi: " + TestVar + "</b></p>"; } </script> <p id="answer"></p>
  • 21. HTML 5 Datalist • <form action="action_page.php"> • <input list="browsers" name="browser"> • <datalist id="browsers"> • <option value="Internet Explorer"> • <option value="Firefox"> • <option value="Chrome"> • <option value="Opera"> • <option value="Safari"> • </datalist> • <input type="submit"> • </form>
  • 22. HTML 5 Output • <form action="action_page.php" oninput="x.value=parseInt(a.value)+parseInt(b.value)"> 0 <input type="range" id="a" name="a" value="50"> 100 + <input type="number" id="b" name="b" value="50"> = <output name="x" for="a b"></output> <br><br> <input type="submit"> </form>
  • 23. HTML 5 • Main features • Back to HTML • Semantic elements • Graphics • Multimedia • New API’s • Obsolete tags removed • Optimized for Mobile • Increased importance of JavaScript • HTML5 Canvas
  • 24. What you need to learn • HTML Box Model & CSS • Understand the HTML DOM • HTML Forms • Javascript & jQuery
  • 25. Some links • Notepad++ • EasyPHP: http://www.easyphp.org • http://html5demos.com/file-api • http://www.sitepoint.com/html5-ajax-file-upload/
  • 27. Graphics • Canvas • Drawing graphics on the fly using Javascript • SVG • You can now directly define SVG graphics in HTML
  • 28. Multimedia • Video tag • <video width="320" height="240" controls> <source src="movie.mp4" type="video/mp4"> <source src="movie.ogg" type="video/ogg"> Your browser does not support the video tag. </video> • Audio tag • <audio controls> <source src="horse.ogg" type="audio/ogg"> <source src="horse.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> • Iframe tag for Youtube • <iframe width="420" height="315" src="http://www.youtube.com/embed/XGSy3_Czz8k?autoplay=1"> </iframe>
  • 29. API’s • HTML Drag & Drop • Local Storage • Geolocation