SlideShare a Scribd company logo
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>
Lecture 03   HTML&CSS Part 2
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

More Related Content

KEY
Artdm171 Week4 Tags
PPTX
Div span__object_があればいい
PPTX
Basics of Front End Web Dev PowerPoint
KEY
ARTDM 171, Week 5: CSS
PDF
xhtml_basics
PDF
Web Design Course: CSS lecture 1
PDF
Web Design Course: CSS lecture 2
PDF
Web Design Course: CSS lecture 5
Artdm171 Week4 Tags
Div span__object_があればいい
Basics of Front End Web Dev PowerPoint
ARTDM 171, Week 5: CSS
xhtml_basics
Web Design Course: CSS lecture 1
Web Design Course: CSS lecture 2
Web Design Course: CSS lecture 5

What's hot (19)

PDF
CSS Best practice
PPTX
Introduction to HTML and CSS
PPTX
Html5 elements-Kip Academy
PDF
Slicing the web
PDF
Web Design Course: CSS lecture 4
PDF
Html5 101
ODP
Html5 101
PDF
6. CSS
PDF
CSS Frameworks
PDF
Web Design Bootcamp - Day1
PPTX
Bootstrap [part 2]
KEY
关于 Html5 那点事
PDF
HTML5 Essentials
ODP
Cascading Style Sheets - Part 02
PDF
Web Design Course: CSS lecture 3
PPT
Introduction to HTML
PDF
Introduction to Html by Ankitkumar Singh
KEY
HTML5 - Just the basics
PPTX
iPhone Web Applications: HTML5, CSS3 & dev tips for iPhone development
CSS Best practice
Introduction to HTML and CSS
Html5 elements-Kip Academy
Slicing the web
Web Design Course: CSS lecture 4
Html5 101
Html5 101
6. CSS
CSS Frameworks
Web Design Bootcamp - Day1
Bootstrap [part 2]
关于 Html5 那点事
HTML5 Essentials
Cascading Style Sheets - Part 02
Web Design Course: CSS lecture 3
Introduction to HTML
Introduction to Html by Ankitkumar Singh
HTML5 - Just the basics
iPhone Web Applications: HTML5, CSS3 & dev tips for iPhone development
Ad

Viewers also liked (20)

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

Similar to Lecture 03 HTML&CSS Part 2 (20)

PPT
Lecture 2 - Comm Lab: Web @ ITP
PPTX
Intermediate Web Design
PPTX
Entering User Data from a Web Page HTML Forms
PDF
The web context
PPTX
Learn html and css from scratch
PDF
Intro to Web Development
PPTX
[SUTD GDSC] Intro to HTML and CSS
PDF
WEB DESIGN AND INTERNET PROGRAMMING LAB MANUAL.pdf
DOCX
Html n css tutorial
PPTX
HTML Lesson HTML FormsHTML Formsvv4.pptx
PPTX
Css for Development
PPTX
Introduction to Web Development.pptx
PPTX
Introduction to Web Development.pptx
PPTX
Introduction to Web Development.pptx
PPTX
Cascading style sheet
PPT
Cascading Style Sheet - CSS
PPTX
Presentation on CSS, Style Sheet, Types of Styles, Types of Text Formatting, ...
DOCX
Html html html html html html html html html
PPTX
css-note.pptx
PDF
Introduction to web development
Lecture 2 - Comm Lab: Web @ ITP
Intermediate Web Design
Entering User Data from a Web Page HTML Forms
The web context
Learn html and css from scratch
Intro to Web Development
[SUTD GDSC] Intro to HTML and CSS
WEB DESIGN AND INTERNET PROGRAMMING LAB MANUAL.pdf
Html n css tutorial
HTML Lesson HTML FormsHTML Formsvv4.pptx
Css for Development
Introduction to Web Development.pptx
Introduction to Web Development.pptx
Introduction to Web Development.pptx
Cascading style sheet
Cascading Style Sheet - CSS
Presentation on CSS, Style Sheet, Types of Styles, Types of Text Formatting, ...
Html html html html html html html html html
css-note.pptx
Introduction to web development

Recently uploaded (20)

PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
RMMM.pdf make it easy to upload and study
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
Lesson notes of climatology university.
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Pre independence Education in Inndia.pdf
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
Cell Structure & Organelles in detailed.
PDF
Basic Mud Logging Guide for educational purpose
PPTX
Pharma ospi slides which help in ospi learning
PPTX
master seminar digital applications in india
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Abdominal Access Techniques with Prof. Dr. R K Mishra
Final Presentation General Medicine 03-08-2024.pptx
RMMM.pdf make it easy to upload and study
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Lesson notes of climatology university.
Module 4: Burden of Disease Tutorial Slides S2 2025
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Pre independence Education in Inndia.pdf
2.FourierTransform-ShortQuestionswithAnswers.pdf
Cell Structure & Organelles in detailed.
Basic Mud Logging Guide for educational purpose
Pharma ospi slides which help in ospi learning
master seminar digital applications in india
Renaissance Architecture: A Journey from Faith to Humanism
Microbial disease of the cardiovascular and lymphatic systems
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
human mycosis Human fungal infections are called human mycosis..pptx

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>
  • 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