Skip to content

Instantly share code, notes, and snippets.

@kdipietro
Created April 7, 2013 00:30
Show Gist options
  • Save kdipietro/5328282 to your computer and use it in GitHub Desktop.
Save kdipietro/5328282 to your computer and use it in GitHub Desktop.
A CodePen by kdipietro. Linking Your HTML to CSS - In this snippet, we see how to link our stylesheet.css files to our HTML file.
<!DOCTYPE HTML>
<HTML>
<Head>
<Title>Linking Your CSS Stylesheet</Title>
<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
</Head>
<!-- ABOVE IS AN EXAMPLE OF THE SYNTAX YOU NEED TO LINK TO A CSS FILE. BELOW IS A DESCRIPTION OF THE ATTRIBUTES WITHIN THE TAG. --->
<Body>
<h1>Linking Your CSS Stylesheet</h1>
<p1>To link your HTML file to the CSS file that you created you must use the "< link >" tag.
<OL>
<li>The <span>"type"</span> attribute defines the file type that you are linking to.</li>
<li>The <span>"rel"</span> attribute defines the relationship between your HTML file and the file you are linking to.</li>
<li>The <span>"href"</span> attribute defines the location of the file you are trying to locate, using its URL. In most cases your stylesheet.css file will be in your root folder so you would just need to type the name of the file, as seen in the code.
Body{
background-color: black;
}
h1{
color: white;
text-decoration: underline;
}
p1 {
font-family: Arial;
color: LightGrey;
}
span{
color:red;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment