Wifi Network:
Wifi Password:
If you have not already done so:
Girl Develop It is here to provide affordable and accessible programs to learn software through mentorship and hands-on instruction.
Some "rules":
Thank you for hosting!
Tell us about yourself.
A website is a way to present your content to the world, using HTML and CSS to present that content & make it look good.
A paragraph is your content
<p>A paragraph is your content</p>
A paragraph is your content
<tagname>Stuff in the middle</tagname>
<p> This is a sample paragraph.</p>
<br />
<img src="your-image.jpg" />
Not:
<br></br>
<img src="your-image.jpg"></img>
<div id="copyright">© GDI 2013</div>
<img src="your-image.jpg" />
<a href="http://girldevelopit.com">GDI</a>
selector {
property: value;
}
selector {
property: value;
property: value;
property: value;
}
Called a "selector" because it selects HTML elements.
Select all paragraph elements:
p {
property: value;
}
Select all image elements:
img {
property: value;
}
ID example:
<p id="footer">Copyright 2011</p>
Class example:
<p class="warning">Run away!</p>
The difference: A class can be used many times on a page. An ID should only occur once on a page.
IDs and classes can be used in your CSS as selectors.
Select the single element with an ID of "footer":
#footer {
font-size: 14px;
}
Select all elements with the "warning" class:
.warning {
color: red;
}
The difference: The '#' sign indicates an ID, whereas a period indicates a class in CSS.
Select all strong elements that are within a paragraph:
p strong {
color: yellow;
}
The associated HTML:
<p>This is <strong>important.</strong></p>
Awesome, right?
But how do people use this really?
Browsers apply default styles to HTML elements unless overriden.
Examples include:
One way to override the defaults: reset CSS
The goal: "reset" all browser defaults.
To reset most elements' styles:
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
Lists:
list-style: none;
Some sizes that are good to know about
Containers/wrappers are a good way to center content if the screen width is wider than your content.
The HTML:
<body>
<div class="wrapper">
<!-- website content goes here -->
</div>
</body>
The CSS:
.wrapper {
margin: 0 auto;
max-width: 1400px;
width: 100%;
}
Getting our feet wet
Two ways to link to another part of the same page:
<a href="#section">Go to the section ID!</a>
OR:
<a name="section">Go to the section ID!</a>
It's time to move beyond Times New Roman and Arial!
Two ways to add fonts:
Demo: Goole Web Fonts
Example of a link provided by Google Web Fonts:
<link href="http://fonts.googleapis.com/css?family=Audiowide|Quicksand:300,400,700|Lato:100,300,400,700,900,100italic,300italic,400italic,700italic,900italic" rel="stylesheet" type="text/css">
Download fonts and add them to the local site files.
To use the fonts, use @font-face at the very top of your CSS file:
@font-face {
font-family: 'EntypoRegular';
src: url('font/Entypo-webfont.eot');
src: url('font/Entypo-webfont.eot?#iefix') format('embedded-opentype'),
url('font/Entypo-webfont.woff') format('woff'),
url('font/Entypo-webfont.ttf') format('truetype'),
url('font/Entypo-webfont.svg#EntypoRegular') format('svg');
font-weight: normal;
font-style: normal;
}
Use your new fonts throughout your CSS:
body {
font-family: Lato, Arial, sans-serif;
}
Use your new-found knowledge!
Minimum information required to ensure that a browser renders using standards mode.
<!DOCTYPE html>
Old Doctypes:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
The use of HTML markup to reinforce the semantics, or meaning, of the information in webpages rather than merely to define its presentation (look).-Wikipedia
Not semantic:
<div id="header"></div>
<div class="nav"></div>
<div id="footer"></div>
Semantic:
<header></header>
<nav></nav>
<footer></footer>
Lots of divs (aka "divitis") lead to unsemantic code:
<body>
<div id="header">
<h1>Hi, I'm a header!</h1>
<div id="nav">
<ul>
<li><a href="foo">foo</a></li>
<li><a href="bar">bar</a></li>
</ul>
</div>
</div>
<div id="main">
<div class="article">foo</div>
<div class="article">bar</div>
</div>
<div id="footer">Hi, I'm a footer!</div>
</body>
More semantic with HTML5 elements:
<body>
<header>
<h1>Hi, I'm a header!</h1>
<nav>
<ul>
<li><a href="http://www.foo.com">foo</a></li>
<li><a href="http://www.bar.com">bar</a></li>
</ul>
</nav>
</header>
<section>
<article>foo</article>
<article>bar</article>
</section>
<footer>Hi, I'm a footer!</footer>
</body>
<!--[if lt IE 9]>
<script src="html5shiv.js"></script>
<![endif]-->
Modify the site to use semantic HTML