Hello World
- Open a terminal, navigate to ~/SD/HTML/, create an HTML file and a CSS file, and edit these two files with
atom.
cd ~/SD/HTML/
touch index.html
touch myStyles.css
atom .
-
Once in Atom, open
index.html. At the very top of this file, typehtmland pressreturn. This should create a basic, well-formed, HTML document for you. -
Inside of the
<head>of your HTML document add the following:
<title> Hello World </title>
<link rel="stylesheet" type="text/css" href="myStyles.css">
- Inside of the body of your document:
- Create two
<p>elements (with brief text of your choice). - Create two unordered lists (each with a few
<li>s of your choice). - Create two
<h1>elements (with brief text of your choice). - Assign the class
font40to the first<p>tag and to the first<h1>tag. - Assign the id
header2to the second<h1>tag. -
Assign the ids
list1andlist2to the two<ul>tags. -
Open up a new Browser Tab and navigate to
~/SD/HTML/index.html(Command-O). -
In your CSS document:
- Target all of the
<h1>tags and give them the propertycolor: red. - Target the
font40class and give them the propertyfont-size: 40px;. - Target the
header2id and give it the propertycolor: #29c2d4;. - Target the
list1id and give it the propertyfont-weight: bold;. -
Target the
list2id and give it the propertyfont-family: cursive;. -
Refresh your Browser Tab.
-
When finished, leave atom open with these two files. We will be editing them throughout this section.