SlideShare a Scribd company logo
What is a web page
made of?
And how on earth can I make
one?!
Includes content
adapted from
Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
htmldog.com
Objectives
Today you will make a web page from
scratch in HTML and CSS
You will learn how to change how a
webpage looks
You will know more about webpages
than 90% of people!
Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
Most important fact:
• HTML is for meaning or content
• CSS is for presentation or looks

(also, not so important fact)
• HTML stands for HyperText Markup
Language
• CSS http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
stands for Cascading Style Sheets
Image from:
Writing HTML/CSS
• I would normally get you to try in
notepad - but it’s not allowed in
school
• Instead, I want you to open

http://jsfiddle.net
• It runs in your browser and lets you
see what your code looks like

Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
Your First Webpage
Type in the HTML
box:
My first webpage
Then click “Run”

Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
Tags
• HTML documents are ‘markup’, meaning
‘tags’ are used to structure content and give
meaning to it.
• Add to your HTML so it is now:
<!DOCTYPE html>
<html>
<body>
My first webpage
</body>
</html>
Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
What Happened?
• It looks the same!
• The tags add meaning not
presentation
• <!DOCTYPE html> tells the
brwowser what kind of HTML you
are using – this is HTML5
• The other tags tell the browser what
is in between the two parts
Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
Tags
• Tags usually work like
<tag>content</tag>
Opening tag

Opening tag

• Though there are a few exceptions

Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
Adding a Title
• Add to your code:
<!DOCTYPE html>
<html>
<head>
<title>My first web page</title>
</head>
<body>
My first webpage
</body>
</html>
Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
Where’s the Title?
• Not on the page – it should come up
in the top bar of the browser (but
JSFiddle doesn’t work like
that, unfortunately)
• Anything inside the <head> tag is
about the page, not on the page
Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
Paragraphs
<!DOCTYPE html>
<html>
<head>
<title>My first web page</title>
</head>
<body>
My first webpage.
How exciting.
</body>
</html>

Does it do what you expected?

Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
Paragraphs
• Browsers ignore new lines and blank
spaces in your HTML code – try
putting in a bunch of spaces instead
of the new line
• To make new lines (or split your text
into two separate sections) you need
to explicitly tell the browser
Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
Paragraphs
• The <p> tag is for paragraphs – change
your code to this:
<p>My first webpage.</p>
<p>How exciting.</p>

Try adding this, too:
<p>Yes, that really <em>is</em>
exciting.
<strong>Warning:</strong> level
of excitement may cause head to
explode.</p>
Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
Adding more Tags
• <em> (for emphasis) displays in
italics and <strong> in bold
• You can also use <br> for a new line
– though it’s best not to use if very
much as you probably should
separate text into proper paragraphs
My first web page<br> How exciting
Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
Headings
• <p> is just the start – if you need
headings and sub headings there are
lots of options!
• <h1>, <h2>, <h3>, <h4>, <h5
>, <h6> are different headings in
order of importance (and size)
Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
Change your Code:
<h1>My first web page</h1>
<h2>What this is</h2>
<p>A simple page put
together using HTML</p>
<h2>Why this is</h2>
<p>To learn HTML</p>
Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
Using Headings:
• Use <h1> just once per page – the
headline or main heading
• Use the others as many times as you
like to structure your work properly

Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
Lists
• The two types of list you need to know
about in HTML are
– Unordered lists (or bullet points)
– Ordered lists (or numbered lists)

• <ul> is used to define unordered lists
• <ol> is used to define ordered lists
• <li> is used for list items in both types
of list
Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
Add to your code
<ul>
<li>To learn HTML</li>
<li>To show off</li>
<li>Because I can.<li>
</ul>
See what happens when you change both
the <ul> tags to <ol>
Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
Change your code:
<ul>
<li>To learn HTML</li>
<li> To show off
<ol>
<li>To my boss</li>
<li>To my friends</li>
<li>To my cat</li>
<li>To the little talking
duck in my brain</li>
</ol>
</li>
<li>Because I can</li>
</ul>
Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
Links
• The Web is all about links – a
webpage without links is a dead end.
• Add this code:
<p><a href=“www.dectc.bham.
sch.uk”>Damo website!</a></p>

Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
More about Links
• href is called an “attribute” – extra
information about the content for the
browser to use
• Links can be “absolute” like this one – to
the full web address
• They can also be “relative” – to a
webpage on the same server or folder
• Links don’t have to be to HTML pages, it
could be to other files
Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
Images
• If all we have is text our webpages
can be a bit boring
• <img> is the tag that adds images
• Add:
<img src="http://www.htmldog.
com/badge1.gif" width="120"
height="90" alt="HTML Dog">
Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
Challenge
• Make a simple html page using the
skills you have developed so far
• Create in JSFiddle.net – and save it!

Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
Making it Look Good!
• So far the HTML pages we’ve created
look duller than a basic Word file
• Let’s make it interesting!
• Styles can be added to any element
to change how they look
• Try:
<p style="color: red">text</p>
Blame the Americans!

Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
Most important fact (reminder):
• HTML is for meaning or content
• CSS is for presentation or looks

Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
Keep it Separate
Better:
• We can put the styles in the <head>
section
Best:
• We can create a separate CSS file and
link it to our HTML file
• JSFiddle does this automatically for
us http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
Image from:
Try it out:
• Make a simple HTML file (or use one
you already created)
• In the CSS section add the code:
p {
color:red
}
Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
Selectors, Properties & Values
• A Selector is the name of the tag you
want to change
• A Property is what you want to
change
• A Value is what you want to set that
property to be
Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
Selectors, Properties & Values
Selector

