1. HTML/CSS Class 1:
These slides are available at:
• Before we begin, I’d like to learn a little bit
more about everyone here!
• Can you please introduce yourself, and tell
us why you’re here and what you hope to
3. Goals for Today
We hope that by the end of class today:
• You will have mastered some of the basic terms
• You will know the most common HTML tags.
• You will have built a very simple, HTML-only
• Time permitting: You will understand the
basics of web servers, and what they are used
4. What is HTML?
• HTML stands for Hyper Text
• HTML is not actually a
programming language! It’s a
5. What is a Markup Language?
• A system for annotating text.
• Comes from publishing industry: you mark up
a manuscript prior to publishing.
• The revisions (mark up) editors make for the
designers, so they know how to lay it out.
• They were traditionally done in blue pencil on
• Other markup languages you may have heard
of: LaTeX, XML
6. What is HTML?
• HTML is a markup language that describes
• It tells our browsers how to layout the
• It describes webpages using markup tags.
• We usually just refer to HTML’s markup
tags as “HTML tags”
• I like to think of HTML as one of the main
languages of websites.
7. What does HTML look like?
• Right-click on ANY website, and
choose “View Source”
• You can see the HTML and CSS of
every single website on the web!
• HTML/CSS are open platforms.
8. What does HTML look like?
<h1>My First Heading</h1>
<p>My ﬁrst paragraph.</p>
Try this yourself! Go to: http://w3schools.com/
9. HTML: A Brief History
• 1989: Tim Berners-Lee invents the Web
with HTML as its publishing language
• Berners-Lee was working at CERN in
Switzerland, a particle physics lab.
• Since particle physics often requires
international collaboration, Berners-Lee
wanted to create a way for researchers
all over the world to share information
10. HTML: A Brief History
• The HTML that Berners-Lee created was
based on SGML (Standard Generalized
• SGML was used to mark up text into
structural units such as paragraphs,
headings, and list items.
• HTML added something new: the hypertext
link--what we’ve come to know of today as
11. HTML: A Brief History
• HTML 2 speciﬁcation is released.
• Netscape is formed. Begins adding to
HTML without consulting international
• World Wide Web Consortium (aka the
w3 consortium) is formed to “fulﬁll the
potential of the Web through the
development of open standards.”
12. HTML: A Brief History
• HTML is extended with lots of new tags,
including ones for formatting like BGCOLOR
and FONT FACE.
•“You’re not supposed to do that with HTML!”
• HTML 3 is released.
• Internet Explorer browser comes out.
• Netscape submits a proposal for FRAMES.
• 1998: HTML 4
• 2010: HTML 5 in development, draft submitted.
13. HTML: A Brief History
• To learn more:
• Steven Johnson’s “Where Good Ideas
14. HTML vs. CSS
• CSS stands for Cascading Style
• We will cover CSS in detail in class 2.
• How does HTML ﬁt in with
• CSS was created to allow the
separation of document content
from document presentation.
15. HTML vs CSS
• HTML deﬁnes the content of a
This is a HEADING
• this is a new bullet!
• CSS deﬁnes the formatting and style of
the content your website.
• I am some blue text!
• I am Monaco font!
16. HTML/CSS and Browsers
• You can think of HTML and CSS as
languages that web browsers speak
• Your Internet Explorer, Firefox,
Chrome or Safari Browser reads the
HTML and CSS on a webpage, and
creates what you see.
17. Free HTML/CSS editors
• You don’t need anything more sophisticated than
Notepad (on a PC) or TextEdit (on a Mac) to build an
• However, it is often easier to use an HTML editor.
• Here are some free ones:
• Aptana (Windows, Mac OS 10.5+, Linux):
• Komodo (Windows, Mac OS 10.4+, Linux):
free trial only
18. Other Useful Tools
• Another great way to learn HTML is to inspect
HTML elements on webpages you visit.
• There are two tools that can help you do this:
• The Chrome browser has a
right-click (control-click on a
mac!) and “Inspect Element”
tool built in
• The Firefox browser has an
extension called Firebug that
also allows you to “Inspect
19. Onward to the Jargon
• HTML Terms:
• Opening Tag
• Closing Tag
20. HTML term: Tag
• HTML surrounds your text with what’s called
• Tags describe what the content is (is it a
paragraph of text? A heading? A table? A list of
• Tags are surrounded by angle brackets <>
• Tags usually come in pairs:
• Starting tag: <html>
• Ending tag: </html>
21. Learning HTML tags
• You learn HTML one tag at a time.
• We are going to start by learning the following
• html, head, title
• p, h1-h6, strong
• We will then move on to:
• a, img
22. First things ﬁrst:
What is HTML? Doctype
• The very ﬁrst thing on an HTML page is
• Doctype tells us what kind of standards the
page is using.
• It is an instruction to the web browser
about what version of the markup language
the page is written in.
• To read more: http://www.w3schools.com/
23. Beginning our page in Aptana
• Open up Aptana.
• Go to File > New > Untitled HTML ﬁle.
• You should get a new page that looks like
24. Basic tags: html, head, title
• The ﬁrst tag we're going to add is <html>.
• Make sure you add the opening and closing
tags: <html> and </html>.
• If you are using Aptana, this should
25. Basic tags: html, head, title
• After <html>, the next tag we'll add is
• The head tag allows you to deﬁne
metadata for search engines, as well as
things like the page's title.
• Let's change the default <title> to Girl
26. Nesting of HTML tags
• Some tags can be nested within other tags.
• title, for example, is nested inside the head
<title>Girl Develop IT!</title>
Now open the browser, and we're going to use
our browser to open the HTML ﬁle we've
created, and see how it looks thus far
27. Status Check
Now close head. And close html.
So far, you should have something like this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
<meta content="text/html; charset=utf-8" http-
<title>Girl Develop It!</title>
28. HTML term: Element
• A starting tag + some text/content + an
ending tag is called an HTML Element.
• Examples of elements:
• <p>this is my great paragraph. I really hope
you like it, I put a lot of thought into it.
No, really, I did.</p>
• <strong>this is some bold text!!</b>
• Element = <tag> + text + </tag>
29. More HTML Tags: body
• The next tag we will add is <body>.
• The body element typically contains
the main content of your page.
• Remember, the body element means: <body>
+ some content + </body>
30. More HTML Tags: p, h1-h6
• h1-h6 creates Headers of varying sizes.
h1 is the largest header.
• strong creates bold text.
• p creates a new paragraph of text.
31. Experimenting with Text and Headings
• Let's play around with the tags p, h1 - h6, and strong.
• Add some text to your page. If you need inspiration, you
can copy/paste the text on this slide. We're going to add
some tags to vary the size and weight of the font.
• Try wrapping one sentence in h1 tags, and see what
<h1>This is a h1 element</h1>
<strong>Try wrapping another sentence in strong
<p>try wrapping a long block of text in p tags</p>
32. Spacing your content
• There are three main ways to add whitespace
around your content:
• p we already learned about.
• br stands for break, and will create a new line
break. It looks like this: <br/>
• stands for non-breaking space, and will
create one literal space ( ).
35. Self-Closing Tags
• Tags usually come in pairs...but not always
• Most tags have a starting and ending tag.
• However, some tags are “self-closing” tags.
•They don’t require a closing tag, because
you don’t have anything to sandwich
•All the information you need is in the ﬁrst
• Example self-closing tags: br, img
36. More HTML Tags: a
• The tag a is probably one of the most
frequently tags in all of HTML.
• It links you to an external page, or a
sub-section of your own page.
• <a href="http://www.twitter.com">Go
• Try it yourself: http://w3schools.com/
37. Our ﬁrst look at HTML attributes
• We're going to specify where the link
should take the user to.
• We use an HTML attribute to specify
where we want the a tag to link to.
38. HTML Term: Attribute
• Attributes provide additional information
about HTML elements.
• Attributes are formatted like this:
• Attributes are always speciﬁed in the
• Attribute values should always be in quotes.
• An example: in <a href="http://www.google.com">, href is
39. More HTML Tags: a
• Let’s try adding some a tags with
href attributes to our page.
• <a href="http://www.twitter.com">Go to
• I’m taking a class with <a href=”http://
www.girldevelopit.com”>Girl Develop It</a>
• My guilty pleasure is reading <a href=”http://
40. More HTML Tags: img
• Another very common HTML tag is
the img tag, which creates images.
• The img tag has lots of attributes you
• The most important one is the src attribute.
• Without a src, you won’t display an image!
41. More HTML Tags: img
• The img tag has lots of attributes you
• alt: Speciﬁes an alternate text for an
image. Used by search engines, and by
42. More HTML Tags: img
• Let’s try adding a few images to our
• Search on google to ﬁnd a few images.
• Right-click the image and choose
“copy image location”
• Paste the URL into your src attribute:
• <img src=”http://...” />
43. More HTML Tags: table
• The main column of the Girl Develop
IT homepage is divided into two
subsections: one white, one pink.
• These two sections are both
contained within an HTML table.
44. Adding a table to our page
• Tables are composed of rows and columns.
• Rows in HTML are denoted by the tag tr.
• Columns are the tag td.
• Let’s try this at the w3schools: http://
45. Adding a table to our page
• Copy/paste this into your page.
<!-- left column section -->
<!-- right column section -->
46. HTML Comments
• <!-- is the starting tag of a comment.
• --> is the ending tag of a comment.
• Anything in between <!-- and --> will be ignored
by the browser.
• This is a great way to make notes to yourself, or
to take something off your page as an
experiment, without deleting it.
• <!-- this is my ﬁrst comment! -->
47. HTML Validation
• A good way to make sure your HTML
is valid, and doesn't have any errors, is
to validate it.
• Aptana can do this for you.
• You can also ﬁnd many sites on the
web that will allow you to copy/paste
your code in, and it will point out any
49. Your Homework
• As a homework assignment, you should:
• 1) Review the following links on
w3schools, a great online resource:
• The a tag: http://www.w3schools.com/tags/tag_a.asp
• The img tag: http://www.w3schools.com/tags/tag_img.asp
• 2) Go to the w3schools HTML tag list: http://
• Pick three tags we did NOT cover today
• Experiment with the “Try it Yourself” links on the three
tags you choose.
51. How do I create a website?
1. Register a Domain
2. Get Hosting for that
52. Jargon Alert!
The process of claiming / reserving a domain
Lasts for one year, then you must renew the
domain if you want to keep it. Should not cost
you more than $10/year.
53. Step One: Registering a Domain
• Lots of choices:
• I recommend dreamhost
54. Step Two: Getting Hosting for the
• Once you’ve secured the domain, you need a
way to make it available for others to see!
• You need someone to host your domain in
order to use a domain you’ve registered.
• A hosting service provides you with a
• The server is what actually makes your
website viewable from any browser, on any
55. Jargon Alert!
I’m so A server is just a computer!
lonely... A dedicated computer that
does nothing but sit around
and wait for you to call.
When someone types in
(blahblah.com), the server
receives the request, and
serves you back the
56. How Do Servers Receive your
• When someone types in your domain
(blahblah.com), how does your request
get to the server?
• Through DNS: Domain Name System
• DNS is like a phone book.
• It takes a domain (blahblah.com) and
looks up the IP address for that
domain. This is the IP address of the
server that hosts your domain.
57. Jargon Alert!
The “address” of your computer. It tells
the Internet how to connect to a given
Every single computer that is connected
to the internet has a unique IP address.
58. Hosting your Domain, Continued
• A dedicated server will allow multiple people
to connect to your site at the same time.
59. Hosting your Domain, Continued
• A good hosting company will allow many
thousands of people to simultaneously view
your site, with no crashes.
• Even a good hosting service may not be able
to prepare you for “The Oprah Effect”
• If you are on Oprah, and a million people all
try and access your site at once, your
server may crash!
• If you have plans to go on Oprah, hire a network specialist to guard your
site against crashing!
60. Hosting your Domain, Continued
• Who should I use for hosting?
• Again, you have lots of choices. Some common
• dreamhost.com -- what I use and
• Comprehensive list: http://ietherpad.com/3GA5A4CG9F