Course Notes
Course Notes
Course Notes
I think you are going to be surprised at how easy it is to build great looking sites fast and hopefully you have
flashes of feeling like you have a new super power.
Download Resources
● Sublime Text
● Google Chrome Browser
● Bootstrap
1. Go all the way through the course the first time following along typing in the code yourself.
2. After the first time, then go to create your own site - any type of site it doesn't have to be the same
style and structure as the One Million Lines site - and use these videos, source codes, and other
learning materials provided in the lessons as guides
3. QUANTITY over quality. What I mean by that is to not worry about creating the perfect site, with the
perfect code and don't worry about messing up. Instead just focus on creating sites as fast as you
can. In the process of pumping out sites you'll find yourself doing the same actions such as adding
images or creating 3 columns as well as many others and they'll become second nature to you over
the time.
4. Practice in shorts bursts. I don't recommend you going through this course in its entirety in one
sitting. Instead spread out the learning over a couple days with hour long sessions to keep you
excited and wanting more. During those hours sessions create breaks and break up the 1-2 hours
into short bursts. Use e.ggtimer to set a timer and practice in 20 minute bursts with 5 minute breaks
afterwards.
5. I can't stress this enough, but repetition, repetition, repetition. Keep creating, keep building sites
and it will be second-nature in no time
** I’ve upgraded the course content and experience. Click here to enroll for free **
6. Code snippets will be included in lessons so you can easily copy and paste or type the code. If
you're ever having trouble getting the code to work or look the same in your browser as it does in
the lesson you can always find the zipped source code for that file at the bottom of each lessons
page. Click on the link to download, unzip the file, and you will have all the files as they should be at
the end of that video.
Let's dive into bootstrap and get your first site up.
2. Unzip the bootstrap folder and rename "dist" folder as "first-site" folder
NOTE: IF you are a PC user when you zip/extract the Bootstrap zip file it will take you to a folder titled
bootstrap-3.1.1-distor with a number similar to that - 3.1.1 is the Bootstrap version number. Take that
file and rename it first-site. Then copy the file and paste it on your desktop. Once you've done that
open the first-sitefolder in Sublime as directed in the next step.
5. Open the index.html file in google chrome to view your first ever web site!
Find your file (in finder for mac, in your folders for pc) and right click on it selecting "open with" > "Google
Chrome". Nerdy tidbit: Hello World is common practice among coders to do as their first program or output
in any new coding language. Welcome to our world!
** I’ve upgraded the course content and experience. Click here to enroll for free **
1. Go to Bootstrap's getting started section and grab the Jumbotron template at 0:35
After you click to open the Jumbotron template then right click on the page and select "view page source".
Copy the entire HTML document and replace all the code in your "index.html" file currently with the copied
code. Save the new index.html file.
to
Link Notes
We're creating the link so that it is relative to the current file. In other words we're telling the browser how
to get to (or the path to) the correct CSS document from the index.html file. So "css/bootstrap.min.css" is
** I’ve upgraded the course content and experience. Click here to enroll for free **
telling the browser to look for the "css" folder that is in the current folder - which is "first-site" - then go into
it and find the "bootstrap.min.css" file.
"bootstrap.min.css" file. Don't worry if you don't understand this right now. You will see it in action
soon and it will soon become second-nature.
5. Bonus** You don’t need to know this, but is an interesting tidbit. A “min” file is a minimized version
of a file. So instead of linking to a .css file in this lesson we are linking to a .min.css file. Browsers
have to read the entire CSS file to interpret it. What a minimized version of a file does is take out all
the unnecessary spaces and line breaks so that the browser can read the file faster and thus your
site loads faster. Every extra line and space in a document makes it longer to for the browser to
interpret it. Minimized files eliminate these unnecessary wastes.
In this lesson we'll explore how to combine templates, use Chrome's dev tools, and utilize Bootstrap's
native components to start putting together the site fast.
index.html
change
<div class="form-group">
<input type="text" placeholder="Email" class="form-control">
</div>
<div class="form-group">
<input type="password" placeholder="Password" class="form-control">
</div>
<button type="submit" class="btn btn-success">Sign in</button>
</form>
</div><!--/.navbar-collapse -->
</div>
</div>
to
to
index.html
<ul class="nav navbar-nav navbar-right">
to
NOTE: We'll worry about the href in the above code later in the course
visually. In the example below the div with class navbar is the parent element of the div with class of
container. The ul is a child element of the div with class collapse and navbar-collapse. At the same
time the ul is the parent element of the two li HTML elements
2. The Inspect Element feature of Google Chrome is an awesome tool to experiment and use as your
sandbox to try new things and learn about how changes in CSS and HTML will look live on your site.
You’ll become much more familiar with this tool throughout the course.
Divs are all over HTML documents. Understand divs and you'll be like an HTML magician. Feel the power!
** I’ve upgraded the course content and experience. Click here to enroll for free **
Lesson Notes
CSS controls the style of your site. Make your first CSS rule and start transforming the site from boring text
to sexy startup quality.
<h1>Hello, world!</h1>
to
NOTE: <br>is a line break in HTML. Notice on the web page that after each <br>the text goes to a new
line
to
<p>All over the country people are taking the <strong>HOUR OF CODE</strong> challenge
issued by <strong>CODE.org</strong>. Millions of lines of code are being written. In
the capital of Florida, Tallahassee, the community is taking the challenge and our goal
is to write 1,000,000 lines of code_</p>
NOTE: <strong>boldens the text that the opening and closing strong tags wrap.
NOTE: The above code translates to "for any div with a class 'jumbotron' align all text in the center." This is
your first CSS rule. Make sure you follow the syntax exactly.
About the inspect element feature: When you have the proper HTML element selected you can type CSS
declarations for that HTML element on the right in the element.style section. For example, in this part of the
video I have selected the div with a class of jumbotron so whatever CSS declarations I put in the
element.style section will apply to that div only. To reset the style just reload the page. This feature is your
sandbox to have fun!
index.html
change
to
Lesson Notes
● In addition to <br>and <strong>an opening and closing <em>tag makes the text it surrounds
display in italics.
● Giving an HTML element a class is just a naming convention so that we can know what to refer to it
as and assign it a style in CSS. There is also an id naming convention which we will cover later
including when to use which one (id or class).
● You denote a class in CSS by putting a period in front of the class name. For the example, in the
video we defined styling for the jumbotron class in our CSS document by typing .jumbotron
● Look at the image below to learn more about CSS syntax and the different parts of a rule
** I’ve upgraded the course content and experience. Click here to enroll for free **
css/custom.css
.btn-lg {
font-size: 36px;
}
NOTE: After you change this above, inspect the button as I did in the video. Notice on the right how there is
a .btn-lgCSS rule from the "jumbotron.min.css" document that makes a declaration font-size: 18px.
Also notice how that declaration is crossed out and the CSS rule you made in "custom.css" is above it and
the declaration .btn-lg { font-size: 36px; }is not crossed out. This is because we included the
custom.css file lower in our HTML document than the bootstrap.min.css file. So now when any
declarations or rules conflict between Bootstrap’s and our custom.css file the one in our custom.css file
takes priority.
** I’ve upgraded the course content and experience. Click here to enroll for free **
Lesson Notes
● 3 ways to include CSS
○ External - how we’ve been doing with custom.css
○ Internal - in the header as shown in the video
○ Inline - using the style attribute within the element’s opening tag
● External and internal style sheets have the same priority (assuming the rules have the exact same
HTML selectors) so whichever is read last (in other words included in the head section further down
in the document) will be the CSS rule that takes place. This is why we are able to overwrite
Bootstrap’s CSS with our own custom.css - because we include the custom.css lower in the HTML
document.
● So the above bullet as to do with the cascading part of CSS. Now let’s talk about specificity. If there
are two competing style rules for an element the CSS rule that had the more specific selectors will
take priority. In other words if one rule says all text in a div with a class of jumbotron should be red,
but then there is another rule that says all text of any p that is in a div with a class of jumbotron
should be blue. Which color will the p text be? Well which is more specific? In the first rule it
applies to any HTML element in a div with that class, but in the second rule it is limiting it only p’s in
a div with that class. Thus the second rule is more specific so the p text will be blue and other html
elements their text will be red.
● Inline styling is the most specific styling and will take highest priority so that the inline style rule will
occur. This is because when you style an individual HTML element you can’t get more specific than
that because you a declaring a CSS rule for that HTML element alone and no other.
● Use External Stylesheets so that you can make small CSS changes across your site quickly
● In this lesson we made a CSS rule with the font-size property. You can learn more about the
font-size property and other CSS font properties here. I like to use pixels when I refer to font-size
because it gives the browser an exact size, but some developers use em or % which are relative
measurements.
If you've ever heard of Steve Jobs you know that fonts are critical in the design of a product. Let's learn to
put any font you want into your website.
** I’ve upgraded the course content and experience. Click here to enroll for free **
index.html
include
2. Make CSS rule for ul.nav and .jumbotron h1 to have Arvo font
css/custom.css
ul.nav, .jumbotron h1 {
font-family: ‘Arvo’, courier, serif;
}
This will change the font-family of an ul with a class of nav and any h1 in a div with the class "jumbotron".
NOTE: You could include multiple font-family names after Arvo for fallbacks (as we did here) in case Arvo
doesn't load correctly from Google. Learn more about how to do that here.
Lesson Notes
● So we’ve seen 2 new types of selectors in CSS in this lesson. Last lesson we did .jumbotronto
define styling in any HTML element with a class of jumbotron.
○ However in this less we used .jumbotron h1to style only h1 tags in our div with the
jumbotron class. So this is saying any HTML element with a class of jumbotron that has an
h1 within it (another way to say would be that has an h1 child element) style those h1’s this
way.
○ Then we also used ul.navin this lesson. This says any ul that has a class of nav style it this
way. So you may be asking the question well we didn’t put div before .jumbotron. We could
have. So we could have said div.jumbotronand it would be referring to only divs with a
class of jumbotron, but since in our HTML we have only given a class of jumbotron to divs
and we haven’t given any uls or any other type of HTML element the class of jumbotron then
it doesn’t matter.
○ So notice the difference in the two naming conventions of the above examples with the
selectors. A selector with a class and then an HTML tag (ex. .jumbotron h1) refers to the
styling of the h1 child elements of divs (or any HTML element for that matter since div wasn’t
specified) with a class of jumbotron. In contrast to an HTML tag followed with a class in a
selector refers to only HTML elements that are the tag mentioned and has the class
** I’ve upgraded the course content and experience. Click here to enroll for free **
mentioned, for example p.leadrefers only to paragraphs with a class of lead (the HTML
would look like this <p class=”lead”>content</p>).
● Also we’ve seen in this video that you can combine multiple selectors in one CSS rule. To do this all
you have to do is separate the additional selectors with a comma and a space - for example:
ul.nav, .jumbotron h1 { CSS rule content here }.
Every html element is a rectangular box. Understand this along with what margin, padding, and border and
you’re on your way to being a website ninja
1. Change the list items <li>in the unordered list <ul>to be smaller
css/custom.css
ul.nav {
font-size: 13px;
}
.jumbotron p {
margin-bottom: 30px;
}
Lesson Notes
● Every HTML element is in the shape of a box and has the box model applied to it. Inspect elements
on the page and highlight various HTML elements in order to see this in action.
● When inspecting HTML elements in Google Chrome blue is the HTML element itself, green is
padding, and orange is the margin.
** I’ve upgraded the course content and experience. Click here to enroll for free **
● The HTML element and the padding is within the border. Margin is outside the border. Use padding
if you want to add spacing within the border; in other words if you want to expand the background
color of that particular element. Use margin if you want to add spacing outside of the border. With
margin the spacing will have the same background as that particular elements parent HTML
element.
● You can visualize what an element's parent is by indentation in the inspect element area. In our
video example the <body>element is the parent of the <div class="jumbotron">element. See
how the <div class="jumbotron>is indented one tab in and under the<body>element. Then when
you click on the arrow to the left of the <div class="jumbotron>to open it you'll see<div
class="container>appear which is the child element of the <div class="jumbotron>element.
● There are multiple ways to declare the padding and margin for an HTML element. We went over
them in the video and you can use the image below to as a reference.
** I’ve upgraded the course content and experience. Click here to enroll for free **
Lets go through how to add images to your site so that it really pops, both through HTML and CSS. And
now we'll be done with the top section. Pat yo' self on the back!
index.html
include
The altattribute is what will show if the image loads incorrectly and the titleattribute is what will show if
you hover over the image long enough with your mouse. These are optional, but can help your site's
accessibility say if the image doesn't load correctly or if someone who is visually impaired comes to your
site - the screen reader will read what image should be there since they can't see it. Every HTML element
has a set of HTML attributes that go along with it. You can always find them for each element at
w3schools.com.
css/custom.css
.jumbotron {
text-align: center;
background-image: url(“../images/hero_image.jpg”);
}
● We were introduced to links earlier. The only thing new we're adding here is ../which tells the
browser to exit the current folder. In other words, we're in the custom.css file so we're in the CSS
folder. We tell the browser to exit the CSS folder so then its in the first-site folder. From there we tell
it to find the images folder images. To enter the images folder /and then to find the
hero_image.jpg image.
● In this lesson we've use the background image. There are also other background properties you can
learn about here.
** I’ve upgraded the course content and experience. Click here to enroll for free **
3. Correct font weight, font size and spacing (padding and margin)
css/custom.css
.jumbotron h1 {
margin-top: 0px;
margin-bottom: 50px;
}
.jumbotron p {
margin-bottom: 30px;
font-weight: 100;
padding: 0 50px;
}
index.html
change
to
Use the image below as a reference when creating new image tags.
** I’ve upgraded the course content and experience. Click here to enroll for free **
Lets go into bootstrap's grid system so you can learn to make the site look exactly however you want it.
With the added understanding of floats you can build any complex-looking site.
Lesson Notes
● In .col-md-4the number represents the width, more specifically how many columns wide of the
12-column layout. In other words that div will be 4 columns wide. Since it is out of 12 it will be 1/3 of
the page’s width. Look at the image below for a quick cheat sheet on the grid system and div
widths.
● Rules
○ Rows are placed w/in a container div
○ Only columns may be immediate children of rows
** I’ve upgraded the course content and experience. Click here to enroll for free **
Use links to control the flow of users from and through your site. In this lesson we cover the different types
of links
1. Update content
index.html
change
<div class="row">
<div class="col-md-4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac
cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet
risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
<p><a class="btn btn-default" href="#" role="button">View details »</a></p>
</div>
<div class="col-md-4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac
cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet
risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
<p><a class="btn btn-default" href="#" role="button">View details »</a></p>
</div>
<div class="col-md-4">
<h2>Heading</h2>
<p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam.
Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus
commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>
<p><a class="btn btn-default" href="#" role="button">View details »</a></p>
</div>
</div>
to
<div class="row">
<div class="col-md-4">
** I’ve upgraded the course content and experience. Click here to enroll for free **
<h2>Students</h2>
<p>Want to learn how to code? Want to help us get to 1,000,000 lines? Click the
button below and we'll let you know how to get involved.</p>
<p><a class="btn btn-default" href="#" role="button">Start Learning »</a></p>
</div>
<div class="col-md-4">
<h2>Educators</h2>
<p>Want to bring this initiative to your school or institution? Awesome! Click
the button below and we'll make it happen.</p>
<p><a class="btn btn-default" href="#" role="button">Join The Iniative
»</a></p>
</div>
<div class="col-md-4">
<h2>Sponsors</h2>
<p>We love all the support we get to help host more events, and empower more lives
with the knowledge of coding. Click to get involved.</p>
<p><a class="btn btn-default" href="#" role="button">Give Support »</a></p>
</div>
</div>
<a> Notes
● Use the hrefattribute to determine the URL (aka the address) of what page or website the browser
will go to when the user clicks on a link
● Absolute link/URL: Starting a href with http://will direct the user to the exact site destination
specified afterwards. In other words I used http://google.comas an example in the lesson. Users
will be directed to google.com when they click on that link.
● Relative link/URL: Take away http://and you can link to other pages within your site. The
destination page is relative from the current page the link is in and you declare the path the same
way we did earlier with images. In other words if you are currently in the index.htmlfile and you
want to create and link to another page in the "first-site" folder titled grid.htmlyou would do
href="grid.html". If the grid.html page was in a folder called "about" you would do
href="about/grid.html".
● Use target="_blank"to open link in a new tab.
● Added Bonus: you can use href="mailto:[email protected]"so that if
someone clicks they will be set up to email you.
** I’ve upgraded the course content and experience. Click here to enroll for free **
● You can also see more special HTML character symbols here.
Learn how to bring in Google Forms. An awesome, free tool to get feedback from you site users and put a sense of
interactivity in your site
NOTE: You can also embed the form into your site so that you can style it to look like your site. We will cover this
when we discuss embedding iframes into your site.
Font-awesome allows you to include professional quality icons in your site free and easy to give it that
extra pop.
2. Unzip the font-awesome.zip and rename the resulting unzipped folder as "font-awesome".
3. Take the font-awesome folder and drag or paste it into the fonts folder within your first-site folder
On a mac you can grab the font-awesome folder and drag it into the "first-site/fonts" folder as in video.
With PCs you may have to highlight the font-awesome folder and copy it. Then find the "fonts" folder (wihin
your "first-site" folder), highlight it, and then click paste and the font-awesome folder should now be within
the fonts folder.
index.html
add
index.html
add
** I’ve upgraded the course content and experience. Click here to enroll for free **
above <h2>Students</h2>
NOTE: If you have any trouble including it correctly check the source files to see how to include it correctly.
index.html
change
<div class="row">
<div class="col-md-4">
<h2>Students</h2>
<p>Want to learn how to code? Want to help us get to 1,000,000 lines? Click the
button below and we'll let you know how to get involved.</p>
<p><a class="btn btn-default" href="#" role="button">Start Learning »</a></p>
</div>
<div class="col-md-4">
<h2>Educators</h2>
<p>Want to bring this initiative to your school or institution? Awesome! Click
the button below and we'll make it happen.</p>
<p><a class="btn btn-default" href="#" role="button">Join The Iniative
»</a></p>
</div>
<div class="col-md-4">
<h2>Sponsors</h2>
<p>We love all the support we get to help host more events, and empower more lives
with the knowledge of coding. Click to get involved.</p>
<p><a class="btn btn-default" href="#" role="button">Give Support »</a></p>
</div>
</div>
to
<div class="row">
<div class="col-md-4">
<span class="fa-stack fa-4x">
** I’ve upgraded the course content and experience. Click here to enroll for free **
Spans let you style inline-elements. Use it if you want to make certain words, phrases, or other inline
elements stand out with a different color or style.
In this example we used span to change the font color and size, but you could use it to do a variety of other
things with the font. Go ahead and play around with different font and text properties, combine them, and
see what they do. You can find a list of different font properties here.
<div class="container">
<!-- Example row of columns -->
<div class="row">
<div class="col-md-4">
<span class="fa-stack fa-4x">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-user fa-stack-1x fa-inverse"></i>
</span>
<h2>Students</h2>
<p>Want to learn how to code? Want to help us get to 1,000,000 lines? Click the
button below and we'll let you know how to get involved.</p>
<p><a class="btn btn-default" href="#" role="button">Start Learning »</a></p>
</div>
<div class="col-md-4">
<span class="fa-stack fa-4x">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-pencil fa-stack-1x fa-inverse"></i>
</span>
** I’ve upgraded the course content and experience. Click here to enroll for free **
<h2>Educators</h2>
<p>Want to bring this initiative to your school or institution? Awesome! Click
the button below and we'll make it happen.</p>
<p><a class="btn btn-default" href="#" role="button">Join The Iniative »</a></p>
</div>
<div class="col-md-4">
<span class="fa-stack fa-4x">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-money fa-stack-1x fa-inverse"></i>
</span>
<h2>Sponsors</h2>
<p>We love all the support we get to help host more events, and empower more
lives with the knowledge of coding. Click to get involved.</p>
<p><a class="btn btn-default" href="#" role="button">Give Support »</a></p>
</div>
</div>
<hr>
<footer>
<p>© Company 2014</p>
</footer>
</div> <!-- /container -->
to
button below and we'll let you know how to get involved.</p>
<p><a class="btn btn-default" href="#" role="button">Start Learning »</a></p>
</div>
<div class="col-md-4">
<span class="fa-stack fa-4x">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-pencil fa-stack-1x fa-inverse"></i>
</span>
<h3>Educators</h3>
<p>Want to bring this initiative to your school or institution? Awesome! Click
the button below and we'll make it happen.</p>
<p><a class="btn btn-default" href="#" role="button">Join The Iniative »</a></p>
</div>
<div class="col-md-4">
<span class="fa-stack fa-4x">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-money fa-stack-1x fa-inverse"></i>
</span>
<h3>Sponsors</h3>
<p>We love all the support we get to help host more events, and empower more
lives with the knowledge of coding. Click to get involved.</p>
<p><a class="btn btn-default" href="#" role="button">Give Support »</a></p>
</div>
</div>
<hr>
<footer>
<p>© Company 2014</p>
</footer>
</div> <!-- /container -->
2. Center align the font and style the h2 and h3 tags in the Get Involved section classes
css/custom.css
add
** I’ve upgraded the course content and experience. Click here to enroll for free **
.homepage {
text-align: center;
}
.homepage h2 {
font-size: 30px;
}
.homepage h3 {
font-size: 26px;
}
.homepage p {
font-size: 21px;
font-weight: 300;
}
.homepage a {
color: #e74c3c;
}
Lesson Notes
● You can give HTML elements multiple classes by separating them with a space as we did in this
video <div class="container homepage">. This div has 2 classes: homepage and container.
● Let’s talk about colors. The color of your site is very important to the styling and feeling a user gets
when visiting. In the past lessons I have been using word values for color; I do not recommend
this for final product sites. The pre-assigned color words are harsh on user’s eyes. Instead I
recommend using hexadecimal values as in this video. Hexadecimal values give you millions of
different color options with all types of shading. You can find different color schemes all over the
internet and you can even grab different colors from sites you love now that you know how to use
** I’ve upgraded the course content and experience. Click here to enroll for free **
the inspect element feature. One of my favorite sites to grab colors from is flatuicolors.com. Go to
the site, click on the color you want to use, and that color’s hexadecimal value will be copied for you
to paste into your code.
1. Include the hr
index.html
add
<hr>
css/custom.css
add
.homepage hr {
border-top: 1px solid #e74c3c;
width: 150px;
margin-top: 15px;
}
Lesson Notes
● If you want to center a block element in the middle of its parent element make sure to give it a left
and right margin value of auto for example margin: 10px auto. In this case that HTML element
would have a top and bottom margin of 10 pixels and would be centered.
● Also in this lesson you saw two different types of values for width: % and px. Percentage (&) is
relative to the parent element, in the case shown in the video the <hr> % width was relative to the
container div. That is why it became smaller as decreased the width of the page’s viewing area. A
pixel width is absolute and stays the same length without regard of the page’s viewing area or the
parent element. As stated with font-size which value to use changes per the occasion and the
intended result. If you are trying to style a div and you know you want that div to be half the size of
that div’s container div then give it a width of 50%. If you are styling a line like we are here and we
want it to be an exact width then use pixels.
** I’ve upgraded the course content and experience. Click here to enroll for free **
2. Put in image
You can grab image from the lesson’s download tab.
index.html
<img src="images/academy_brand_med.png" title="MASSIVE Academy" alt="MASSIVE Academy">
We’re rockin’ and rollin’ now as we style links for when users hover over them and get an introduction to
pseudo-classes.
.homepage a:hover {
color: #e74c3c;
text-decoration: none;
** I’ve upgraded the course content and experience. Click here to enroll for free **
opacity: .8;
}
Lesson Notes
● The opacity property is the transparency of the HTML element. Its on scale from 0 to 1 with zero
being completely transparent to 1 being not transparent at all. A value of .8 would be about 20%
transparent. I like to use opacity with links when they’re hovered to show a slight change in color as
shown in the video - neat little trick.
● Bonus: This wasn’t covered in the video, but you can combine opacity and color by giving an html
element an rgba value. So you can convert hexadecimal values to rgb values here. By doing this our
hexadecimal salmon color (color: #e74c3c;) can also be styled in CSS with the following code
color: rgb(247, 76, 60);. Then to give it the slight change in color with the opacity when
someone hovers you could use the following CSS code color: rgba(247, 76, 60, .8);. Some
people like to use the rgba value as a background-color. Say for example you wanted your header
to be slightly transparent for an effect you could use rgba.
Lets learn how to style full-width background colors in order to give our some subtle design beauty
css/custom.css
add
#get-involved {
background-color: #f5f5f5;
}
** I’ve upgraded the course content and experience. Click here to enroll for free **
.homepage {
text-align: center;
padding-bottom: 50px;
padding-top: 40px
}
Lesson Notes
● Notice the naming convention for id versus class. Where we have been identifying classes by
putting a .before the class name, to identify an id we put a #before the id name. Ex:
#get-involved.
● There will also be an added benefit to using the idtag later when we create links to certain parts of
our page from the navbar.
In this lesson we’ll learn about the benefits of IDs and when to use them versus classes
to
to
Lesson Notes
● When to use an ID vs a class? Use an ID when it is a unique element that will have its own type of
styling that no other element on your site will have or you can use ID to name an element that you
want to link to take a user to that section when a certain link is clicked. Use class when you have
multiple HTML elements that you want to style in a similar manner.
● IDs are more specific than classes so they will take priority. In other words if we wanted the h2 in
the get-involved section to have a different color than the h2 color we specified by coding
.homepage h2 { color: #ef4c3c; } we could have put in the rule #get-involved h2 {
color: black; }. In this case the h2 in the who we are section would still be that specified by the
homepage class, but the h2 in the get-involved section would be black since IDs are more specific
than classes. This is exactly like what we did with the “educator” ID example in the video.
A quick styling of the footer section and you have yourself your first website. Do a dance!
index.html
<footer>
<div class="container">
<p><img src="images/one_million_bottom_brand.png" alt="One Community_ One Million
Lines_"></p>
</div>
</footer>
** I’ve upgraded the course content and experience. Click here to enroll for free **
body {
padding-top: 50px;
}
Lesson 28: Making Your Site Look Good Across All Devices
We'll make the site look good across all devices with some responsive design and your bonus intro to the
awesome world of Javascript.
.jumbotron h1 {
font-size: 56px;
padding: 30px;
}
.jumbotron h1 {
font-size: 44px;
}
.jumbotron p {
padding: 0 10px;
}
#get-involved .col-md-4 {
padding-top: 20px;
padding-bottom: 20px;
}
.jumbotron h1 {
font-size: 24px;
}
.jumbotron p {
font-size: 16px;
padding: 0;
}
.btn-lg {
font-size: 18px;
}
.homepage p {
font-size: 18px;
}
footer img {
width: 80%;
}
** I’ve upgraded the course content and experience. Click here to enroll for free **
to
<script src=”js/bootstrap.min.js”></script>
to
Lesson Notes
● In this lesson we fix the link to Bootstrap’s Javascript. Javascript allows us to add functionality to
our site. You can see this in the video once we correct the link to the .min.js file as the button now
works - when clicked you see the drop-down menu appear. Pretty awesome right?! Through
javascript we can make our sites do some extremely cool things and build in functionality our users
will love. We’ll talk more about javascript and its capabilities in future lessons.
Lets get yo' site live and online with Dropbox for the world to see.
to
Lesson Notes
● Dropbox is a good service to use if you are working on a site and want to have it live from the
beginning for people to see - say if you have a client you are building a site for. Just transfer your
site's folder into the public Dropbox folder when you start building the site and everytime you make
changes in Sublime or any other text editor the changes will be shown live on the web for anyone to
see.
● Push: putting the site live online for people to access.
At this point you’ve come a long way in a short amount, possibly with no knowledge of HTML and CSS to
now knowing the building blocks of HTML and CSS, knowing how to put sites up and even having your
own site up.
So where do you go from here? Well, although you’ve made great strides there is still a healthy amount of
HTML and CSS for you to learn till you’re a true website building pro.
We cover all of this in my second course “Learn to Build Beautiful Websites with HTML5 and CSS3 in 1
Month”. In this course you will take the step to being a website building pro and not only able to build
websites, but websites that wow the user.
And since you are a repeating student I want to thank you and give you a chance to enter the course at
70% off what any other student coming to the course would pay.
So go ahead and take that next step towards completing your knowledge of HTML and CSS and start
building beautiful websites today. Click here to enroll for only $27 :)
** I’ve upgraded the course content and experience. Click here to enroll for free **
Want to learn Javascript? Click here to get early access to our Javascript course