Properties

Values

body {
font-size: 14px;
color: navy;
}
Colon between
Semi-colon
Curly Braces
Property & Value after value
Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
Units for Values
•
•
•
•

Some values are words
Others are numbers that need units
px (pixels) e.g. font-size:12px;
em (“Emms”) e.g. font-size:2em;
- calculated size of a font as a ratio
i.e. 1em = no change
• % (percent) e.g. width:80%;

Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
Colours
• The following values, to specify fullon as red-as-red-can-be, all produce
the same result:
–red
–rgb(255,0,0)
–rgb(100%,0%,0%)
–#ff0000
–#f00
Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
Colours
• Predefined names can be used, e.g.
aqua, black, blue, fuchsia, gray
, green, lime, maroon, navy, oliv
e, orange, purple, red, silver, t
eal, white, yellow, even
transparent
Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
RGB Colours
• RGB means Red, Green, Blue
• Goes from 0 (e.g. no red) to 255
(e.g. fully red)
• Also done in Hexadecimal (values go
from 00 to FF for RGB)
• Hex is the most common way that
web designers do it
Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
Color and Background-color
• Try this
h1 {
color: yellow;
background-color: blue;
}

Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
Too harsh
• If the colours are too harsh, try
softening them a bit
h1 {
color: #ffffcc;
background-color: #000099;
}
Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
Text Formatting
• font-family: this chooses the
font itself, e.g. Arial or Times New
Roman
body {
font-family: “Times New
Roman”;
}
Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
Text Formatting
• font-size: usually in units of px or
em
• font-weight: makes text bold or
normal
• font-style: makes text italic or
normal
• text-transform: can change the
case of text – possible values are
capitalise, uppercase, lowercase
and http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
none
Image from:
Try Text Formatting
body {
font-family: arial, helvetica, sans-serif;
font-size: 14px;
}
h1 {
font-size: 2em;
}
a {
text-decoration: none;
}
strong {
font-style: italic;
text-transform: uppercase;
}
Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
Margins and Padding
• Try this:
h2 {
font-size: 1.5em;
background-color: #ccc;
margin: 20px;
padding: 40px;
}
Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
The Box Model
Margin Box
Border Box
Padding Box
Element Box

Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
Margins & Padding
• Can be set to each side
independently
–margin-top: 12px;
–padding-left: 20px;
–margin: 12px 5px 0 12px;
Top, Left, Bottom, Right
(anti-clockwise)
Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
Borders
• To add a border, just add a property
of border-style:
• Values can be
solid, dotted, dashed, double, g
roove, ridge, inset and outset.
• border-width sets the
thickness, usually in px
• border-color sets the color

Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
Try out Borders
h2 {
border-style: dashed;
border-width: 3px;
border-left-width: 10px;
border-right-width: 10px;
border-color: red;
}
Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
Try it all out!
• Open the CSS file from the VLE and
add it to the page you’ve been
working on
• Adapt it to suit your page – change
colours, sizes, borders etc.

Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20

More Related Content

PPTX
Unit 28 Week 9
PPTX
Unit 28 Week 3
PPTX
Unit 28 Week 8
PPTX
Unit 28 Week 10
PPTX
Unit 28 Week 7
PPTX
Unit 28 Week 2
PPTX
Unit 28 Week 5
PPTX
Unit 28 Week 1
Unit 28 Week 9
Unit 28 Week 3
Unit 28 Week 8
Unit 28 Week 10
Unit 28 Week 7
Unit 28 Week 2
Unit 28 Week 5
Unit 28 Week 1

