Skip to main content

HTML BASICS : CLASS 102

Hello and welcome back.
This is the second class in a series of tutorials for beginners in web development.
You can access the first one here.


By this point you should have a file named my_site.html with the following code in it:

<!DOCTYPE html>
<html>
<head>
    <title></title>
</head>
<body>
    <h4>NASA | JPL</h4>
    <h1>ON A MISSION</h1>
    <h2>PODCAST</h2>
</body>
</html>


Great!
It is a bit weird having a couple of headings with no further details, isn't it?
Let us add some more text that explains what this whole 'NASA ON A MISSION PODCAST' stuff is about.
For this we will use a different tag, the paragraph tag which opens with '<p>' and closes with a '</p>' . 
After the bottom heading, type the following : 

<p>A new podcast from NASA</p>

  • Click 'File' then 'Save' ( OR hold Ctrl & S together if your are on a windows PC , CMD & S  together if you are on a mac ).
  • Go to the folder where this file is saved, double click on it to view in your browser.
Cool. Now your website has a paragraph in addition to the headings.
Lets add something more interesting. A list tag.
A list tag in html is used to display lists (pretty obvious huh!).
There are 2 kinds of lists, namely ordered list and unordered list.
An ordered list is simply a numbered list, i.e. a list of things that have a specific order. For example, here is a list of the first 4 months in a year;
  1. January
  2. February
  3. March
  4. April 
On the other hand an unordered list is simply a list that is not numbered, i.e. there is no order to them. For example, here is a list of fruits;
  • Mangoes
  • Oranges
  • Carrots (I refuse to call them vegetables, sue me!)
  • Bananas
Got it? Awesome! Now lets add 2 lists to our site.
Open my_site.html in Sublime text (Or whichever text editor you decided to go with) and type the following after the paragraph.

<ul>
        <li>Arrival</li>
        <li>We Are the World</li>
        <li>Worlds of Wonder</li>
</ul>

This is an unordered list, containing items [ Arrival , We Are the World and Worlds of Wonder ].
It starts with an opening tag <ul> (the ul stands for unordered list),
followed by the the items(things) in the list. 
Each item(thing) is written inside <li></li> (where li stands for list item).
A list can have as many items as you wish, just remember that each item must be enclosed with the <li></li> tags.
When you are done listing your items, close the unordered list with the closing unordered list tag </ul>.

Below this list, lets add an ordered list.
Type the following after closing the unordered list, in a new line.

<ol>
        <li>NASA is cool</li>
        <li>Coding comes second, arguably.</li>
        <li>What is third place?!</li>
</ol>



This is an ordered list, containing items [ NASA is cool, Coding comes second, arguably and What is third place?! ].
It starts with an opening tag <ol> (the ol stands for ordered list),
followed by the the items(things) in the list. 
Each item(thing) is written inside <li></li> (again, li stands for list item).
A list can have as many items as you wish, just remember that each item must be enclosed with the <li></li> tags.
When you are done listing your items, close the ordered list with the closing unordered list tag </ol>.

As you can see, the only difference in how you add an ordered list vs how you add an unordered list is the use of enclosing tags <ol></ol> and <ul></ul> respectively. 

Save the file and open it in your browser (you should know how to do this by now).
Notice the difference in how the ordered list is displayed compared to the unordered list below it.

That is it for today, congrats! Play around with the lists by adding your own items (a list of vegetables with carrots in it maybe).
As always, leave a question in the comments section if you have any.
And here is a video you can use to follow up.
Bye for now.



Comments

Popular posts from this blog

CSS BASICS : CLASS 107

Hello and welcome back to this series of tutorials for beginners in web development. So far we have a simple html page and a css file linked to it. We begin this tutorial by creating new html and css files, in the same folder as where my_site.html is located. We shall call them index.html and index.css respectively. Done? Great! Link the two files together , by opening up index.html in your text editor (e.g. Sublime Text) and typing the following code below the closing title tag  </title>  and before the closing head tag </head> :               <link rel="stylesheet" type="text/css" href="index.css"> Inside the body of your html (i.e after <body> and before </body>),  type the following html code :              <p> This is a paragraph </p>              <p> This is a second paragraph </p>              <p> This is a third paragraph </p> Save your index.html file. Then open the

HTML BASICS : CLASS 109 part I

Hello and welcome back to this tutorial series for beginners in web development. This class introduces the html 'div' tag and form elements. Let's begin by learning about the html 'div' tag. " div " stands for division . It allows you to group and separate content into different sections . Consider the image below. The image above shows a common layout (way of arranging elements)  for many web pages. It consists of;  a top area called the header, where most sites place a logo and site name as well as navigation links (links to other parts of the website)  a bottom area called the footer, where most sites place contact information and social media links. a side bar, which can be on the right side or left side. Some sites have two side bars, one on each side. and a main content area, where the main content of the page is displayed. For example. This blog site has a header at the top. It contains the name of the site 'In Relatable Te

HTML BASICS : TEST YOURSELF

Hello and welcome back. Test your knowledge of the concepts we have learnt so far, by creating a website that looks as seen in images the below, before continuing with the next part.   Click on each image to zoom in (or better yet, save them in your pc). You can get the image used by clicking here . As always, if you have any questions / comments, leave them in the comment section below.