With all we've learned so far.
We can create an array that contains a list of articles we can use an IF statement to display a message.
If the list is empty and we can display all the articles in the array regardless of its size using a
far each loop.
However when we view this in a browser it's all on one line and we haven't got any formatting.
I'll lay out a tall to do that.
We need to use it to email.
H.
T email are hypertext mark-up language is a way for you to tell a web browser how some text is structured.
It's not a programming language like P HP.
It's a mark-up language.
We make up parts of a document to make them appear.
Act in a certain way when the document is viewed in a web browser.
H t email consists of a series of elements of which there are two types.
The first is used to wrap some text and consists of an opening tag and an end tag for example to mark
up a piece of text as a paragraph.
We close it in paragraph tacks the opening tag marks where the paragraph begins and the closing tag
marks where it ends.
Tags are the elements name surrounded by angle brackets and the closing tag has an additional far would
slash before the elements.
Name.
H t mailed tags can also have attributes for example to make a piece of text into a link that you can
click on.
We use the they are anchor elements we wrap the text of the link in a tags and add an H ref R hypertext
reference attribute to the opening tag.
This contains the address that you want the link to go to when it clicked on.
Attributes are specified with the name of the attribute followed by an equal sign and the value of the
attribute in double quotes.
Note that there are no spaces before or after the equals sign.
The second type of astm element is one that doesn't have a closing tag as it doesn't wrap anything.
For example to insert an image into a web page we use the image element.
This soss attribute specifies the name of the image file you want to display with tags like this you
can optionally put a closing slash at the end and you might see this done in other people's code but
it's not required.
Will learn more about all these tags we've just seen later on.
Let's look at an example.
We'll create a new file and call it index.
It's 2:00 a.m.
in here.
Let's add some text.
And even though we have these lines of text on separate lines with blank lines.
Carriage returns at the end of each line.
When we open this file in a browser
it's a whole appears joined together.
Let's fix that by adding some ace to email tags.
First let's mark up the title as a header.
Headers in h t email have different levels which is what this number is which will then about later.
Then let's mark up the paragraphs using the paragraph tag.
And finally let's add emphasis tags to this word here.
Now when we view this in the browser we have the title formatted as a heading on its own line and in
a larger font we have two paragraphs separated by a carriage return and this word has been emphasized
by making it italic the XT team of tags are hidden when you view the web page like this as the browser
has used them to change how we see the documents.
But you can if you want to view the soss to see the s t AML.
Finally in this video I just want to mention what's known as the web servers default document.
We've called our H team mail file index that h.t. AML and this is what we put in the web browsers address
bar to view the file.
However if we remove this and don't specify anything.
The web server will look for a file card index to h.t. email by default so we can remove this from the
address and still see our file later on.
We'll see how we can do this with P HP files too.