What's hot (17)

PPTX
Unit 28 Week 14
PPTX
Unit 28 Week 13
PPTX
Unit 28 Week 15
PPTX
Unit 28 Week 6
PPTX
Unit 28 Week 12
PPTX
Unit 28 Week 11
PPTX
WordCamp Miami- How to Hire a Web Firm to Build Your Website
PPTX
Pofo – Creative Portfolio and Blog WordPress Theme
PPTX
Web developers (austin ramer)
PDF
CTurner PPP Final Project Week 4 (Edited)
PPTX
Webpage & Multimedia Design- class01
PDF
WordPress for Business Sites - ConvergeSouth - October 2011
ODP
A Holistic View of Website Performance
PDF
Sallie Goetsch: Making the Events Calendar Sit Up and Beg
PPTX
Word Press Resources
PDF
Jason Tucker Wordpress 3rd Party Web Services
PPTX
The New Kids On The Block "Step By Step" Guide To The WordPress Admin
Unit 28 Week 14
Unit 28 Week 13
Unit 28 Week 15
Unit 28 Week 6
Unit 28 Week 12
Unit 28 Week 11
WordCamp Miami- How to Hire a Web Firm to Build Your Website
Pofo – Creative Portfolio and Blog WordPress Theme
Web developers (austin ramer)
CTurner PPP Final Project Week 4 (Edited)
Webpage & Multimedia Design- class01
WordPress for Business Sites - ConvergeSouth - October 2011
A Holistic View of Website Performance
Sallie Goetsch: Making the Events Calendar Sit Up and Beg
Word Press Resources
Jason Tucker Wordpress 3rd Party Web Services
The New Kids On The Block "Step By Step" Guide To The WordPress Admin
Ad

Similar to Unit 28 Week 4 (20)

