Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Treehouse Club: JavaScript!
You have completed Treehouse Club: JavaScript!
Preview
Why you want to use an external stylesheet and how to use the file tree.
Code for copy/paste:
/* Background Color */
html {
background:#3D475F;
}
/* Body */
body {
margin: 0 auto;
max-width: 800px; <br>
}
/* Images */
img {
width: 100%;
}
.car {
display:block;
margin: 100px 0 50px 0;
padding: 0;
}
/* Links */
a {
background: transparent;
border: 0;
display: block;
float: left;
margin: 0;
outline: 0;
padding: 0;
width: 33%;
}
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
In our code we have an index.html file,
0:00
that holds all of our html and JavaScript
for our page.
0:02
I've also connected an external style
sheet for our CSS.
0:08
It's good practice to use an external
style sheet as you
0:12
start making websites with multiple pages.
0:15
To link to our style sheet,
0:18
we'll have to start an html document, up
here in the head.
0:19
I've labelled the link to the style sheet
with a comment, so you can find it easily.
0:23
As expected it has an href attribute,
which defines the path to the style sheet,
0:28
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up