Style your first page
If you haven't before, go to Dash and sign up for an account. Once you've done so, go to the Projects and complete the one entitled Build a Personal Website. This will teach you the basics of adding CSS to your HTML, and should take you about thirty minutes.
To add an external stylesheet to your simple index.html
file:
<head>
. This is bad practice. Instead, we're going to add an external stylesheet (that just means that the stylesheet is elsewhere, and not in the index.html
file). index.html
, and call it 'css'.style.css
.body { background: blue; } p { text-align: center; color: green; }Remember, you do not need any
<style>
tags in your CSS file.style.css
, and return to index.html
.index.html
now, you'll see that nothing has happened. You need to link the stylesheet to it, so that index.html
knows to look elsewhere to find CSS.<head>
, add your file using the following code snippet: <link rel="stylesheet" href="style.css">
.