PDF
Punch it Up with HTML and CSS
PPT
HTML & CSS Workshop Notes
PDF
HTML5 & CSS3 Flag
PDF
[O'Reilly] HTML5 Design
PDF
Html:css crash course (4:5)
PDF
Xhtml Basics
PDF
xhtml_basics
PDF
xhtml_basics
PDF
Xhtml Basics
PDF
A Primer on HTML 5 - By Nick Armstrong
PPT
PPT
css.ppt
PPT
HTML Web Devlopment presentation css.ppt
PPTX
Web Components: The Future of Web Development is Here
PPT
Building A Website
PPT
Html5workshop
PPTX
PDF
Html css crash course may 11th, atlanta
PPTX
HTML & CSS Training Institute in Ambala ! Batra Computer Centre
Punch it Up with HTML and CSS
HTML & CSS Workshop Notes
HTML5 & CSS3 Flag
[O'Reilly] HTML5 Design
Html:css crash course (4:5)
Xhtml Basics
xhtml_basics
xhtml_basics
Xhtml Basics
A Primer on HTML 5 - By Nick Armstrong
css.ppt
HTML Web Devlopment presentation css.ppt
Web Components: The Future of Web Development is Here
Building A Website
Html5workshop
Html css crash course may 11th, atlanta
HTML & CSS Training Institute in Ambala ! Batra Computer Centre
Ad

More from MrJRogers (16)

PPTX
L6 diary management
PPTX
L4 proofs
PPTX
L3 cookies
PPTX
L2 identifying photos
PPTX
L1 intro & hardware
PPTX
Image reflections intro
PPTX
Dame Elizabeth Cadbury Year 8 ICT Homework Project Introduction
PPTX
Dame Elizabeth Cadbury Year 8 ICT Homework Project
PPTX
Unit 3 assessment 3 lesson
PPT
Types of Software - Y9 Computing
PPTX
Types & sources of info
PPTX
Databases & spreadsheets
PPTX
Lesson 7
PPTX
Lesson 5
PPTX
Lesson 4
PPTX
Lesson 3
L6 diary management
L4 proofs
L3 cookies
L2 identifying photos
L1 intro & hardware
Image reflections intro
Dame Elizabeth Cadbury Year 8 ICT Homework Project Introduction
Dame Elizabeth Cadbury Year 8 ICT Homework Project
Unit 3 assessment 3 lesson
Types of Software - Y9 Computing
Types & sources of info
Databases & spreadsheets
Lesson 7
Lesson 5
Lesson 4
Lesson 3

Recently uploaded (20)

PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
Computing-Curriculum for Schools in Ghana
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
master seminar digital applications in india
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
01-Introduction-to-Information-Management.pdf
PDF
Sports Quiz easy sports quiz sports quiz
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
Cell Structure & Organelles in detailed.
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
Final Presentation General Medicine 03-08-2024.pptx
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
Lesson notes of climatology university.
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Insiders guide to clinical Medicine.pdf
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Computing-Curriculum for Schools in Ghana
Anesthesia in Laparoscopic Surgery in India
master seminar digital applications in india
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
01-Introduction-to-Information-Management.pdf
Sports Quiz easy sports quiz sports quiz
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
O7-L3 Supply Chain Operations - ICLT Program
Cell Structure & Organelles in detailed.
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 Đ...
Final Presentation General Medicine 03-08-2024.pptx
2.FourierTransform-ShortQuestionswithAnswers.pdf
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Lesson notes of climatology university.
O5-L3 Freight Transport Ops (International) V1.pdf
Insiders guide to clinical Medicine.pdf

Unit 28 Week 4

  • 1. What is a web page made of? And how on earth can I make one?! Includes content adapted from Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20 htmldog.com
  • 2. Objectives Today you will make a web page from scratch in HTML and CSS You will learn how to change how a webpage looks You will know more about webpages than 90% of people! Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
  • 4. Most important fact: • HTML is for meaning or content • CSS is for presentation or looks (also, not so important fact) • HTML stands for HyperText Markup Language • CSS http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20 stands for Cascading Style Sheets Image from:
  • 5. Writing HTML/CSS • I would normally get you to try in notepad - but it’s not allowed in school • Instead, I want you to open http://jsfiddle.net • It runs in your browser and lets you see what your code looks like Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
  • 6. Your First Webpage Type in the HTML box: My first webpage Then click “Run” Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
  • 7. Tags • HTML documents are ‘markup’, meaning ‘tags’ are used to structure content and give meaning to it. • Add to your HTML so it is now: <!DOCTYPE html> <html> <body> My first webpage </body> </html> Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
  • 8. What Happened? • It looks the same! • The tags add meaning not presentation • <!DOCTYPE html> tells the brwowser what kind of HTML you are using – this is HTML5 • The other tags tell the browser what is in between the two parts Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
  • 9. Tags • Tags usually work like <tag>content</tag> Opening tag Opening tag • Though there are a few exceptions Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
  • 10. Adding a Title • Add to your code: <!DOCTYPE html> <html> <head> <title>My first web page</title> </head> <body> My first webpage </body> </html> Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
  • 11. Where’s the Title? • Not on the page – it should come up in the top bar of the browser (but JSFiddle doesn’t work like that, unfortunately) • Anything inside the <head> tag is about the page, not on the page Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
  • 12. Paragraphs <!DOCTYPE html> <html> <head> <title>My first web page</title> </head> <body> My first webpage. How exciting. </body> </html> Does it do what you expected? Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
  • 13. Paragraphs • Browsers ignore new lines and blank spaces in your HTML code – try putting in a bunch of spaces instead of the new line • To make new lines (or split your text into two separate sections) you need to explicitly tell the browser Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
  • 14. Paragraphs • The <p> tag is for paragraphs – change your code to this: <p>My first webpage.</p> <p>How exciting.</p> Try adding this, too: <p>Yes, that really <em>is</em> exciting. <strong>Warning:</strong> level of excitement may cause head to explode.</p> Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
  • 15. Adding more Tags • <em> (for emphasis) displays in italics and <strong> in bold • You can also use <br> for a new line – though it’s best not to use if very much as you probably should separate text into proper paragraphs My first web page<br> How exciting Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
  • 16. Headings • <p> is just the start – if you need headings and sub headings there are lots of options! • <h1>, <h2>, <h3>, <h4>, <h5 >, <h6> are different headings in order of importance (and size) Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
  • 17. Change your Code: <h1>My first web page</h1> <h2>What this is</h2> <p>A simple page put together using HTML</p> <h2>Why this is</h2> <p>To learn HTML</p> Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
  • 18. Using Headings: • Use <h1> just once per page – the headline or main heading • Use the others as many times as you like to structure your work properly Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
  • 19. Lists • The two types of list you need to know about in HTML are – Unordered lists (or bullet points) – Ordered lists (or numbered lists) • <ul> is used to define unordered lists • <ol> is used to define ordered lists • <li> is used for list items in both types of list Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
  • 20. Add to your code <ul> <li>To learn HTML</li> <li>To show off</li> <li>Because I can.<li> </ul> See what happens when you change both the <ul> tags to <ol> Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
  • 21. Change your code: <ul> <li>To learn HTML</li> <li> To show off <ol> <li>To my boss</li> <li>To my friends</li> <li>To my cat</li> <li>To the little talking duck in my brain</li> </ol> </li> <li>Because I can</li> </ul> Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
  • 22. Links • The Web is all about links – a webpage without links is a dead end. • Add this code: <p><a href=“www.dectc.bham. sch.uk”>Damo website!</a></p> Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
  • 23. More about Links • href is called an “attribute” – extra information about the content for the browser to use • Links can be “absolute” like this one – to the full web address • They can also be “relative” – to a webpage on the same server or folder • Links don’t have to be to HTML pages, it could be to other files Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
  • 24. Images • If all we have is text our webpages can be a bit boring • <img> is the tag that adds images • Add: <img src="http://www.htmldog. com/badge1.gif" width="120" height="90" alt="HTML Dog"> Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
  • 25. Challenge • Make a simple html page using the skills you have developed so far • Create in JSFiddle.net – and save it! Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
  • 26. Making it Look Good! • So far the HTML pages we’ve created look duller than a basic Word file • Let’s make it interesting! • Styles can be added to any element to change how they look • Try: <p style="color: red">text</p> Blame the Americans! Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
  • 27. Most important fact (reminder): • HTML is for meaning or content • CSS is for presentation or looks Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
  • 28. Keep it Separate Better: • We can put the styles in the <head> section Best: • We can create a separate CSS file and link it to our HTML file • JSFiddle does this automatically for us http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20 Image from:
  • 29. Try it out: • Make a simple HTML file (or use one you already created) • In the CSS section add the code: p { color:red } Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
  • 30. Selectors, Properties & Values • A Selector is the name of the tag you want to change • A Property is what you want to change • A Value is what you want to set that property to be Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
  • 31. Selectors, Properties & Values Selector Properties Values body { font-size: 14px; color: navy; } Colon between Semi-colon Curly Braces Property & Value after value Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
  • 32. Units for Values • • • • Some values are words Others are numbers that need units px (pixels) e.g. font-size:12px; em (“Emms”) e.g. font-size:2em; - calculated size of a font as a ratio i.e. 1em = no change • % (percent) e.g. width:80%; Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
  • 33. Colours • The following values, to specify fullon as red-as-red-can-be, all produce the same result: –red –rgb(255,0,0) –rgb(100%,0%,0%) –#ff0000 –#f00 Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
  • 34. Colours • Predefined names can be used, e.g. aqua, black, blue, fuchsia, gray , green, lime, maroon, navy, oliv e, orange, purple, red, silver, t eal, white, yellow, even transparent Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
  • 35. RGB Colours • RGB means Red, Green, Blue • Goes from 0 (e.g. no red) to 255 (e.g. fully red) • Also done in Hexadecimal (values go from 00 to FF for RGB) • Hex is the most common way that web designers do it Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
  • 36. Color and Background-color • Try this h1 { color: yellow; background-color: blue; } Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
  • 37. Too harsh • If the colours are too harsh, try softening them a bit h1 { color: #ffffcc; background-color: #000099; } Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
  • 38. Text Formatting • font-family: this chooses the font itself, e.g. Arial or Times New Roman body { font-family: “Times New Roman”; } Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
  • 39. Text Formatting • font-size: usually in units of px or em • font-weight: makes text bold or normal • font-style: makes text italic or normal • text-transform: can change the case of text – possible values are capitalise, uppercase, lowercase and http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20 none Image from:
  • 40. Try Text Formatting body { font-family: arial, helvetica, sans-serif; font-size: 14px; } h1 { font-size: 2em; } a { text-decoration: none; } strong { font-style: italic; text-transform: uppercase; } Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
  • 41. Margins and Padding • Try this: h2 { font-size: 1.5em; background-color: #ccc; margin: 20px; padding: 40px; } Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
  • 42. The Box Model Margin Box Border Box Padding Box Element Box Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
  • 43. Margins & Padding • Can be set to each side independently –margin-top: 12px; –padding-left: 20px; –margin: 12px 5px 0 12px; Top, Left, Bottom, Right (anti-clockwise) Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
  • 44. Borders • To add a border, just add a property of border-style: • Values can be solid, dotted, dashed, double, g roove, ridge, inset and outset. • border-width sets the thickness, usually in px • border-color sets the color Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
  • 45. Try out Borders h2 { border-style: dashed; border-width: 3px; border-left-width: 10px; border-right-width: 10px; border-color: red; } Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20
  • 46. Try it all out! • Open the CSS file from the VLE and add it to the page you’ve been working on • Adapt it to suit your page – change colours, sizes, borders etc. Image from: http://antiqueradios.com/forums/viewtopic.php?f=1&t=188309&start=20