Girl Develop It is here to provide affordable and accessible programs to learn software through mentorship and hands-on instruction.
Some "rules"
Tell us about yourself.
By the end of the class, you will have built a simple site using HTML and CSS which includes images, lists, fonts, navigation header/footers.
HTML is the markup language that allows us to build websites
HTML is composed of HTML tags that together provide a blueprint for a webpage.
If you 'view the source', you see this
Content: Text, Media
+ HTML: Structure + Semantics
+ CSS: Presentation + Design
+ JS: Interactivity
= Your Website
A website is a way to present your content to the world, using HTML and CSS to present that content & make it look good.
Concrete example:
<p>A paragraph is your content</p>
This paragraph is has been styled with CSS.
All the files for your site should be stored within the same folder.
This includes:
index.html
INDEX.html
vs. index.html
.html
vs .css
vs .js
index.html
HTML pages are made up of elements.
Syntax:
<tagname>Content</tagname>
Example:
<p>This is a sample paragraph.</p>
The first thing on an HTML page is the doctype, which tells the browser which version of the markup language the page is using.
<!DOCTYPE html>
* The doctype is case-insensitive.
DOCtype, doctype, DocType and DoCtYpe are all valid.
After <doctype>, the page content must be contained between <html> tags.
<!DOCTYPE html>
<html>
</html>
head
: Information about the page, like its title.
body
: The actual content of the page, what shows up in the browser window.
<!DOCTYPE html>
<html>
<head>
<title>The title of the page</title>
</head>
<body>
The exciting content.
</body>
</html>
It's best practice to include meta tags that tells the browser the charset
and viewport
.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Title of the page </title>
</head>
</html>
More reading: W3C: Declaring character encodings in HTML, Google PageSpeed: Configuring viewport
Elements "nest" inside the tag that contains them.
What elements are nested here?
<html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Title of the page </title>
</head>
<body>
<p>A paragraph inside the body tag</p>
</body>
</html>
Notice: whichever element opens first, closes last.
Modify index.html
to have all the tags that you just learned.
(You'll add content later!)
Paragraphs allow you to format your content in a readable fashion.
* You can edit how paragraphs are displayed with CSS
<p>Paragraph 1</p>
<p>Paragraph 2</p>
<p>Paragraph 3</p>
<p>Paragraph 1</p> <p>Paragraph 2</p> <p>Paragraph 3</p>
<p>Paragraph 1</p>
<p>Paragraph 2</p>
<p>Paragraph 3</p>
Paragraph 1
Paragraph 2
Paragraph 3
* White space is only for humans. You can write your code with any spacing.
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
* Heading number indicates hierarchy, not size. Think of outlines from high school papers
<p>
This paragraph has <em>emphasized</em> text
and <strong>important</strong> text.
</p>
This paragraph has emphasized text and important text.
* Notice: em
and strong
are meant to indicate meaning through style. If you want to have italicized for appearance and not to communicate meaning, you should use CSS.
You're going to make a page about your favorite food, animal, or activity.
Syntax:
<tagname name="value">content</tagname>
*Values should be contained inside quotation marks.
To make a link, you need 3 parts:
<a></a>
taghref
attribute: web address where the link points<a href="http://www.girldevelopit.com">Girl Develop It</a>
produces:
Girl Develop It
Optional target
attribute tells the browser to open the link in a new tab.
<a href="home.html" target="_blank">Link Text</a>
More reading: Why external links should open in new tabs
Add 2 links that open in a new window.
href
?<a href="http://example.com">A link element contains text.</a>
<br/>
<img/>
<p>
Imagine there's no Heaven<br/>It's
easy if you try <br/>No hell below
us <br/>Above us only sky
</p>
Imagine there's no Heaven
It's easy if you try
No hell below us
Above us only sky
To make an image, you need 3 parts:
<img />
tagsrc
attribute: the location and name of the image filealt
attribute: a brief description of the image content<img src="img/circle-gdi-logo.png"
alt="Girl Develop It logo"/>
<img src="img/blinkylights.gif"
alt=""/>
More reading: When should alt text be blank?
<a href="filename.jpg">A file in same folder</a>
Subdirectories are listed without preceding slashes:
<a href="projects/another_file.html">A file from the projects folder</a>
<a href="http://www.girldevelopit.com/donate">Donate to GDI</a>
Lists can be used to organize any list of items.
You'd be surprised how often lists are used in web design.
<ul>
<li>List Item</li>
<li>Another List Item</li>
</ul>
<ol>
<li>List Item</li>
<li>Another List Item</li>
</ol>
Unordered list (bullets)
Ordered list (sequence)
Tables are a way to represent complex information in a grid format.
<table>
<thead>
<tr>
<th>First Name</th>
<th>Last Name</th>
</tr>
</thead>
<tbody>
<tr>
<td>Steph</td>
<td>Curry</td>
</tr>
<tr>
<td>Tina</td>
<td>Fey</td>
</tr>
</tbody>
</table>
Tables are made up of header row(s) with the column names, and body rows with the data:
First Name | Last Name |
---|---|
Steph | Curry |
Tina | Fey |
You can add comments to your code that will not be seen by the browser, but only visible when viewing the code.
<!-- Comment goes here -->
Comments can be used to organize your code into sections so you (or someone else) can easily understand your code. It can also be used to 'comment out' large chunks of code to hide it from the browser.
<!-- Beginning of header -->
<div id="header">Header Content</div>
<!-- End of header -->
<!--
<ol>
<li>List Item</li>
<li>Another List Item</li>
</ol>
-->