By Mila Gerova
HTML is the code that allows us to build websites
All the files for your site should be stored within the same folder.
Note: File names should not include spaces or special characters. File names ARE case sensitive.
<tagname>Stuff in the middle</tagname>
<p> This is a sample paragraph.</p>
<div id="copyright">© GDI 2013</div>
<img src="my_picture.jpg" />
<a href="http://girldevelopit.com">GDI</a>
All elements "nest" inside one another
Nesting is what happens when you put other containing tags inside other containing tags. For example, you would put the <p> inside of the <body> tags. The <p> is now nested inside the <body>
<body>
<p>A paragraph inside the body tag</p>
</body>
Whichever element OPENS first CLOSES last
<ul>
<li>
<p>A paragraph inside a list item</p>
</li>
</ul>
<div>
<p>Content<p>
<p>Content<p>
</div>
<div id="header">
<h1>Main Heading<h1>
</div>
<div class="sub-content">
<p>Some more content<p>
</div>
<p>Paragraph with <span class="yellow">yellow</span> text.</p>
Paragraph with yellow text.
<a href="http://www.girldevelopit.com" title="Girl Develop It Homepage">GDI</a>
<img src ="http://girldevelopit.com/pink-logo.png" alt = "Logo"/>
<p>
A paragraph with <em>Emphasized</em> text and <strong>Important</strong> text.
</p>
<ul>
<li>List Item</li>
<li>AnotherList Item</li>
</ul>
<ol>
<li>List Item</li>
<li>AnotherList Item</li>
</ol>
Unordered list (bullets)
Ordered list (sequence)
Tables are a way to represent complex information in a grid format.
Tables are made up of rows and columns.
<table>
<tr>
<th>Head</th>
<th>Head</th>
</tr>
<tr>
<td>Data</td>
<td>Data</td>
</tr>
</table>
Head | Head |
---|---|
Data | Data |
padding: 10px 20px 30px 40px;
CSS = Cascading Style Sheets
CSS is a "style sheet language" that lets you style the elements on your page.
CSS is works in conjunction with HTML, but is not HTML itself.
p {
color: blue;
font-family: 'Helvetica';
}
.red {
color: red;
}
#special {
font-family: Arial;
}
<p>Paragraph</p>
<p class="green">Paragraph</p>
<p class="red">Paragraph</p>
<p class="red" id="special">Paragraph</p>
selector {
property: value;
}
#footer {
property: value;
}
<p id="footer">Copyright 2011</p>
.warning {
color: red;
}
<p class="warning">Run away!</p>
p {
color: white;
background-color: red;
font-family: Arial, sans-serif;
}
p {
color: red;
color: #ff0000;
color: rgb(255, 0, 0);
}
p {
font-style: italic;
font-weight: bold;
font-size: 10px;
font-family: sans-serif;
}
<p style="color:red">Some text.</p>
EMBEDDED:
<head>
<style type="text/css">
p {
color: blue;
font-size: 12px;
}
</style>
</head>
LINKED:
<head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
alert("hi there");
var age = 20;
if (age >= 35) {
console.log('You can vote AND hold any place in government!');
} else if (age >= 25) {
console.log('You can vote AND run for the Senate!');
} else if (age >= 18) {
console.log('You can vote!');
} else {
console.log('You have no voice in government (yet)!');
}
By Laura Pérez @lpmayos
Frontend frameworks usually consist of a package made up of a structure of files and folders of standardized code (HTML, CSS, JS documents etc.)
Let's take a look at the Bootstrap website to see what kind of resources we can use.